Skip to content

Commit

Permalink
feat!: update to vrs 2.0 models (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
katiestahl authored Aug 2, 2024
1 parent d2eee81 commit 240bbff
Show file tree
Hide file tree
Showing 19 changed files with 1,915 additions and 2,388 deletions.
12 changes: 7 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ classifiers = [
requires-python = ">=3.10"
description = "Computable object representation and validation for gene fusions"
license = {file = "LICENSE"}
# pydantic is pinned to 2.4.2 for now, since there is a change in later versions that causes a validation error for test_fusion in test_fusor.py
dependencies = [
"pydantic == 2.*",
"ga4gh.vrsatile.pydantic ~=0.2.0",
"ga4gh.vrs ~=0.8.1",
"pydantic ==2.4.2",
"ga4gh.vrs ~=2.0.0a10",
"biocommons.seqrepo",
"gene-normalizer ~=0.1.40-dev1",
"gene-normalizer ==0.4.0",
"cool-seq-tool ~=0.5.1",
]
dynamic=["version"]
Expand Down Expand Up @@ -153,11 +153,13 @@ ignore = [
# ANN102 - missing-type-cls
# S101 - assert
# B011 - assert-false
# N803 - invalid-argument-name
# N805 - invalid-first-argument-name-for-method
# N815 - mixed-case-variable-in-class-scope
# INP001 - implicit-namespace-package
# SLF001 - private-member-access
"tests/*" = ["ANN001", "ANN2", "ANN102", "S101", "B011", "INP001", "SLF001"]
"src/fusor/models.py" = ["ANN201", "N805", "ANN001", "ANN2", "ANN102"]
"src/fusor/models.py" = ["ANN201", "N803", "N805", "N815", "ANN001", "ANN2", "ANN102"]

[tool.ruff.format]
docstring-code-format = true
48 changes: 19 additions & 29 deletions src/fusor/examples/alk.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,39 @@
{
"type": "CategoricalFusion",
"critical_functional_domains": [
"criticalFunctionalDomains": [
{
"type": "FunctionalDomain",
"_id": "interpro:IPR017441",
"id": "interpro:IPR017441",
"label": "Protein kinase, ATP binding site",
"status": "preserved",
"associated_gene": {
"id": "normalize.gene:hgnc%3A427",
"type": "GeneDescriptor",
"associatedGene": {
"type": "Gene",
"label": "ALK",
"gene_id": "hgnc:427"
"id": "hgnc:427"
},
"sequence_location": {
"id": "fusor.location_descriptor:NP_004295.2",
"type": "LocationDescriptor",
"location": {
"type": "SequenceLocation",
"sequence_id": "refseq:NP_004295.2",
"interval": {
"type": "SequenceInterval",
"start": {
"type": "Number",
"value": 1122
},
"end": {
"type": "Number",
"value": 1150
}
}
}
"sequenceLocation": {
"id": "ga4gh:SL.zKwNiezVOyfNBKwAnFuFWMdMlrcc3kBA",
"type": "SequenceLocation",
"sequenceReference": {
"id": "refseq:NP_004295.2",
"refgetAccession": "SQ.q9CnK-HKWh9eqhOi8FlzR7M0pCmUrWPs",
"type": "SequenceReference"
},
"start": 1122,
"end": 1150
}
}
],
"structural_elements": [
"structure": [
{
"type": "MultiplePossibleGenesElement"
},
{
"type": "GeneElement",
"gene_descriptor": {
"id": "normalize.gene:ALK",
"type": "GeneDescriptor",
"gene": {
"type": "Gene",
"label": "ALK",
"gene_id": "hgnc:427"
"id": "hgnc:427"
}
}
]
Expand Down
142 changes: 62 additions & 80 deletions src/fusor/examples/bcr_abl1.json
Original file line number Diff line number Diff line change
@@ -1,111 +1,93 @@
{
"type": "CategoricalFusion",
"structural_elements": [
"structure": [
{
"type": "TranscriptSegmentElement",
"transcript": "refseq:NM_004327.3",
"gene_descriptor": {
"type": "GeneDescriptor",
"id": "normalize.gene:BCR",
"gene_id": "hgnc:1014",
"gene": {
"type": "Gene",
"id": "hgnc:1014",
"label": "BCR"
},
"element_genomic_end": {
"id": "fusor.location_descriptor:NC_000022.11",
"type": "LocationDescriptor",
"label": "NC_000022.11",
"location": {
"type": "SequenceLocation",
"sequence_id": "refseq:NC_000022.11",
"interval": {
"type": "SequenceInterval",
"start": {
"type": "Number",
"value": 23253980
},
"end": {
"type": "Number",
"value": 23253981
}
}
}
"elementGenomicEnd": {
"id": "ga4gh:SL.5f5OVC3zReewA4S78X1eO0oJwWNbGYsY",
"type": "SequenceLocation",
"description": null,
"xrefs": null,
"alternativeLabels": null,
"extensions": null,
"sequenceReference": {
"id": "refseq:NC_000022.11",
"refgetAccession": "SQ.7B7SHsmchAR0dFcDCuSFjJAo7tX87krQ",
"type": "SequenceReference"
},
"start": 23253980,
"end": 23253981
},
"exon_end": 2,
"exon_end_offset": 182
"exonEnd": 2,
"exonEndOffset": 182
},
{
"type": "LinkerSequenceElement",
"linker_sequence": {
"linkerSequence": {
"id": "sequence:ACTAAAGCG",
"type": "SequenceDescriptor",
"sequence": "ACTAAAGCG",
"residue_type": "SO:0000348"
"type": "LiteralSequenceExpression",
"sequence": "ACTAAAGCG"
}
},
{
"type": "TranscriptSegmentElement",
"transcript": "refseq:NM_005157.5",
"exon_start": 2,
"exon_start_offset": -173,
"gene_descriptor": {
"id": "normalize.gene:ABL1",
"type": "GeneDescriptor",
"exonStart": 2,
"exonStartOffset": -173,
"gene": {
"type": "Gene",
"label": "ABL1",
"gene_id": "hgnc:76"
"id": "hgnc:76"
},
"element_genomic_start": {
"id": "fusor.location_descriptor:NC_000009.12",
"type": "LocationDescriptor",
"label": "NC_000009.12",
"location": {
"type": "SequenceLocation",
"sequence_id": "refseq:NC_000009.12",
"interval": {
"type": "SequenceInterval",
"start": {
"type": "Number",
"value": 130854064
},
"end": {
"type": "Number",
"value": 130854065
}
}
}
"elementGenomicStart": {
"id": "ga4gh:SL.tZYgaEJP2-d4Guv-n5gyhqOc07qH9xr6",
"description": null,
"xrefs": null,
"alternativeLabels": null,
"extensions": null,
"type": "SequenceLocation",
"sequenceReference": {
"id": "refseq:NC_000009.12",
"refgetAccession": "SQ.KEO-4XBcm1cxeo_DIQ8_ofqGUkp4iZhI",
"type": "SequenceReference"
},
"start": 130854064,
"end": 130854065
}
}
],
"reading_frame_preserved": true,
"critical_functional_domains": [
"readingFramePreserved": true,
"criticalFunctionalDomains": [
{
"type": "FunctionalDomain",
"status": "preserved",
"associated_gene": {
"id": "normalize.gene:hgnc%3A76",
"type": "GeneDescriptor",
"associatedGene": {
"type": "Gene",
"label": "ABL1",
"gene_id": "hgnc:76"
"id": "hgnc:76"
},
"_id": "interpro:IPR000980",
"id": "interpro:IPR000980",
"label": "SH2 domain",
"sequence_location": {
"id": "fusor.location_descriptor:NP_005148.2",
"type": "LocationDescriptor",
"location": {
"type": "SequenceLocation",
"sequence_id": "refseq:NP_005148.2",
"interval": {
"type": "SequenceInterval",
"start": {
"type": "Number",
"value": 127
},
"end": {
"type": "Number",
"value": 202
}
}
}
"sequenceLocation": {
"id": "ga4gh:SL.VQe2sf2aYArPcvjygq38JvFxRuDniE15",
"description": null,
"xrefs": null,
"alternativeLabels": null,
"extensions": null,
"type": "SequenceLocation",
"sequenceReference": {
"id": "refseq:NP_005148.2",
"refgetAccession": "SQ.dmFigTG-0fY6I54swb7PoDuxCeT6O3Wg",
"type": "SequenceReference"
},
"start": 127,
"end": 202
}
}
]
Expand Down
Loading

0 comments on commit 240bbff

Please sign in to comment.