Skip to content

Commit 324253a

Browse files
committed
Update docstring and modify test
1 parent 357090c commit 324253a

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

src/cool_seq_tool/sources/uta_database.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,8 @@ async def get_genomic_tx_data(
621621
"""Get transcript mapping to genomic data.
622622
623623
:param tx_ac: Accession on c. coordinate
624-
:param pos: (start pos, end pos)
624+
:param pos: (start pos, end pos). These must describe the inter-residue
625+
coordinates that are being examined.
625626
:param annotation_layer: Annotation layer for ``ac`` and ``pos``
626627
:param alt_ac: Accession on g. coordinate
627628
:param target_genome_assembly: Genome assembly to get genomic data for.

tests/sources/test_uta_database.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,25 @@ async def test_mane_c_genomic_data(test_db):
202202
@pytest.mark.asyncio
203203
async def test_get_genomic_tx_data(test_db, genomic_tx_data):
204204
"""Test that get_genomic_tx_data works correctly."""
205-
resp = await test_db.get_genomic_tx_data("NM_004333.4", (2145, 2145))
205+
# Positive strand transcript
206+
resp = await test_db.get_genomic_tx_data("NM_004327.3", (3595, 3596))
207+
expected_params = {
208+
"gene": "BCR",
209+
"strand": Strand.POSITIVE,
210+
"tx_pos_range": (3476, 3608),
211+
"alt_pos_range": (23295023, 23295155),
212+
"alt_aln_method": "splign",
213+
"tx_exon_id": 956565,
214+
"alt_exon_id": 6619783,
215+
"tx_ac": "NM_004327.3",
216+
"alt_ac": "NC_000022.11",
217+
"pos_change": (119, 12),
218+
"alt_pos_change_range": (23295142, 23295143),
219+
}
220+
assert resp == GenomicTxMetadata(**expected_params)
221+
222+
# Negative strand transcript
223+
resp = await test_db.get_genomic_tx_data("NM_004333.4", (2144, 2145))
206224
expected_params = {
207225
"gene": "BRAF",
208226
"strand": Strand.NEGATIVE,
@@ -213,8 +231,8 @@ async def test_get_genomic_tx_data(test_db, genomic_tx_data):
213231
"alt_exon_id": 6619852,
214232
"tx_ac": "NM_004333.4",
215233
"alt_ac": "NC_000007.14",
216-
"pos_change": (92, 43),
217-
"alt_pos_change_range": (140739854, 140739854),
234+
"pos_change": (91, 43),
235+
"alt_pos_change_range": (140739855, 140739854),
218236
}
219237
assert resp == GenomicTxMetadata(**expected_params)
220238

0 commit comments

Comments
 (0)