Skip to content

Commit

Permalink
fix: SequenceLocation start/end for TranscriptSegmentElement (#…
Browse files Browse the repository at this point in the history
…172)

close #171

The tests for transcript segment elements are kind of confusing IMO. `transcript_segments` test fixture in `test_models` leverages `sequence_locations`. Some of these sequence locations have both start/end, but we only use start or end. I didn't change these because I don't think the values are actually tested. We can revisit in the future.
  • Loading branch information
korikuzma committed Aug 22, 2024
1 parent b6988b7 commit 0341b3b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 40 deletions.
26 changes: 13 additions & 13 deletions src/fusor/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,26 +170,26 @@ def check_exons(cls, values):
"label": "TPM3",
},
"elementGenomicStart": {
"id": "ga4gh:SL.2K1vML0ofuYrYncrzzXUQOISRFJldZrO",
"id": "ga4gh:SL.Q8vkGp7_xR9vI0PQ7g1IvUUeQ4JlJG8l",
"digest": "Q8vkGp7_xR9vI0PQ7g1IvUUeQ4JlJG8l",
"type": "SequenceLocation",
"sequenceReference": {
"id": "refseq:NC_000001.11",
"type": "SequenceReference",
"refgetAccession": "SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO",
},
"start": 154192135,
"end": 154192136,
"end": 154192135,
},
"elementGenomicEnd": {
"id": "ga4gh:SL.rtR6x2NnJEpROlxiT_DY9C-spf6ijYQi",
"id": "ga4gh:SL.Lnne0bSsgjzmNkKsNnXg98FeJSrDJuLb",
"digest": "Lnne0bSsgjzmNkKsNnXg98FeJSrDJuLb",
"type": "SequenceLocation",
"sequenceReference": {
"id": "refseq:NC_000001.11",
"type": "SequenceReference",
"refgetAccession": "SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO",
},
"start": 154170399,
"end": 154170400,
},
}
},
Expand Down Expand Up @@ -703,26 +703,26 @@ class CategoricalFusion(AbstractFusion):
"label": "TPM3",
},
"elementGenomicStart": {
"id": "ga4gh:SL.2K1vML0ofuYrYncrzzXUQOISRFJldZrO",
"id": "ga4gh:SL.Q8vkGp7_xR9vI0PQ7g1IvUUeQ4JlJG8l",
"digest": "Q8vkGp7_xR9vI0PQ7g1IvUUeQ4JlJG8l",
"type": "SequenceLocation",
"sequenceReference": {
"id": "refseq:NC_000001.11",
"refgetAccession": "SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO",
"type": "SequenceReference",
"refgetAccession": "SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO",
},
"start": 154192135,
"end": 154192136,
"end": 154192135,
},
"elementGenomicEnd": {
"id": "ga4gh:SL.m5_Spfzt1v4sfVw9u4kmuYn7dM7gyNeb",
"id": "ga4gh:SL.Lnne0bSsgjzmNkKsNnXg98FeJSrDJuLb",
"digest": "Lnne0bSsgjzmNkKsNnXg98FeJSrDJuLb",
"type": "SequenceLocation",
"sequenceReference": {
"id": "refseq:NC_000001.11",
"refgetAccession": "SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO",
"type": "SequenceReference",
"refgetAccession": "SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO",
},
"start": 154170398,
"end": 154170399,
"start": 154170399,
},
},
{
Expand Down
20 changes: 10 additions & 10 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,8 @@ def exhaustive_example(alk_gene, braf_gene, tpm3_gene):
"exonEndOffset": 0,
"gene": tpm3_gene,
"elementGenomicStart": {
"id": "ga4gh:SL.2K1vML0ofuYrYncrzzXUQOISRFJldZrO",
"id": "ga4gh:SL.Q8vkGp7_xR9vI0PQ7g1IvUUeQ4JlJG8l",
"digest": "Q8vkGp7_xR9vI0PQ7g1IvUUeQ4JlJG8l",
"description": None,
"xrefs": None,
"alternativeLabels": None,
Expand All @@ -754,11 +755,11 @@ def exhaustive_example(alk_gene, braf_gene, tpm3_gene):
"refgetAccession": "SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO",
"type": "SequenceReference",
},
"start": 154192135,
"end": 154192136,
"end": 154192135,
},
"elementGenomicEnd": {
"id": "ga4gh:SL.rtR6x2NnJEpROlxiT_DY9C-spf6ijYQi",
"id": "ga4gh:SL.Lnne0bSsgjzmNkKsNnXg98FeJSrDJuLb",
"digest": "Lnne0bSsgjzmNkKsNnXg98FeJSrDJuLb",
"description": None,
"xrefs": None,
"alternativeLabels": None,
Expand All @@ -770,7 +771,6 @@ def exhaustive_example(alk_gene, braf_gene, tpm3_gene):
"type": "SequenceReference",
},
"start": 154170399,
"end": 154170400,
},
},
{
Expand Down Expand Up @@ -868,7 +868,8 @@ def fusion_example():
"id": "hgnc:12012",
},
"elementGenomicStart": {
"id": "ga4gh:SL.2K1vML0ofuYrYncrzzXUQOISRFJldZrO",
"id": "ga4gh:SL.Q8vkGp7_xR9vI0PQ7g1IvUUeQ4JlJG8l",
"digest": "Q8vkGp7_xR9vI0PQ7g1IvUUeQ4JlJG8l",
"description": None,
"xrefs": None,
"alternativeLabels": None,
Expand All @@ -879,11 +880,11 @@ def fusion_example():
"refgetAccession": "SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO",
"type": "SequenceReference",
},
"start": 154192135,
"end": 154192136,
"end": 154192135,
},
"elementGenomicEnd": {
"id": "ga4gh:SL.rtR6x2NnJEpROlxiT_DY9C-spf6ijYQi",
"id": "ga4gh:SL.Lnne0bSsgjzmNkKsNnXg98FeJSrDJuLb",
"digest": "Lnne0bSsgjzmNkKsNnXg98FeJSrDJuLb",
"description": None,
"xrefs": None,
"alternativeLabels": None,
Expand All @@ -895,7 +896,6 @@ def fusion_example():
"type": "SequenceReference",
},
"start": 154170399,
"end": 154170400,
},
},
{
Expand Down
16 changes: 8 additions & 8 deletions tests/test_fusor.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,27 +194,27 @@ def transcript_segment_element():
"type": "Gene",
},
"transcript": "refseq:NM_152263.3",
"elementGenomicEnd": {
"id": "ga4gh:SL.Lnne0bSsgjzmNkKsNnXg98FeJSrDJuLb",
"digest": "Lnne0bSsgjzmNkKsNnXg98FeJSrDJuLb",
"elementGenomicStart": {
"id": "ga4gh:SL.Q8vkGp7_xR9vI0PQ7g1IvUUeQ4JlJG8l",
"digest": "Q8vkGp7_xR9vI0PQ7g1IvUUeQ4JlJG8l",
"type": "SequenceLocation",
"sequenceReference": {
"id": "refseq:NC_000001.11",
"refgetAccession": "SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO",
"type": "SequenceReference",
},
"start": 154170399,
"end": 154192135,
},
"elementGenomicStart": {
"id": "ga4gh:SL.Q8vkGp7_xR9vI0PQ7g1IvUUeQ4JlJG8l",
"digest": "Q8vkGp7_xR9vI0PQ7g1IvUUeQ4JlJG8l",
"elementGenomicEnd": {
"id": "ga4gh:SL.Lnne0bSsgjzmNkKsNnXg98FeJSrDJuLb",
"digest": "Lnne0bSsgjzmNkKsNnXg98FeJSrDJuLb",
"type": "SequenceLocation",
"sequenceReference": {
"id": "refseq:NC_000001.11",
"refgetAccession": "SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO",
"type": "SequenceReference",
},
"end": 154192135,
"start": 154170399,
},
}
return TranscriptSegmentElement(**params)
Expand Down
14 changes: 5 additions & 9 deletions tests/test_nomenclature.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ def exon_offset_example():
"refgetAccession": "SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO",
"type": "SequenceReference",
},
"start": 156864428,
"end": 156864429,
"start": 156864353,
},
},
],
Expand All @@ -147,26 +146,24 @@ def tx_seg_example():
exonEndOffset=0,
gene=Gene(id="hgnc:12012", label="TPM3"),
elementGenomicStart={
"id": "ga4gh:SL.2K1vML0ofuYrYncrzzXUQOISRFJldZrO",
"id": "ga4gh:SL.Q8vkGp7_xR9vI0PQ7g1IvUUeQ4JlJG8l",
"type": "SequenceLocation",
"sequenceReference": {
"id": "refseq:NC_000001.11",
"refgetAccession": "SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO",
"type": "SequenceReference",
},
"start": 154192135,
"end": 154192136,
"end": 154192135,
},
elementGenomicEnd={
"id": "ga4gh:SL.rtR6x2NnJEpROlxiT_DY9C-spf6ijYQi",
"id": "ga4gh:SL.Lnne0bSsgjzmNkKsNnXg98FeJSrDJuLb",
"type": "SequenceLocation",
"sequenceReference": {
"id": "refseq:NC_000001.11",
"refgetAccession": "SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO",
"type": "SequenceReference",
},
"start": 154170399,
"end": 154170400,
},
)

Expand All @@ -185,15 +182,14 @@ def junction_example():
"id": "hgnc:12012",
},
elementGenomicEnd={
"id": "ga4gh:SL.rtR6x2NnJEpROlxiT_DY9C-spf6ijYQi",
"id": "ga4gh:SL.Lnne0bSsgjzmNkKsNnXg98FeJSrDJuLb",
"type": "SequenceLocation",
"sequenceReference": {
"id": "refseq:NC_000001.11",
"refgetAccession": "SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO",
"type": "SequenceReference",
},
"start": 154170399,
"end": 154170400,
},
)

Expand Down

0 comments on commit 0341b3b

Please sign in to comment.