From 426ec383af0b0fb76929e410751d4dfcc5ae11cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20T=C3=A1rraga=20Gim=C3=A9nez?= Date: Tue, 1 Sep 2020 10:29:52 +0200 Subject: [PATCH] models: update ClinicalVariantEvidence object, #189 --- .../ClinicalVariantEvidence.java | 23 ++++----------- .../interpretation/GenomicFeature.java | 28 ++++++++++++++++++- 2 files changed, 32 insertions(+), 19 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 458c5e3a8..805d44704 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 @@ -32,7 +32,6 @@ public class ClinicalVariantEvidence { private String interpretationMethodName; private List phenotypes; - private List consequenceTypes; private GenomicFeature genomicFeature; private ModeOfInheritance modeOfInheritance; private String panelId; @@ -47,20 +46,18 @@ public class ClinicalVariantEvidence { public ClinicalVariantEvidence() { phenotypes = Collections.emptyList(); - consequenceTypes = Collections.emptyList(); compoundHeterozygousVariantIds = Collections.emptyList(); fullyExplainPhenotypes = false; actionable = false; } - public ClinicalVariantEvidence(String interpretationMethodName, List phenotypes, List consequenceTypes, - GenomicFeature genomicFeature, ModeOfInheritance modeOfInheritance, String panelId, - VariantClassification classification, Penetrance penetrance, double score, - boolean fullyExplainPhenotypes, List compoundHeterozygousVariantIds, RoleInCancer roleInCancer, - boolean actionable, String justification) { + public ClinicalVariantEvidence(String interpretationMethodName, List phenotypes, GenomicFeature genomicFeature, + ModeOfInheritance modeOfInheritance, String panelId, VariantClassification classification, + Penetrance penetrance, double score, boolean fullyExplainPhenotypes, + List compoundHeterozygousVariantIds, RoleInCancer roleInCancer, boolean actionable, + String justification) { this.interpretationMethodName = interpretationMethodName; this.phenotypes = phenotypes; - this.consequenceTypes = consequenceTypes; this.genomicFeature = genomicFeature; this.modeOfInheritance = modeOfInheritance; this.panelId = panelId; @@ -79,7 +76,6 @@ public String toString() { final StringBuilder sb = new StringBuilder("ClinicalVariantEvidence{"); sb.append("interpretationMethodName='").append(interpretationMethodName).append('\''); sb.append(", phenotypes=").append(phenotypes); - sb.append(", consequenceTypes=").append(consequenceTypes); sb.append(", genomicFeature=").append(genomicFeature); sb.append(", modeOfInheritance=").append(modeOfInheritance); sb.append(", panelId='").append(panelId).append('\''); @@ -113,15 +109,6 @@ public ClinicalVariantEvidence setPhenotypes(List phenotypes) { return this; } - public List getConsequenceTypes() { - return consequenceTypes; - } - - public ClinicalVariantEvidence setConsequenceTypes(List consequenceTypes) { - this.consequenceTypes = consequenceTypes; - return this; - } - public GenomicFeature getGenomicFeature() { return genomicFeature; } diff --git a/biodata-models/src/main/java/org/opencb/biodata/models/clinical/interpretation/GenomicFeature.java b/biodata-models/src/main/java/org/opencb/biodata/models/clinical/interpretation/GenomicFeature.java index 9a855cf48..daaf99cb9 100644 --- a/biodata-models/src/main/java/org/opencb/biodata/models/clinical/interpretation/GenomicFeature.java +++ b/biodata-models/src/main/java/org/opencb/biodata/models/clinical/interpretation/GenomicFeature.java @@ -20,6 +20,7 @@ package org.opencb.biodata.models.clinical.interpretation; import org.opencb.biodata.models.core.Xref; +import org.opencb.biodata.models.variant.avro.SequenceOntologyTerm; import java.util.List; @@ -28,19 +29,35 @@ public class GenomicFeature { private String type; // GENE, VARIANT, REGION,... private String transcriptId; private String geneName; + private List consequenceTypes; private List xrefs; public GenomicFeature() { } - public GenomicFeature(String id, String type, String transcriptId, String geneName, List xrefs) { + public GenomicFeature(String id, String type, String transcriptId, String geneName, List consequenceTypes, + List xrefs) { this.id = id; this.type = type; this.transcriptId = transcriptId; this.geneName = geneName; + this.consequenceTypes = consequenceTypes; this.xrefs = xrefs; } + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("GenomicFeature{"); + sb.append("id='").append(id).append('\''); + sb.append(", type='").append(type).append('\''); + sb.append(", transcriptId='").append(transcriptId).append('\''); + sb.append(", geneName='").append(geneName).append('\''); + sb.append(", consequenceTypes=").append(consequenceTypes); + sb.append(", xrefs=").append(xrefs); + sb.append('}'); + return sb.toString(); + } + public String getId() { return id; } @@ -77,6 +94,15 @@ public GenomicFeature setGeneName(String geneName) { return this; } + public List getConsequenceTypes() { + return consequenceTypes; + } + + public GenomicFeature setConsequenceTypes(List consequenceTypes) { + this.consequenceTypes = consequenceTypes; + return this; + } + public List getXrefs() { return xrefs; }