From 9330838f95a3486e067e2b2df1e8d9318efa4367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20T=C3=A1rraga=20Gim=C3=A9nez?= Date: Tue, 27 Sep 2022 11:58:39 +0200 Subject: [PATCH] models: deprecate the actionable member in ClinicalVariantEvidence and remove its usage, #TASK-2103 --- .../ClinicalVariantEvidence.java | 21 +++++++ .../clinical/ClinicalVariantCreator.java | 56 +++---------------- .../DefaultClinicalVariantCreator.java | 6 +- .../clinical/TeamClinicalVariantCreator.java | 21 +------ .../TieringClinicalVariantCreator.java | 6 +- 5 files changed, 35 insertions(+), 75 deletions(-) diff --git a/biodata-models/src/main/java/org/opencb/biodata/models/clinical/interpretation/ClinicalVariantEvidence.java b/biodata-models/src/main/java/org/opencb/biodata/models/clinical/interpretation/ClinicalVariantEvidence.java index 45ba829d..1d3390e4 100644 --- a/biodata-models/src/main/java/org/opencb/biodata/models/clinical/interpretation/ClinicalVariantEvidence.java +++ b/biodata-models/src/main/java/org/opencb/biodata/models/clinical/interpretation/ClinicalVariantEvidence.java @@ -40,6 +40,7 @@ public class ClinicalVariantEvidence { private boolean fullyExplainPhenotypes; private List compoundHeterozygousVariantIds; private RoleInCancer roleInCancer; + @Deprecated private boolean actionable; private ClinicalEvidenceReview review; @@ -52,6 +53,7 @@ public ClinicalVariantEvidence() { review = new ClinicalEvidenceReview(); } + @Deprecated public ClinicalVariantEvidence(String interpretationMethodName, List phenotypes, GenomicFeature genomicFeature, List modeOfInheritances, String panelId, VariantClassification classification, Penetrance penetrance, double score, boolean fullyExplainPhenotypes, @@ -72,6 +74,25 @@ public ClinicalVariantEvidence(String interpretationMethodName, List this.review = review; } + public ClinicalVariantEvidence(String interpretationMethodName, List phenotypes, GenomicFeature genomicFeature, + List modeOfInheritances, String panelId, VariantClassification classification, + Penetrance penetrance, double score, boolean fullyExplainPhenotypes, + List compoundHeterozygousVariantIds, RoleInCancer roleInCancer, + ClinicalEvidenceReview review) { + this.interpretationMethodName = interpretationMethodName; + this.phenotypes = phenotypes; + this.genomicFeature = genomicFeature; + this.modeOfInheritances = modeOfInheritances; + this.panelId = panelId; + this.classification = classification; + this.penetrance = penetrance; + this.score = score; + this.fullyExplainPhenotypes = fullyExplainPhenotypes; + this.compoundHeterozygousVariantIds = compoundHeterozygousVariantIds; + this.roleInCancer = roleInCancer; + this.review = review; + } + @Override public String toString() { final StringBuilder sb = new StringBuilder("ClinicalVariantEvidence{"); diff --git a/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/ClinicalVariantCreator.java b/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/ClinicalVariantCreator.java index e9e3ad78..17f43834 100644 --- a/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/ClinicalVariantCreator.java +++ b/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/ClinicalVariantCreator.java @@ -58,29 +58,24 @@ public abstract class ClinicalVariantCreator { protected Penetrance penetrance; protected Map roleInCancer; - protected Map> actionableVariants; protected String assembly; - public ClinicalVariantCreator(List diseasePanels, Disorder disorder, - List modeOfInheritances, Penetrance penetrance, - Map roleInCancer, Map> actionableVariants, - String assembly) { - this(diseasePanels, disorder, modeOfInheritances, penetrance, roleInCancer, actionableVariants, assembly, - new ArrayList<>(proteinCoding), new ArrayList<>(extendedLof)); + public ClinicalVariantCreator(List diseasePanels, Disorder disorder, List modeOfInheritances, + Penetrance penetrance, Map roleInCancer, String assembly) { + this(diseasePanels, disorder, modeOfInheritances, penetrance, roleInCancer, assembly, new ArrayList<>(proteinCoding), + new ArrayList<>(extendedLof)); } - public ClinicalVariantCreator(List diseasePanels, Disorder disorder, - List modeOfInheritances, Penetrance penetrance, - Map roleInCancer, Map> actionableVariants, - String assembly, List biotypes, List soNames) { + public ClinicalVariantCreator(List diseasePanels, Disorder disorder, List modeOfInheritances, + Penetrance penetrance, Map roleInCancer, String assembly, List biotypes, + List soNames) { this.diseasePanels = diseasePanels; this.disorder = disorder; this.modeOfInheritances = modeOfInheritances; this.penetrance = penetrance; this.roleInCancer = roleInCancer; - this.actionableVariants = actionableVariants; this.assembly = assembly; this.biotypeSet = new HashSet<>(); @@ -113,20 +108,6 @@ public List createSecondaryFindings(List variants) { for (Variant variant : variants) { List clinicalVariantEvidences = new ArrayList<>(); - // Tier 3, actionable variants - if (MapUtils.isNotEmpty(actionableVariants)) { - if (variant.getAnnotation() != null && actionableVariants.containsKey(variant.toString())) { - if (CollectionUtils.isNotEmpty(variant.getAnnotation().getConsequenceTypes())) { - for (ConsequenceType ct : variant.getAnnotation().getConsequenceTypes()) { - clinicalVariantEvidences.addAll(createClinicalVariantEvidences("", null, ct, variant)); - } - } else { - // We create the evidences anyway! - clinicalVariantEvidences.addAll(createClinicalVariantEvidences("", null, null, variant)); - } - } - } - // If we have clinical variant evidences, then we have to create the clinical variant if (CollectionUtils.isNotEmpty(clinicalVariantEvidences)) { ClinicalVariant clinicalVariant = new ClinicalVariant(variant.getImpl(), Collections.emptyList(), Collections.emptyList(), @@ -267,27 +248,6 @@ protected ClinicalVariantEvidence createClinicalVariantEvidence(GenomicFeature g } } - // Actionable management - if (MapUtils.isNotEmpty(actionableVariants) && actionableVariants.containsKey(variant.getId())) { - clinicalVariantEvidence.setActionable(true); - // Set tier 3 only if it is null or untiered - if (tier == null || UNTIERED.equals(tier)) { - clinicalVariantEvidence.getClassification().setTier(TIER_3); - } else { - clinicalVariantEvidence.getClassification().setTier(tier); - } - // Add 'actionable' phenotypes - if (CollectionUtils.isNotEmpty(actionableVariants.get(variant.getId()))) { - List evidences = new ArrayList<>(); - for (String phenotypeId : actionableVariants.get(variant.getId())) { - evidences.add(new Phenotype(phenotypeId, phenotypeId, "")); - } - if (CollectionUtils.isNotEmpty(evidences)) { - clinicalVariantEvidence.setPhenotypes(evidences); - } - } - } - return clinicalVariantEvidence; } @@ -347,7 +307,7 @@ protected List createClinicalVariantEvidences(String ti } } } else { - // We report events without panels, e.g., actionable variants (tier 3) + // We report events without panels if (CollectionUtils.isNotEmpty(soTerms)) { ClinicalVariantEvidence clinicalVariantEvidence = createClinicalVariantEvidence(genomicFeature, null, modeOfInheritances, penetrance, tier, variant); diff --git a/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/DefaultClinicalVariantCreator.java b/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/DefaultClinicalVariantCreator.java index d05506c6..de4446d7 100644 --- a/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/DefaultClinicalVariantCreator.java +++ b/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/DefaultClinicalVariantCreator.java @@ -41,13 +41,11 @@ public class DefaultClinicalVariantCreator extends ClinicalVariantCreator { private boolean includeUntieredVariants; - public DefaultClinicalVariantCreator(Map roleInCancer, - Map> actionableVariants, Disorder disorder, + public DefaultClinicalVariantCreator(Map roleInCancer, Disorder disorder, List modeOfInheritances, Penetrance penetrance, List diseasePanels, List biotypes, List soNames, boolean includeUntieredVariants) { - super(diseasePanels, disorder, modeOfInheritances, penetrance, roleInCancer, actionableVariants, null, - biotypes, soNames); + super(diseasePanels, disorder, modeOfInheritances, penetrance, roleInCancer, null, biotypes, soNames); this.includeUntieredVariants = includeUntieredVariants; } diff --git a/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/TeamClinicalVariantCreator.java b/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/TeamClinicalVariantCreator.java index 06deeb38..172aea57 100644 --- a/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/TeamClinicalVariantCreator.java +++ b/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/TeamClinicalVariantCreator.java @@ -41,10 +41,9 @@ public class TeamClinicalVariantCreator extends ClinicalVariantCreator { - public TeamClinicalVariantCreator(List diseasePanels, Map roleInCancer, - Map> actionableVariants, Disorder disorder, + public TeamClinicalVariantCreator(List diseasePanels, Map roleInCancer, Disorder disorder, List modeOfInheritances, Penetrance penetrance) { - super(diseasePanels, disorder, modeOfInheritances, penetrance, roleInCancer, actionableVariants, null); + super(diseasePanels, disorder, modeOfInheritances, penetrance, roleInCancer, null); } @Override @@ -106,22 +105,6 @@ public List create(List variants) throws Interpretatio } } - // Tier 3, actionable variants - if (!hasTier && MapUtils.isNotEmpty(actionableVariants)) { - if (variant.getAnnotation() != null && actionableVariants.containsKey(variant.getId())) { - if (CollectionUtils.isNotEmpty(variant.getAnnotation().getConsequenceTypes())) { - for (ConsequenceType ct : variant.getAnnotation().getConsequenceTypes()) { - if (ct.getBiotype() != null && proteinCoding.contains(ct.getBiotype())) { - clinicalVariantEvidences.addAll(createClinicalVariantEvidences(UNTIERED, null, ct, variant)); - } - } - } else { - // We create the clinical variant evidences anyway! - clinicalVariantEvidences.addAll(createClinicalVariantEvidences(UNTIERED, null, null, variant)); - } - } - } - // If we have clinical variant evidences, then we have to create the clinical variant if (CollectionUtils.isNotEmpty(clinicalVariantEvidences)) { ClinicalVariant clinicalVariant = new ClinicalVariant(variant.getImpl(), Collections.emptyList(), Collections.emptyList(), diff --git a/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/TieringClinicalVariantCreator.java b/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/TieringClinicalVariantCreator.java index bf278f6d..b5d08e96 100644 --- a/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/TieringClinicalVariantCreator.java +++ b/biodata-tools/src/main/java/org/opencb/biodata/tools/clinical/TieringClinicalVariantCreator.java @@ -55,11 +55,9 @@ public class TieringClinicalVariantCreator extends ClinicalVariantCreator { "SO:0001821", "inframe_insertion", "SO:0001822", "inframe_deletion", "SO:0001583", "missense_variant", "SO:0001630", "splice_region_variant", "SO:0001626", "incomplete_terminal_codon_variant")); - public TieringClinicalVariantCreator(List diseasePanels, Map roleInCancer, - Map> actionableVariants, Disorder disorder, + public TieringClinicalVariantCreator(List diseasePanels, Map roleInCancer, Disorder disorder, ModeOfInheritance modeOfInheritance, Penetrance penetrance, String assembly) { - super(diseasePanels, disorder, Collections.singletonList(modeOfInheritance), penetrance, roleInCancer, - actionableVariants, assembly); + super(diseasePanels, disorder, Collections.singletonList(modeOfInheritance), penetrance, roleInCancer, assembly); } @Override