Data Models & Global Constants
Relevant source files
The following files were used as context for generating this wiki page:
- src/constants/datafields/genome_sequence.ts
- src/lib/forms/(protein-tools)/msa-snp-analysis/msa-snp-analysis-form-schema.ts
- src/lib/forms/(viral-tools)/subspecies-classification/subspecies-classification-form-schema.ts
- src/lib/forms/(viral-tools)/sars-cov2-genome-analysis/sars-cov2-genome-analysis-form-schema.ts
- src/lib/services/service-info.ts
- src/styles/theme-content.ts
- src/app/allTermSearchResults.tsx
Introduction
The Data Models & Global Constants within the DXKB project define the structural foundations for biological data representation, service parameters, and application-wide configurations. These models ensure consistency across various bioinformatics tools, including genome assembly, variation analysis, and taxonomic classification, by providing strongly typed schemas and standardized field definitions.
These constants encompass everything from biological entity attributes (genomes, sequences, and features) to UI-specific content mapping for different project themes (zinc, dxkb, or bvbrc). By centralizing these definitions, the system maintains a unified interface for complex scientific data interactions and API communications.
Biological Data Models
Genome Sequence Fields
The project defines a standardized structure for genomic sequence metadata, categorized into logical groups such as General Info, Sequence Info, Taxonomy Info, and Additional Info.
| Field | Label | Group | Description |
|---|---|---|---|
genome_id | Genome ID | General Info | Unique identifier for the genome. |
accession | Accession | Sequence Info | NCBI NucCore accession number. |
sequence_type | Sequence Type | Sequence Info | Type of sequence (e.g., chromosome, plasmid). |
gc_content | GC Content % | Sequence Info | Percentage of Guanine and Cytosine. |
length | Length (bp) | Sequence Info | Total length of the sequence in base pairs. |
Sources: src/constants/datafields/genome_sequence.ts:1-105
Search Result Data Types
The system processes various biological entities during search operations, each requiring specific metadata formatting for the user interface.
The search system supports specialized types including taxonomy, genome, strain, genome_feature, epitope, and protein_structure.
Sources: src/app/allTermSearchResults.tsx:112-280
Service Parameter Models
MSA & SNP Analysis Schema
The Multiple Sequence Alignment (MSA) and SNP analysis module utilizes a strict Zod schema to validate input sources, reference types, and alignment strategies.
| Parameter | Type | Valid Values |
|---|---|---|
input_status | Enum | unaligned, aligned |
alphabet | Enum | dna, protein |
aligner | Enum | Mafft, Muscle |
ref_type | Enum | none, first, feature_id, genome_id, string |
Sources: src/lib/forms/(protein-tools)/msa-snp-analysis/msa-snp-analysis-form-schema.ts:4-44
Subspecies Classification Options
Global constants define a fixed list of virus types supported for subspecies classification, mapped to legacy API values from the BV-BRC project.
export const subspeciesVirusTypeOptions = [
{ value: "MASTADENOA", label: "Adenoviridae - Human mastadenovirus A" },
{ value: "DENGUE", label: "Flaviviridae - Dengue virus" },
{ value: "HCV", label: "Flaviviridae - Hepatitis C virus" },
{ value: "INFLUENZAH5", label: "Orthomyxoviridae - Influenza A H5" },
{ value: "MPOX", label: "Poxviridae - Monkeypox virus" },
];
Sources: src/lib/forms/(viral-tools)/subspecies-classification/subspecies-classification-form-schema.ts:13-40
Global UI and Theme Constants
Theme Content Mapping
The application supports multiple themes (DXKB, BV-BRC, and generic variants) using a centralized mapping system to control site naming, funding statements, and welcome subtitles.
Content Definitions:
- DXKB: "Disease X Knowledge Base" - Funded via Federal funds awarded to the University of Chicago.
- BV-BRC: "Bacterial and Viral Bioinformatics Resource Center" - Funded by NIAID/NIH under Grant No. U24AI183849.
Sources: src/styles/theme-content.ts:4-58
Service Metadata & Documentation
Global constants are used to populate informational popups throughout the service forms, providing technical context for users.
Read Input Metadata
Documentation constants define the standard handling for different read libraries:
- Paired-end reads: Expected as file pairs (Read 1 and Read 2) where each read occurs in the same Nth position as its mate.
- SRA Accession: Numerical identifiers used to pull data directly from the NCBI Sequence Read Archive.
Sources: src/lib/services/service-info.ts:7-36
Summary
Data Models and Global Constants in DXKB facilitate the rigorous validation and standardized representation required for bioinformatics workflows. By utilizing Zod schemas for service parameters and structured field definitions for biological entities, the project ensures data integrity from user input through to API submission and result rendering. Additionally, the thematic constant system allows the platform to serve multiple organizational identities while maintaining a shared codebase.