88
99from cool_seq_tool .handlers .seqrepo_access import SeqRepoAccess
1010from cool_seq_tool .mappers .liftover import LiftOver
11+ from cool_seq_tool .mappers .mane_transcript import ManeTranscript
1112from cool_seq_tool .schemas import (
13+ AnnotationLayer ,
1214 Assembly ,
1315 BaseModelForbidExtra ,
1416 CoordinateType ,
@@ -273,6 +275,7 @@ def __init__(
273275 self ,
274276 seqrepo_access : SeqRepoAccess ,
275277 uta_db : UtaDatabase ,
278+ mane_transcript : ManeTranscript ,
276279 mane_transcript_mappings : ManeTranscriptMappings ,
277280 liftover : LiftOver ,
278281 ) -> None :
@@ -297,11 +300,13 @@ def __init__(
297300
298301 :param seqrepo_access: SeqRepo instance to give access to query SeqRepo database
299302 :param uta_db: UtaDatabase instance to give access to query UTA database
303+ :param mane_transcript: ManeTranscript instance to give access to ManeTranscript class
300304 :param mane_transcript_mappings: Instance to provide access to ManeTranscriptMappings class
301305 :param liftover: Instance to provide mapping between human genome assemblies
302306 """
303307 self .seqrepo_access = seqrepo_access
304308 self .uta_db = uta_db
309+ self .mane_transcript = mane_transcript
305310 self .mane_transcript_mappings = mane_transcript_mappings
306311 self .liftover = liftover
307312
@@ -870,14 +875,18 @@ async def _genomic_to_tx_segment(
870875 if mane_transcripts :
871876 transcript = mane_transcripts [0 ]["RefSeq_nuc" ]
872877 else :
873- # Attempt to find a coding transcript if a MANE transcript
878+ # Attempt to find longest compatible transcript if a MANE transcript
874879 # cannot be found
875- results = await self .uta_db .get_transcripts (
876- gene = gene , alt_ac = genomic_ac
880+ results = await self .mane_transcript .get_longest_compatible_transcript (
881+ start_pos = genomic_pos ,
882+ end_pos = genomic_pos ,
883+ gene = gene ,
884+ alt_ac = genomic_ac ,
885+ start_annotation_layer = AnnotationLayer .GENOMIC ,
877886 )
878887
879- if not results . is_empty () :
880- transcript = results [ 0 ][ "tx_ac" ][ 0 ]
888+ if results :
889+ transcript = results . refseq
881890 else :
882891 # Run if gene is for a noncoding transcript
883892 query = f"""
0 commit comments