Skip to content

Commit fd2b69d

Browse files
committed
feat: Add hgnc_symbol field to TxSelectResult and update protein reference selection to set it
1 parent 8c77d7d commit fd2b69d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/dcd_mapping/schemas.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ class TxSelectResult(BaseModel):
152152
is_full_match: StrictBool
153153
transcript_mode: TranscriptPriority | None = None
154154
sequence: str
155+
hgnc_symbol: str | None = None
155156

156157

157158
class MappedScore(BaseModel):

src/dcd_mapping/transcripts.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ async def _select_protein_reference(
173173
raise TxSelectError(msg)
174174
nm_accession = None
175175
tx_mode = None
176+
hgnc_symbol = None
176177
else:
177178
mane_transcripts = get_mane_transcripts(common_transcripts)
178179
best_tx = _choose_best_mane_transcript(mane_transcripts)
@@ -185,6 +186,7 @@ async def _select_protein_reference(
185186
nm_accession = best_tx.refseq_nuc
186187
np_accession = best_tx.refseq_prot
187188
tx_mode = best_tx.transcript_priority
189+
hgnc_symbol = best_tx.symbol
188190

189191
protein_sequence = _get_protein_sequence(target_gene.target_sequence)
190192
is_full_match = ref_sequence.find(protein_sequence) != -1
@@ -197,6 +199,7 @@ async def _select_protein_reference(
197199
is_full_match=is_full_match,
198200
sequence=protein_sequence,
199201
transcript_mode=tx_mode,
202+
hgnc_symbol=hgnc_symbol,
200203
)
201204

202205

0 commit comments

Comments
 (0)