diff --git a/requirements.txt b/requirements.txt index 4e727d4d..4cf9ca2a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,7 +25,7 @@ decorator==5.1.1 executing==1.2.0 fake-useragent==1.1.3 fastapi==0.100.0 -fusor==0.0.30.dev1 +fusor==0.1.0 ga4gh.vrs==0.8.4 ga4gh.vrsatile.pydantic==0.2.0 gene-normalizer==0.1.40-dev1 diff --git a/server/setup.cfg b/server/setup.cfg index 42a3ef53..79a4d2e4 100644 --- a/server/setup.cfg +++ b/server/setup.cfg @@ -16,7 +16,7 @@ install_requires = fastapi >= 0.72.0 aiofiles asyncpg - fusor ~= 0.0.30-dev1 + fusor ~= 0.1.0 sqlparse >= 0.4.2 urllib3 >= 1.26.5 click diff --git a/server/tests/conftest.py b/server/tests/conftest.py index 46c481b8..27e97ef1 100644 --- a/server/tests/conftest.py +++ b/server/tests/conftest.py @@ -182,9 +182,9 @@ def tpm3_tx_g_element(tpm3_descriptor): "type": "TranscriptSegmentElement", "transcript": "refseq:NM_152263.4", "exon_start": 6, - "exon_start_offset": 5, + "exon_start_offset": 72, "exon_end": 6, - "exon_end_offset": -70, + "exon_end_offset": -5, "gene_descriptor": tpm3_descriptor, "element_genomic_start": { "id": "fusor.location_descriptor:NC_000001.11", @@ -195,8 +195,8 @@ def tpm3_tx_g_element(tpm3_descriptor): "sequence_id": "refseq:NC_000001.11", "interval": { "type": "SequenceInterval", - "start": {"type": "Number", "value": 154171483}, - "end": {"type": "Number", "value": 154171484}, + "start": {"type": "Number", "value": 154171416}, + "end": {"type": "Number", "value": 154171417}, }, }, }, @@ -209,8 +209,8 @@ def tpm3_tx_g_element(tpm3_descriptor): "sequence_id": "refseq:NC_000001.11", "interval": { "type": "SequenceInterval", - "start": {"type": "Number", "value": 154171482}, - "end": {"type": "Number", "value": 154171483}, + "start": {"type": "Number", "value": 154171417}, + "end": {"type": "Number", "value": 154171418}, }, }, }, diff --git a/server/tests/integration/test_constructors.py b/server/tests/integration/test_constructors.py index 6b19697f..3ab17ac0 100644 --- a/server/tests/integration/test_constructors.py +++ b/server/tests/integration/test_constructors.py @@ -187,25 +187,6 @@ async def test_build_tx_segment_ect( ) -@pytest.mark.asyncio -async def test_build_segment_gct( - check_response, check_tx_element_response, tpm3_tx_t_element -): - """Test correct functioning of transcript segment element construction using - genomic coordinates and transcript. - """ - await check_response( - "/api/construct/structural_element/tx_segment_gct?transcript=NM_152263.4&chromosome=NC_000001.11&start=154171416&end=154171417&strand=-", # noqa: E501 - {"element": tpm3_tx_t_element}, - check_tx_element_response, - ) - await check_response( - "/api/construct/structural_element/tx_segment_gct?transcript=refseq%3ANM_152263.4&chromosome=NC_000001.11&start=154171416&end=154171417&strand=-", # noqa: E501 - {"element": tpm3_tx_t_element}, - check_tx_element_response, - ) - - @pytest.mark.asyncio async def test_build_segment_gcg( check_response, check_tx_element_response, tpm3_tx_g_element @@ -214,7 +195,7 @@ async def test_build_segment_gcg( genomic coordinates and gene name. """ await check_response( - "/api/construct/structural_element/tx_segment_gcg?gene=TPM3&chromosome=NC_000001.11&start=154171416&end=154171417&strand=-", # noqa: E501 + "/api/construct/structural_element/tx_segment_gcg?gene=TPM3&chromosome=NC_000001.11&transcript=NM_152263.4&start=154171416&end=154171417&strand=-", # noqa: E501 {"element": tpm3_tx_g_element}, check_tx_element_response, ) diff --git a/server/tests/integration/test_lookup.py b/server/tests/integration/test_lookup.py index 35c959ab..5006bb5e 100644 --- a/server/tests/integration/test_lookup.py +++ b/server/tests/integration/test_lookup.py @@ -45,6 +45,8 @@ async def test_normalize_gene(async_client: AsyncClient): response = await async_client.get("/api/lookup/gene?term=sdfliuwer") assert response.status_code == 200 assert response.json() == { + "cased": "", + "symbol": "", "term": "sdfliuwer", "warnings": ["Lookup of gene term sdfliuwer failed."], } diff --git a/server/tests/integration/test_nomenclature.py b/server/tests/integration/test_nomenclature.py index 782d538d..5c3a9a8e 100644 --- a/server/tests/integration/test_nomenclature.py +++ b/server/tests/integration/test_nomenclature.py @@ -177,9 +177,7 @@ async def test_tx_segment_nomenclature( "/api/nomenclature/transcript_segment?first=true&last=false", json=epcam_invalid ) assert response.status_code == 200 - assert response.json().get("warnings", []) == [ - "1 validation error for TranscriptSegmentElement\ntranscript\n field required (type=value_error.missing)" # noqa: E501 - ] + assert "field required" in response.json().get("warnings", [])[0].lower() @pytest.mark.asyncio @@ -196,9 +194,7 @@ async def test_gene_element_nomenclature( json={"type": "GeneElement", "associated_gene": {"id": "hgnc:427"}}, ) assert response.status_code == 200 - assert response.json().get("warnings", []) == [ - "2 validation errors for GeneElement\ngene_descriptor\n field required (type=value_error.missing)\nassociated_gene\n extra fields not permitted (type=value_error.extra)" # noqa: E501 - ] + assert "field required" in response.json().get("warnings", [])[0].lower() @pytest.mark.asyncio @@ -234,9 +230,7 @@ async def test_templated_sequence_nomenclature( }, ) assert response.status_code == 200 - assert response.json().get("warnings", []) == [ - "1 validation error for TemplatedSequenceElement\nstrand\n field required (type=value_error.missing)" # noqa: E501 - ] + assert "field required" in response.json().get("warnings", [])[0].lower() @pytest.mark.asyncio