-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathngs_models.py
More file actions
37 lines (33 loc) · 2.47 KB
/
ngs_models.py
File metadata and controls
37 lines (33 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from pydantic import BaseModel, Field
from typing import List, Optional
from datetime import date
class Variant(BaseModel):
"""
A class to represent a single genetic variant found in an NGS report.
"""
gene_name: str = Field(..., description="The name of the gene with the variant, e.g., 'ESR1'.")
variant_type: str = Field(..., description="Type of genetic variation, e.g., 'Missense'.")
chromosome_location: str = Field(..., description="The chromosomal location of the variant.")
exon_intron: Optional[str] = Field(None, description="The specific exon or intron number.")
protein_change: Optional[str] = Field(None, description="The change in the protein sequence, e.g., 'p.Arg538Gly'.")
clinical_significance: Optional[str] = Field(None, description="Clinical significance of the variant, e.g., 'PATHOGENIC'.")
drug_comment: Optional[str] = Field(None, description="Comments related to drugs.")
mutant_allele_evidence: Optional[str] = Field(None, description="Evidence for the mutant allele.")
reference_id: Optional[str] = Field(None, description="A reference ID for the variant, e.g., 'rs5823449'.")
therapy_drugs: Optional[List[str]] = Field(None, description="Associated therapy drugs.")
final_suggested_drugs: Optional[List[str]] = Field(None, description="Final suggested drugs based on the finding.")
pathways_involved: Optional[List[str]] = Field(None, description="Biological pathways involved with this variant.")
class NGSReport(BaseModel):
"""
A Pydantic model to represent a patient's Next-Generation Sequencing (NGS) report.
"""
patient_name: str = Field(..., description="Name of the patient.")
date_of_test: date = Field(..., description="Date the test was performed.")
assay_method: str = Field(..., description="The name of the NGS assay used, e.g., 'TARGET V(2)IENCE'.")
variants: List[Variant] = Field(..., description="A list of genetic variants identified in the report.")
tmb_value: Optional[str] = Field(None, description="Tumor Mutational Burden (TMB) value.")
tmb_percentile: Optional[int] = Field(None, description="TMB percentile.")
tmb_score: Optional[str] = Field(None, description="TMB score, e.g., 'Low'.")
tmb_unit: Optional[str] = Field(None, description="The unit of measurement for the TMB value.")
hospital_name: str = Field(..., description="Name of the hospital or laboratory.")
hospital_location: str = Field(..., description="Location of the hospital or laboratory.")