Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/cool_seq_tool/mappers/exon_genomic_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,14 +778,13 @@ async def _genomic_to_tx_segment(
)

if genomic_ac:
genomic_ac_validation = await self.uta_db.validate_genomic_ac(genomic_ac)
if not genomic_ac_validation:
grch38_ac = await self.uta_db.get_newest_assembly_ac(genomic_ac)
if grch38_ac:
genomic_ac = grch38_ac[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth adding something in the docstrings (for both private + public method) about version will be ignored for GRCh37?

else:
return GenomicTxSeg(
errors=[f"Genomic accession does not exist in UTA: {genomic_ac}"]
)
if starting_assembly == Assembly.GRCH37:
grch38_ac = await self.uta_db.get_newest_assembly_ac(genomic_ac)
genomic_ac = grch38_ac[0]
else:
genomic_acs, err_msg = self.seqrepo_access.chromosome_to_acs(chromosome)

Expand Down
4 changes: 2 additions & 2 deletions tests/mappers/test_exon_genomic_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -1499,13 +1499,13 @@ async def test_invalid(test_egc_mapper):

# Invalid accession
resp = await test_egc_mapper.genomic_to_tx_segment(
genomic_ac="NC_000001.200",
genomic_ac="NC_000035.200",
seg_start_genomic=154191901,
seg_end_genomic=154192135,
transcript="NM_152263.3",
)
genomic_tx_seg_service_checks(resp, is_valid=False)
assert resp.errors == ["Genomic accession does not exist in UTA: NC_000001.200"]
assert resp.errors == ["Genomic accession does not exist in UTA: NC_000035.200"]

# Invalid coordinates
resp = await test_egc_mapper.genomic_to_tx_segment(
Expand Down
Loading