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
3 changes: 2 additions & 1 deletion src/cool_seq_tool/sources/uta_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,8 @@ async def get_genomic_tx_data(
"""Get transcript mapping to genomic data.

:param tx_ac: Accession on c. coordinate
:param pos: (start pos, end pos)
:param pos: (start pos, end pos). These must describe the inter-residue
coordinates that are being examined.
:param annotation_layer: Annotation layer for ``ac`` and ``pos``
:param alt_ac: Accession on g. coordinate
:param target_genome_assembly: Genome assembly to get genomic data for.
Expand Down
24 changes: 21 additions & 3 deletions tests/sources/test_uta_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,25 @@ async def test_mane_c_genomic_data(test_db):
@pytest.mark.asyncio
async def test_get_genomic_tx_data(test_db, genomic_tx_data):
"""Test that get_genomic_tx_data works correctly."""
resp = await test_db.get_genomic_tx_data("NM_004333.4", (2145, 2145))
# Positive strand transcript
resp = await test_db.get_genomic_tx_data("NM_004327.3", (3595, 3596))
expected_params = {
"gene": "BCR",
"strand": Strand.POSITIVE,
"tx_pos_range": (3476, 3608),
"alt_pos_range": (23295023, 23295155),
"alt_aln_method": "splign",
"tx_exon_id": 956565,
"alt_exon_id": 6619783,
"tx_ac": "NM_004327.3",
"alt_ac": "NC_000022.11",
"pos_change": (119, 12),
"alt_pos_change_range": (23295142, 23295143),
}
assert resp == GenomicTxMetadata(**expected_params)

# Negative strand transcript
resp = await test_db.get_genomic_tx_data("NM_004333.4", (2144, 2145))
expected_params = {
"gene": "BRAF",
"strand": Strand.NEGATIVE,
Expand All @@ -213,8 +231,8 @@ async def test_get_genomic_tx_data(test_db, genomic_tx_data):
"alt_exon_id": 6619852,
"tx_ac": "NM_004333.4",
"alt_ac": "NC_000007.14",
"pos_change": (92, 43),
"alt_pos_change_range": (140739854, 140739854),
"pos_change": (91, 43),
"alt_pos_change_range": (140739855, 140739854),
}
assert resp == GenomicTxMetadata(**expected_params)

Expand Down