From ad6567b1e009a7d29aee036264491954a6667e87 Mon Sep 17 00:00:00 2001 From: Eleanor Lewis Date: Tue, 12 Nov 2024 15:32:21 -0800 Subject: [PATCH] lint, remove test code --- pori_python/ipr/annotate.py | 43 ++++++---------------- pori_python/ipr/ipr.py | 68 +++++++++-------------------------- pori_python/ipr/main.py | 67 +++++++++------------------------- pori_python/ipr/util.py | 24 ++++--------- tests/test_ipr/test_upload.py | 21 +++-------- 5 files changed, 56 insertions(+), 167 deletions(-) diff --git a/pori_python/ipr/annotate.py b/pori_python/ipr/annotate.py index de588bd..156731a 100644 --- a/pori_python/ipr/annotate.py +++ b/pori_python/ipr/annotate.py @@ -47,9 +47,7 @@ def get_second_pass_variants( } for reference1, variant_type in inferred_variants: - variants = gkb_match.match_category_variant( - graphkb_conn, reference1, variant_type - ) + variants = gkb_match.match_category_variant(graphkb_conn, reference1, variant_type) for variant in variants: all_inferred_matches[variant["@rid"]] = variant @@ -82,8 +80,7 @@ def get_ipr_statements_from_variants( inferred_statements = [ s for s in get_statements_from_variants(graphkb_conn, inferred_matches) - if s["@rid"] - not in existing_statements # do not duplicate if non-inferred match + if s["@rid"] not in existing_statements # do not duplicate if non-inferred match ] for ipr_row in convert_statements_to_alterations( @@ -128,9 +125,7 @@ def annotate_expression_variants( continue try: matches = gkb_match.match_expression_variant(graphkb_conn, gene, variant) - for ipr_row in get_ipr_statements_from_variants( - graphkb_conn, matches, disease_name - ): + for ipr_row in get_ipr_statements_from_variants(graphkb_conn, matches, disease_name): ipr_row["variant"] = row["key"] ipr_row["variantType"] = row.get("variantType", "exp") # "kbVariantId": matched_stmt["kbVariantId"], @@ -183,15 +178,11 @@ def annotate_copy_variants( if variant not in REPORTED_COPY_VARIANTS: # https://www.bcgsc.ca/jira/browse/GERO-77 skipped += 1 - logger.debug( - f"Dropping {gene} copy change '{variant}' - not in REPORTED_COPY_VARIANTS" - ) + logger.debug(f"Dropping {gene} copy change '{variant}' - not in REPORTED_COPY_VARIANTS") continue try: matches = gkb_match.match_copy_variant(graphkb_conn, gene, variant) - for ipr_row in get_ipr_statements_from_variants( - graphkb_conn, matches, disease_name - ): + for ipr_row in get_ipr_statements_from_variants(graphkb_conn, matches, disease_name): ipr_row["variant"] = row["key"] ipr_row["variantType"] = row.get("variantType", "cnv") # "kbVariantId": matched_stmt["kbVariantId"], @@ -210,9 +201,7 @@ def annotate_copy_variants( ) if problem_genes: logger.error(f"gene finding failures for copy variants {sorted(problem_genes)}") - logger.error( - f"gene finding failure for {len(problem_genes)} copy variant genes" - ) + logger.error(f"gene finding failure for {len(problem_genes)} copy variant genes") logger.info( f"matched {len(variants)} copy category variants to {len(alterations)} graphkb annotations" ) @@ -270,9 +259,7 @@ def annotate_positional_variants( f"Assuming malformed deletion variant {variant} is {variant[:-2] + 'del'}" ) variant = variant[:-2] + "del" - matches = gkb_match.match_positional_variant( - graphkb_conn, variant - ) + matches = gkb_match.match_positional_variant(graphkb_conn, variant) else: raise parse_err for ipr_row in get_ipr_statements_from_variants( @@ -307,9 +294,7 @@ def annotate_positional_variants( if problem_genes: logger.error(f"gene finding failures for {sorted(problem_genes)}") - logger.error( - f"{len(problem_genes)} gene finding failures for positional variants" - ) + logger.error(f"{len(problem_genes)} gene finding failures for positional variants") if errors: logger.error(f"skipped {errors} positional variants due to errors") @@ -357,9 +342,7 @@ def annotate_msi( ) if msi_categories: msi_variants = [cast(Variant, var) for var in msi_categories] - for ipr_row in get_ipr_statements_from_variants( - graphkb_conn, msi_variants, disease_name - ): + for ipr_row in get_ipr_statements_from_variants(graphkb_conn, msi_variants, disease_name): ipr_row["variant"] = msi_category ipr_row["variantType"] = "msi" # "kbVariantId": matched_stmt["kbVariantId"], @@ -393,9 +376,7 @@ def annotate_tmb( "filters": { "reference1": { "target": "Signature", - "filters": { - "OR": [{"name": category}, {"displayName": category}] - }, + "filters": {"OR": [{"name": category}, {"displayName": category}]}, } }, }, @@ -405,9 +386,7 @@ def annotate_tmb( ) if categories: cat_variants = [cast(Variant, var) for var in categories] - for ipr_row in get_ipr_statements_from_variants( - graphkb_conn, cat_variants, disease_name - ): + for ipr_row in get_ipr_statements_from_variants(graphkb_conn, cat_variants, disease_name): ipr_row["variant"] = category ipr_row["variantType"] = "tmb" # "kbVariantId": matched_stmt["kbVariantId"], diff --git a/pori_python/ipr/ipr.py b/pori_python/ipr/ipr.py index 50e3093..fc8697b 100644 --- a/pori_python/ipr/ipr.py +++ b/pori_python/ipr/ipr.py @@ -45,13 +45,9 @@ def filter_structural_variants( Filter structural variants to remove non-high quality events unless they are matched/annotated or they involve a gene that is a known fusion partner """ - matched_svs = { - match["variant"] for match in kb_matches if match["variantType"] == "sv" - } + matched_svs = {match["variant"] for match in kb_matches if match["variantType"] == "sv"} fusion_genes = { - gene["name"] - for gene in gene_annotations - if gene.get("knownFusionPartner", False) + gene["name"] for gene in gene_annotations if gene.get("knownFusionPartner", False) } result = [] @@ -89,9 +85,7 @@ def get_evidencelevel_mapping(graphkb_conn: GraphKBConnection) -> Dict[str, str] # Filter IPR EvidenceLevel and map each outgoing CrossReferenceOf to displayName ipr_source_rid = graphkb_conn.get_source("ipr")["@rid"] - ipr_evidence_levels = filter( - lambda d: d.get("source") == ipr_source_rid, evidence_levels - ) + ipr_evidence_levels = filter(lambda d: d.get("source") == ipr_source_rid, evidence_levels) cross_references_mapping: Dict[str, str] = dict() ipr_rids_to_displayname: Dict[str, str] = dict() for level in ipr_evidence_levels: @@ -139,9 +133,7 @@ def convert_statements_to_alterations( """ disease_matches = { r["@rid"] - for r in gkb_vocab.get_term_tree( - graphkb_conn, disease_name, ontology_class="Disease" - ) + for r in gkb_vocab.get_term_tree(graphkb_conn, disease_name, ontology_class="Disease") } if not disease_matches: @@ -154,9 +146,7 @@ def convert_statements_to_alterations( # get the recruitment status for any trial associated with a statement clinical_trials = [ - s["subject"]["@rid"] - for s in statements - if s["subject"]["@class"] == "ClinicalTrial" + s["subject"]["@rid"] for s in statements if s["subject"]["@class"] == "ClinicalTrial" ] recruitment_statuses = {} if clinical_trials: @@ -173,9 +163,7 @@ def convert_statements_to_alterations( for statement in statements: variants = [ - cast(Variant, c) - for c in statement["conditions"] - if c["@class"] in VARIANT_CLASSES + cast(Variant, c) for c in statement["conditions"] if c["@class"] in VARIANT_CLASSES ] diseases = [c for c in statement["conditions"] if c["@class"] == "Disease"] disease_match = len(diseases) == 1 and diseases[0]["@rid"] in disease_matches @@ -196,12 +184,8 @@ def convert_statements_to_alterations( evidence_level_str = display_evidence_levels(statement) evidence_levels = statement.get("evidenceLevel") or [] - ipr_evidence_levels = [ - ev_map[el.get("@rid", "")] for el in evidence_levels if el - ] - ipr_evidence_levels_str = ";".join( - sorted(set([el for el in ipr_evidence_levels])) - ) + ipr_evidence_levels = [ev_map[el.get("@rid", "")] for el in evidence_levels if el] + ipr_evidence_levels_str = ";".join(sorted(set([el for el in ipr_evidence_levels]))) for variant in variants: if variant["@rid"] not in variant_matches: @@ -209,12 +193,8 @@ def convert_statements_to_alterations( stmt = { "approvedTherapy": approved_therapy or False, "category": ipr_section or "unknown", - "context": ( - statement["subject"]["displayName"] if statement["subject"] else "" - ), - "kbContextId": ( - statement["subject"]["@rid"] if statement["subject"] else "" - ), + "context": (statement["subject"]["displayName"] if statement["subject"] else ""), + "kbContextId": (statement["subject"]["@rid"] if statement["subject"] else ""), "disease": ";".join(sorted(d.get("displayName", "") for d in diseases)), "evidenceLevel": evidence_level_str or "", "iprEvidenceLevel": ipr_evidence_levels_str or "", @@ -224,9 +204,7 @@ def convert_statements_to_alterations( "relevance": statement["relevance"]["displayName"], "kbRelevanceId": statement["relevance"]["@rid"], "externalSource": ( - str(statement["source"].get("displayName", "")) - if statement["source"] - else "" + str(statement["source"].get("displayName", "")) if statement["source"] else "" ), "externalStatementId": statement.get("sourceId", "") or "", "reviewStatus": statement.get("reviewStatus", "") or "", @@ -281,9 +259,7 @@ def select_expression_plots( gene = str(variant.get("gene", "")) hist = str(variant.get("histogramImage", "")) if hist: - images_by_gene[gene] = ImageDefinition( - {"key": f"expDensity.{gene}", "path": hist} - ) + images_by_gene[gene] = ImageDefinition({"key": f"expDensity.{gene}", "path": hist}) return [images_by_gene[gene] for gene in selected_genes if gene in images_by_gene] @@ -307,9 +283,7 @@ def create_key_alterations( variant_type = kb_match["variantType"] variant_key = kb_match["variant"] - match_categories = [ - item["category"] for item in kb_match["kbMatchedStatements"] - ] + match_categories = [item["category"] for item in kb_match["kbMatchedStatements"]] if list(set(match_categories)) == ["unknown"]: continue @@ -330,9 +304,7 @@ def create_key_alterations( counts[type_mapping[variant_type]].add(variant_key) if variant_type == "exp": - alterations.append( - f'{variant.get("gene","")} ({variant.get("expressionState")})' - ) + alterations.append(f'{variant.get("gene","")} ({variant.get("expressionState")})') elif variant_type == "cnv": alterations.append(f'{variant.get("gene","")} ({variant.get("cnvState")})') elif any(item in GERMLINE_BASE_TERMS for item in match_categories): @@ -408,9 +380,7 @@ def germline_kb_matches( # Remove any matches to germline events for alt in somatic_alts: var_list = [v for v in all_variants if v["key"] == alt["variant"]] - somatic_var_list = [ - v for v in var_list if not v.get("germline", not assume_somatic) - ] + somatic_var_list = [v for v in var_list if not v.get("germline", not assume_somatic)] if var_list and not somatic_var_list: logger.debug( f"Dropping germline match to somatic statement kbStatementId:{alt['kbStatementId']}: {alt['kbVariant']} {alt['category']}" @@ -418,9 +388,7 @@ def germline_kb_matches( elif somatic_var_list: ret_list.append(alt) # match to somatic variant else: - ret_list.append( - alt - ) # alteration not in any specific keys matches to check. + ret_list.append(alt) # alteration not in any specific keys matches to check. return ret_list @@ -449,9 +417,7 @@ def multi_variant_filtering( """ # All matching statements & variants (GKB RIDs) matching_statement_rids = { - stmt["kbStatementId"] - for match in gkb_matches - for stmt in match["kbMatchedStatements"] + stmt["kbStatementId"] for match in gkb_matches for stmt in match["kbMatchedStatements"] } matching_variant_rids = {match["kbVariantId"] for match in gkb_matches} diff --git a/pori_python/ipr/main.py b/pori_python/ipr/main.py index ce452c2..14f9e2c 100644 --- a/pori_python/ipr/main.py +++ b/pori_python/ipr/main.py @@ -52,9 +52,7 @@ def file_path(path: str) -> str: if not os.path.exists(path): - raise argparse.ArgumentTypeError( - f"{repr(path)} is not a valid filename. does not exist" - ) + raise argparse.ArgumentTypeError(f"{repr(path)} is not a valid filename. does not exist") return path @@ -71,9 +69,7 @@ def command_interface() -> None: default=os.environ.get("USER"), help="username to use connecting to graphkb/ipr", ) - req.add_argument( - "--password", required=True, help="password to use connecting to graphkb/ipr" - ) + req.add_argument("--password", required=True, help="password to use connecting to graphkb/ipr") req.add_argument( "-c", "--content", required=True, type=file_path, help="Report Content as JSON" ) @@ -161,9 +157,7 @@ def clean_unsupported_content(upload_content: Dict, ipr_spec: Dict = {}) -> Dict and "genesCreate" in ipr_spec["components"]["schemas"].keys() and "properties" in ipr_spec["components"]["schemas"]["genesCreate"].keys() ): - genes_spec = ipr_spec["components"]["schemas"]["genesCreate"][ - "properties" - ].keys() + genes_spec = ipr_spec["components"]["schemas"]["genesCreate"]["properties"].keys() # check what ipr report upload expects and adjust contents to match for old_name, new_name in RENAMED_GENE_PROPERTIES.items(): @@ -198,9 +192,7 @@ def clean_unsupported_content(upload_content: Dict, ipr_spec: Dict = {}) -> Dict removed_keys[key] = 1 gene.pop(key) for key, count in removed_keys.items(): - logger.warning( - f"IPR unsupported property '{key}' removed from {count} genes." - ) + logger.warning(f"IPR unsupported property '{key}' removed from {count} genes.") drop_columns = ["variant", "variantType", "histogramImage"] # DEVSU-2034 - use a 'displayName' @@ -216,9 +208,7 @@ def clean_unsupported_content(upload_content: Dict, ipr_spec: Dict = {}) -> Dict for variant in upload_content.get(variant_list_section, []): if not variant.get("displayName"): variant["displayName"] = ( - variant.get("variant") - or variant.get("kbCategory") - or variant.get("key", "") + variant.get("variant") or variant.get("kbCategory") or variant.get("key", "") ) if variant_list_section == "probeResults": # currently probeResults will error if they do NOT have a 'variant' column. @@ -245,9 +235,7 @@ def clean_unsupported_content(upload_content: Dict, ipr_spec: Dict = {}) -> Dict def create_report(**kwargs) -> Dict: - logger.warning( - "Deprecated function 'create_report' called - use ipr_report instead" - ) + logger.warning("Deprecated function 'create_report' called - use ipr_report instead") return ipr_report(**kwargs) @@ -309,22 +297,16 @@ def ipr_report( try: validate_report_content(content) except jsonschema.exceptions.ValidationError as err: - logger.error( - "Failed schema check - report variants may be corrupted or unmatched." - ) + logger.error("Failed schema check - report variants may be corrupted or unmatched.") logger.error(f"Failed schema check: {err}") kb_disease_match = content["kbDiseaseMatch"] # validate the input variants small_mutations = preprocess_small_mutations(content.get("smallMutations", [])) - structural_variants = preprocess_structural_variants( - content.get("structuralVariants", []) - ) + structural_variants = preprocess_structural_variants(content.get("structuralVariants", [])) copy_variants = preprocess_copy_variants(content.get("copyVariants", [])) - expression_variants = preprocess_expression_variants( - content.get("expressionVariants", []) - ) + expression_variants = preprocess_expression_variants(content.get("expressionVariants", [])) if expression_variants: check_comparators(content, expression_variants) @@ -373,9 +355,7 @@ def ipr_report( tmb["kbCategory"] = TMB_HIGH_CATEGORY # GERO-296 - try matching to graphkb - tmb_matches = annotate_tmb( - graphkb_conn, kb_disease_match, TMB_HIGH_CATEGORY - ) + tmb_matches = annotate_tmb(graphkb_conn, kb_disease_match, TMB_HIGH_CATEGORY) if tmb_matches: tmb_variant["kbCategory"] = TMB_HIGH_CATEGORY # type: ignore tmb_variant["variant"] = TMB_HIGH_CATEGORY @@ -384,9 +364,7 @@ def ipr_report( logger.info( f"GERO-296 '{TMB_HIGH_CATEGORY}' matches {len(tmb_matches)} statements." ) - gkb_matches.extend( - [Hashabledict(tmb_statement) for tmb_statement in tmb_matches] - ) + gkb_matches.extend([Hashabledict(tmb_statement) for tmb_statement in tmb_matches]) logger.debug(f"\tgkb_matches: {len(gkb_matches)}") # MATCHING MSI @@ -409,9 +387,7 @@ def ipr_report( msi_variant["variant"] = msi_cat msi_variant["key"] = msi_cat msi_variant["variantType"] = "msi" - logger.info( - f"GERO-295 '{msi_cat}' matches {len(msi_matches)} msi statements." - ) + logger.info(f"GERO-295 '{msi_cat}' matches {len(msi_matches)} msi statements.") gkb_matches.extend([Hashabledict(msi) for msi in msi_matches]) logger.debug(f"\tgkb_matches: {len(gkb_matches)}") @@ -476,20 +452,15 @@ def ipr_report( # verify germline kb statements matched germline observed variants, not somatic variants org_len = len(gkb_matches) gkb_matches = [ - Hashabledict(match) - for match in germline_kb_matches(gkb_matches, all_variants) + Hashabledict(match) for match in germline_kb_matches(gkb_matches, all_variants) ] num_removed = org_len - len(gkb_matches) if num_removed: - logger.info( - f"Removing {num_removed} germline events without medical matches." - ) + logger.info(f"Removing {num_removed} germline events without medical matches.") if custom_kb_match_filter: logger.info(f"custom_kb_match_filter on {len(gkb_matches)} variants") - gkb_matches = [ - Hashabledict(match) for match in custom_kb_match_filter(gkb_matches) - ] + gkb_matches = [Hashabledict(match) for match in custom_kb_match_filter(gkb_matches)] logger.info(f"\t custom_kb_match_filter left {len(gkb_matches)} variants") if multi_variant_filter: @@ -534,9 +505,7 @@ def ipr_report( { "kbMatches": [trim_empty_values(a) for a in gkb_matches], # type: ignore "copyVariants": [ - trim_empty_values(c) - for c in copy_variants - if c["gene"] in genes_with_variants + trim_empty_values(c) for c in copy_variants if c["gene"] in genes_with_variants ], "smallMutations": [trim_empty_values(s) for s in small_mutations], "expressionVariants": [ @@ -560,9 +529,7 @@ def ipr_report( "therapeuticTarget": targets, } ) - output.setdefault("images", []).extend( - select_expression_plots(gkb_matches, all_variants) - ) + output.setdefault("images", []).extend(select_expression_plots(gkb_matches, all_variants)) output = clean_unsupported_content(output, ipr_spec) ipr_result = None diff --git a/pori_python/ipr/util.py b/pori_python/ipr/util.py index 41257a3..32369ff 100644 --- a/pori_python/ipr/util.py +++ b/pori_python/ipr/util.py @@ -25,9 +25,7 @@ def get_terms_set(graphkb_conn: GraphKBConnection, base_terms: List[str]) -> Set terms = set() for base_term in base_terms: terms.update( - convert_to_rid_set( - get_term_tree(graphkb_conn, base_term, include_superclasses=False) - ) + convert_to_rid_set(get_term_tree(graphkb_conn, base_term, include_superclasses=False)) ) return terms @@ -64,9 +62,7 @@ def create_variant_name_tuple(variant: IprVariant) -> Tuple[str, str]: elif variant_type == "cnv": return (gene, str(variant.get("cnvState", ""))) variant_split = ( - variant["variant"].split(":", 1)[1] - if ":" in variant["variant"] - else variant["variant"] + variant["variant"].split(":", 1)[1] if ":" in variant["variant"] else variant["variant"] ) gene2 = str(variant.get("gene2", "")) @@ -91,9 +87,7 @@ def find_variant( raise KeyError(f"expected variant ({variant_key}, {variant_type}) does not exist") -def generate_ontology_preference_key( - record: Ontology, sources_sort: Dict[str, int] = {} -) -> Tuple: +def generate_ontology_preference_key(record: Ontology, sources_sort: Dict[str, int] = {}) -> Tuple: """Generate a tuple key for comparing preferred ontology terms.""" return ( record.get("name") == record.get("sourceId"), @@ -123,9 +117,7 @@ def get_preferred_drug_representation( source_preference = { r["@rid"]: r["sort"] # type: ignore - for r in graphkb_conn.query( - {"target": "Source", "returnProperties": ["sort", "@rid"]} - ) + for r in graphkb_conn.query({"target": "Source", "returnProperties": ["sort", "@rid"]}) } drugs = sorted( get_alternatives(graphkb_conn, drug_record_id), @@ -141,12 +133,8 @@ def get_preferred_gene_name( record = graphkb_conn.get_record_by_id(record_id) biotype = record.get("biotype", "") genes = [] - expanded_gene_names = graphkb_conn.query( - {"target": [record_id], "neighbors": neighbors} - ) - assert ( - len(expanded_gene_names) == 1 - ), "get_preferred_gene_name should have single result" + expanded_gene_names = graphkb_conn.query({"target": [record_id], "neighbors": neighbors}) + assert len(expanded_gene_names) == 1, "get_preferred_gene_name should have single result" expanded: Dict[str, List] = expanded_gene_names[0] # type: ignore if biotype != "gene": for edge in expanded.get("out_ElementOf", []): diff --git a/tests/test_ipr/test_upload.py b/tests/test_ipr/test_upload.py index 581519f..eaa4dca 100644 --- a/tests/test_ipr/test_upload.py +++ b/tests/test_ipr/test_upload.py @@ -66,9 +66,7 @@ def loaded_reports(tmp_path_factory) -> Generator: }, ], "expressionVariants": json.loads( - pd.read_csv(get_test_file("expression.short.tab"), sep="\t").to_json( - orient="records" - ) + pd.read_csv(get_test_file("expression.short.tab"), sep="\t").to_json(orient="records") ), "smallMutations": json.loads( pd.read_csv(get_test_file("small_mutations.short.tab"), sep="\t").to_json( @@ -81,9 +79,7 @@ def loaded_reports(tmp_path_factory) -> Generator: ) ), "structuralVariants": json.loads( - pd.read_csv(get_test_file("fusions.tab"), sep="\t").to_json( - orient="records" - ) + pd.read_csv(get_test_file("fusions.tab"), sep="\t").to_json(orient="records") ), "kbDiseaseMatch": "colorectal cancer", } @@ -144,7 +140,6 @@ def loaded_reports(tmp_path_factory) -> Generator: "async": (async_patient_id, async_loaded_report), } yield loaded_reports_result - return ipr_conn.delete(uri=f"reports/{loaded_report['reports'][0]['ident']}") ipr_conn.delete(uri=f"reports/{async_loaded_report['reports'][0]['ident']}") @@ -185,9 +180,7 @@ def compare_sections(section1, section2): @pytest.mark.skipif( not INCLUDE_UPLOAD_TESTS, reason="excluding tests of upload to live ipr instance" ) -@pytest.mark.skipif( - EXCLUDE_INTEGRATION_TESTS, reason="excluding long running integration tests" -) +@pytest.mark.skipif(EXCLUDE_INTEGRATION_TESTS, reason="excluding long running integration tests") class TestCreateReport: def test_patient_id_loaded_once(self, loaded_reports) -> None: sync_patient_id = loaded_reports["sync"][0] @@ -207,9 +200,7 @@ def test_expression_variants_loaded(self, loaded_reports) -> None: def test_structural_variants_loaded(self, loaded_reports) -> None: section = get_section(loaded_reports["sync"], "structural-variants") kbmatched = [item for item in section if item["kbMatches"]] - assert "(EWSR1,FLI1):fusion(e.7,e.4)" in [ - item["displayName"] for item in kbmatched - ] + assert "(EWSR1,FLI1):fusion(e.7,e.4)" in [item["displayName"] for item in kbmatched] async_section = get_section(loaded_reports["async"], "structural-variants") assert compare_sections(section, async_section) @@ -255,9 +246,7 @@ def test_therapeutic_targets_loaded(self, loaded_reports) -> None: assert compare_sections(section, async_section) def test_genomic_alterations_identified_loaded(self, loaded_reports) -> None: - section = get_section( - loaded_reports["sync"], "summary/genomic-alterations-identified" - ) + section = get_section(loaded_reports["sync"], "summary/genomic-alterations-identified") variants = set([item["geneVariant"] for item in section]) for variant in [ "FGFR2:p.R421C",