2323 "MOLECULAR_CONSEQUENCE" : "521" ,
2424 "PROTEIN_REFERENCE_SEQUENCE" : "522" ,
2525 "GENOMIC_REFERENCE_SEQUENCE_ID" : "524" ,
26- # "AMPLIFICATION": "525", TODO: I don't think we can go from GKS to this yet / no guarantee this is in extensions
26+ # "AMPLIFICATION": "525", Not supporting in proof of concept - this is for CNVs and we are not handling those yet (only simply variants)
2727 "REFERENCE_ALLELE" : "526" ,
2828 "OBSERVED_ALLELE" : "527" ,
2929 "GENOMIC_DNA_CHANGE" : "528" ,
4040 "VARIANT_CLASSIFICATION" : "553" ,
4141 "INTERPRETATION" : "554" ,
4242 "MODE_OF_INHERITANCE" : "560" ,
43- # This one has a dashed arrow but I can't remember why :(
43+ # Experimental functional effect in va-spec
4444 "FUNCTIONAL_EFFECT" : "561" ,
4545 "REPEAT_NUCLEOTIDES" : "564" ,
4646 "REPEAT_NUMBER" : "565" ,
@@ -76,6 +76,7 @@ def convert_gks_to_hl7_v2(statement: Statement) -> dict[str, Any]:
7676 genomic_allele , genomic_location = _find_genomic_allele_and_location (members )
7777
7878 # Get hgvs.g expression from the allele (e.g., 'NC_000007.13:g.140453136A>T')
79+ # use seqrepo here instead
7980 expression = _find_expression (genomic_allele , syntax = "hgvs.g" )
8081 hgvs_g = expression .value if expression else None
8182 chromosome , g_dot = _parse_hgvs_g (hgvs_g )
@@ -93,7 +94,7 @@ def convert_gks_to_hl7_v2(statement: Statement) -> dict[str, Any]:
9394
9495 # 520 - Amino Acid Change
9596
96- # 521 - Molecular Consequence
97+ # 521 - Molecular Consequence - on hold until approved
9798
9899 # 522 - Protein Reference Sequence
99100
@@ -156,7 +157,7 @@ def _find_genomic_allele_and_location(
156157 From a list of members, return the first (allele, location)
157158 whose location.sequenceReference.moleculeType == 'genomic'.
158159 # TODO: not sure if this is a reliable field to check for getting the genomic alleles -
159- # consider checking expressions instead or as a backup.
160+ # consider checking expressions instead or as a backup. -> yes
160161 """
161162 for allele in members :
162163 location = allele .location
@@ -165,6 +166,7 @@ def _find_genomic_allele_and_location(
165166 seq_ref = location .sequenceReference
166167 molecule_type = seq_ref .moleculeType if seq_ref else None
167168 # TODO: it would be nice to make this helper take this as a parameter for more potential usability later
169+ # TODO: use seq refget and lookup in seqrepo to get hgvs.g
168170 if molecule_type == "genomic" :
169171 return allele , location
170172 return None
@@ -203,7 +205,6 @@ def _parse_hgvs_g(hgvs_g_value: str) -> tuple[str, str]:
203205
204206 Expected styles:
205207 - 'NC_000007.13:g.140453136A>T'
206- # TODO: should we also accept 'chr7:g....' or '7:g....'?
207208
208209 Returns:
209210 (chromosome, g_dot) where chromosome is the left of ':', and g_dot includes 'g.' onwards.
0 commit comments