From a389b54f86e5c499534a8c1bf5ea57fec074e9d7 Mon Sep 17 00:00:00 2001 From: SeriousHorncat Date: Wed, 11 Dec 2024 16:07:30 -0600 Subject: [PATCH] Fixed linting and added gnomad to be added as annotations; even though not visualizing yet. Some additional linkout datasets included also. --- backend/tests/unit/core/test_annotation_task.py | 5 +++-- etc/fixtures/initial-seed/annotations-config.json | 10 ++++++++++ frontend/src/models/analyses.js | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/backend/tests/unit/core/test_annotation_task.py b/backend/tests/unit/core/test_annotation_task.py index f19b18f7..bb303029 100644 --- a/backend/tests/unit/core/test_annotation_task.py +++ b/backend/tests/unit/core/test_annotation_task.py @@ -51,7 +51,7 @@ def test_extraction_forge_hgvs_variant_without_transcript_version(hgvs_without_t """Verifies the jq query used to forge create the transcript without a version dataset for a variant""" forge_annotation = hgvs_without_transcript_version_annotation_task.annotate() actual_extractions = hgvs_without_transcript_version_annotation_task.extract(forge_annotation) - assert(actual_extractions, "NM_170707:c.745C>T") + assert actual_extractions == "NM_170707:c.745C>T" def test_annotation_extraction_for_transcript_id_dataset(http_annotation_transcript_id, transcript_annotation_response): @@ -258,13 +258,14 @@ def fixture_transcript_id_dataset(): @pytest.fixture(name="hgvs_without_transcript_version_annotation_task") def fixture_hgvs_without_transcript_version(hgvs_variant_genomic_unit): + """An Annotation Unit to experiment with jq parsing and rebuilding a string in a result.""" annotation_unit = AnnotationUnit(hgvs_variant_genomic_unit, { "data_set": "hgvs_variant_without_transcript_version", "data_source": "Rosalution", "annotation_source_type": "forge", "genomic_unit_type": "hgvs_variant", "base_string": "{hgvs_variant}", - "attribute": ".hgvs_variant_without_transcript_version | split(\":\") as $transcript_split | $transcript_split[0] | split(\".\")[0] | . + \":\" + $transcript_split[1] | {\"hgvs_variant_without_transcript_version\": .}", + "attribute": ".hgvs_variant_without_transcript_version | split(\":\") as $transcript_split | $transcript_split[0] | split(\".\")[0] | . + \":\" + $transcript_split[1] | {\"hgvs_variant_without_transcript_version\": .}", # pylint: disable=line-too-long "versioning_type": "rosalution" }) task = ForgeAnnotationTask(annotation_unit) diff --git a/etc/fixtures/initial-seed/annotations-config.json b/etc/fixtures/initial-seed/annotations-config.json index a95dddd4..802a3e9d 100644 --- a/etc/fixtures/initial-seed/annotations-config.json +++ b/etc/fixtures/initial-seed/annotations-config.json @@ -238,6 +238,16 @@ "dependencies": ["ensembl_vep_vcf_string"], "versioning_type": "rosalution" }, + { + "data_set": "gnomAD4", + "data_source": "OpenCravat", + "genomic_unit_type": "hgvs_variant", + "annotation_source_type": "http", + "base_string": "https://run.opencravat.org/submit/annotate?{opencravat_search_variant_vcf_string}&annotators=gnomad4", + "attribute": "{ \"gnomad4\": .gnomad4 }", + "dependencies": ["opencravat_search_variant_vcf_string"], + "versioning_type": "date" + }, { "data_set": "COSMIC_gene_url", "data_source": "Rosalution", diff --git a/frontend/src/models/analyses.js b/frontend/src/models/analyses.js index 855360a6..0d05c5ee 100644 --- a/frontend/src/models/analyses.js +++ b/frontend/src/models/analyses.js @@ -323,7 +323,7 @@ const annotationRenderingTemporary = [ 'imageFilename': 'cosmic_logo.png', 'altText': 'Catalogue Of Somatic Mutations In Cancer, COSMIC', }, - },{ + }, { 'dataset': 'gnomAD_gene_url', 'type': 'icon-linkout-dataset', 'props': { @@ -451,7 +451,7 @@ const annotationRenderingTemporary = [ 'set': [ {'value': 'likely_benign', 'classification': 'Likely Benign', 'colour': 'Blue'}, {'value': 'ambiguous', 'classification': 'Ambiguous', 'colour': 'Yellow'}, - {'value': 'likely_pathogenic', 'classification': 'Likely Pathogenic', 'colour': 'Red'} + {'value': 'likely_pathogenic', 'classification': 'Likely Pathogenic', 'colour': 'Red'}, ], }, },