Skip to content

Commit

Permalink
models: add ClinicalVariantSummary, #TASK-5611, #TASK-5610
Browse files Browse the repository at this point in the history
  • Loading branch information
jtarraga committed Feb 22, 2024
1 parent 0ec0cbb commit 7eb2efa
Show file tree
Hide file tree
Showing 2 changed files with 222 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class ClinicalVariant extends Variant {
private ClinicalVariantConfidence confidence;
private List<String> tags;

private ClinicalVariantSummary summary;

private Status status;

// TODO maybe this parameter should be in Variant
Expand Down Expand Up @@ -95,6 +97,7 @@ public ClinicalVariant(VariantAvro avro, List<ClinicalVariantEvidence> evidences
this.attributes = attributes;
}

@Deprecated
public ClinicalVariant(VariantAvro avro, List<ClinicalVariantEvidence> evidences, List<ClinicalComment> comments,
Map<String, Object> filters, String recommendation, List<MiniPubmed> references,
ClinicalDiscussion discussion, ClinicalVariantConfidence confidence, Status status,
Expand All @@ -113,6 +116,26 @@ public ClinicalVariant(VariantAvro avro, List<ClinicalVariantEvidence> evidences
this.attributes = attributes;
}

public ClinicalVariant(VariantAvro avro, List<ClinicalVariantEvidence> evidences, List<ClinicalComment> comments,
Map<String, Object> filters, String recommendation, List<MiniPubmed> references,
ClinicalDiscussion discussion, ClinicalVariantConfidence confidence, ClinicalVariantSummary summary,
Status status, List<String> tags, Map<String, Object> attributes) {
super(avro);

this.evidences = evidences;
this.comments = comments;
this.filters = filters;
this.recommendation = recommendation;
this.references = references;
this.discussion = discussion;
this.summary = summary;
this.status = status;
this.tags = tags;
this.confidence = confidence;
this.attributes = attributes;
}


@Override
public String toString() {
return super.toString();
Expand Down Expand Up @@ -181,6 +204,15 @@ public ClinicalVariant setConfidence(ClinicalVariantConfidence confidence) {
return this;
}

public ClinicalVariantSummary getSummary() {
return summary;
}

public ClinicalVariant setSummary(ClinicalVariantSummary summary) {
this.summary = summary;
return this;
}

public Status getStatus() {
return status;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
/*
* <!--
* ~ Copyright 2015-2017 OpenCB
* ~
* ~ Licensed under the Apache License, Version 2.0 (the "License");
* ~ you may not use this file except in compliance with the License.
* ~ You may obtain a copy of the License at
* ~
* ~ http://www.apache.org/licenses/LICENSE-2.0
* ~
* ~ Unless required by applicable law or agreed to in writing, software
* ~ distributed under the License is distributed on an "AS IS" BASIS,
* ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* ~ See the License for the specific language governing permissions and
* ~ limitations under the License.
* -->
*
*/

package org.opencb.biodata.models.clinical.interpretation;

import org.opencb.biodata.models.clinical.ClinicalProperty;

import java.util.HashMap;
import java.util.Map;

public class ClinicalVariantSummary {

private int numCases;
private int numPrimaryInterpretations;
private int numSecondaryInterpretations;
private Map<String, Integer> evidencePhenotypeCounts;
private Map<String, Integer> evidenceTierCounts;
private Map<String, Integer> evidenceAcmgCounts;
private Map<ClinicalProperty.ClinicalSignificance, Integer> evidenceClinicalSignificanceCounts;
private Map<VariantClassification.DrugResponse, Integer> drugResponseCounts;
private Map<VariantClassification.TraitAssociation, Integer> evidenceTraitAssociationCounts;
private Map<VariantClassification.FunctionalEffect, Integer> evidenceFunctionalEffectCounts;
private Map<VariantClassification.Tumorigenesis, Integer> evidenceTumorigenesisCounts;

public ClinicalVariantSummary() {
this.evidencePhenotypeCounts = new HashMap<>();
this.evidenceTierCounts = new HashMap<>();
this.evidenceAcmgCounts = new HashMap<>();
this.evidenceClinicalSignificanceCounts = new HashMap<>();
this.drugResponseCounts = new HashMap<>();
this.evidenceTraitAssociationCounts = new HashMap<>();
this.evidenceFunctionalEffectCounts = new HashMap<>();
this.evidenceTumorigenesisCounts = new HashMap<>();
}

public ClinicalVariantSummary(int numCases, int numPrimaryInterpretations, int numSecondaryInterpretations,
Map<String, Integer> evidencePhenotypeCounts,
Map<String, Integer> evidenceTierCounts,
Map<String, Integer> evidenceAcmgCounts,
Map<ClinicalProperty.ClinicalSignificance, Integer> evidenceClinicalSignificanceCounts,
Map<VariantClassification.DrugResponse, Integer> drugResponseCounts,
Map<VariantClassification.TraitAssociation, Integer> evidenceTraitAssociationCounts,
Map<VariantClassification.FunctionalEffect, Integer> evidenceFunctionalEffectCounts,
Map<VariantClassification.Tumorigenesis, Integer> evidenceTumorigenesisCounts) {
this.numCases = numCases;
this.numPrimaryInterpretations = numPrimaryInterpretations;
this.numSecondaryInterpretations = numSecondaryInterpretations;
this.evidencePhenotypeCounts = evidencePhenotypeCounts;
this.evidenceTierCounts = evidenceTierCounts;
this.evidenceAcmgCounts = evidenceAcmgCounts;
this.evidenceClinicalSignificanceCounts = evidenceClinicalSignificanceCounts;
this.drugResponseCounts = drugResponseCounts;
this.evidenceTraitAssociationCounts = evidenceTraitAssociationCounts;
this.evidenceFunctionalEffectCounts = evidenceFunctionalEffectCounts;
this.evidenceTumorigenesisCounts = evidenceTumorigenesisCounts;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("ClinicalVariantSummary{");
sb.append("numCases=").append(numCases);
sb.append(", numPrimaryInterpretations=").append(numPrimaryInterpretations);
sb.append(", numSecondaryInterpretations=").append(numSecondaryInterpretations);
sb.append(", evidencePhenotypeCounts=").append(evidencePhenotypeCounts);
sb.append(", evidenceTierCounts=").append(evidenceTierCounts);
sb.append(", evidenceAcmgCounts=").append(evidenceAcmgCounts);
sb.append(", evidenceClinicalSignificanceCounts=").append(evidenceClinicalSignificanceCounts);
sb.append(", drugResponseCounts=").append(drugResponseCounts);
sb.append(", evidenceTraitAssociationCounts=").append(evidenceTraitAssociationCounts);
sb.append(", evidenceFunctionalEffectCounts=").append(evidenceFunctionalEffectCounts);
sb.append(", evidenceTumorigenesisCounts=").append(evidenceTumorigenesisCounts);
sb.append('}');
return sb.toString();
}

public int getNumCases() {
return numCases;
}

public ClinicalVariantSummary setNumCases(int numCases) {
this.numCases = numCases;
return this;
}

public int getNumPrimaryInterpretations() {
return numPrimaryInterpretations;
}

public ClinicalVariantSummary setNumPrimaryInterpretations(int numPrimaryInterpretations) {
this.numPrimaryInterpretations = numPrimaryInterpretations;
return this;
}

public int getNumSecondaryInterpretations() {
return numSecondaryInterpretations;
}

public ClinicalVariantSummary setNumSecondaryInterpretations(int numSecondaryInterpretations) {
this.numSecondaryInterpretations = numSecondaryInterpretations;
return this;
}

public Map<String, Integer> getEvidencePhenotypeCounts() {
return evidencePhenotypeCounts;
}

public ClinicalVariantSummary setEvidencePhenotypeCounts(Map<String, Integer> evidencePhenotypeCounts) {
this.evidencePhenotypeCounts = evidencePhenotypeCounts;
return this;
}

public Map<String, Integer> getEvidenceTierCounts() {
return evidenceTierCounts;
}

public ClinicalVariantSummary setEvidenceTierCounts(Map<String, Integer> evidenceTierCounts) {
this.evidenceTierCounts = evidenceTierCounts;
return this;
}

public Map<String, Integer> getEvidenceAcmgCounts() {
return evidenceAcmgCounts;
}

public ClinicalVariantSummary setEvidenceAcmgCounts(Map<String, Integer> evidenceAcmgCounts) {
this.evidenceAcmgCounts = evidenceAcmgCounts;
return this;
}

public Map<ClinicalProperty.ClinicalSignificance, Integer> getEvidenceClinicalSignificanceCounts() {
return evidenceClinicalSignificanceCounts;
}

public ClinicalVariantSummary setEvidenceClinicalSignificanceCounts(Map<ClinicalProperty.ClinicalSignificance, Integer> evidenceClinicalSignificanceCounts) {
this.evidenceClinicalSignificanceCounts = evidenceClinicalSignificanceCounts;
return this;
}

public Map<VariantClassification.DrugResponse, Integer> getDrugResponseCounts() {
return drugResponseCounts;
}

public ClinicalVariantSummary setDrugResponseCounts(Map<VariantClassification.DrugResponse, Integer> drugResponseCounts) {
this.drugResponseCounts = drugResponseCounts;
return this;
}

public Map<VariantClassification.TraitAssociation, Integer> getEvidenceTraitAssociationCounts() {
return evidenceTraitAssociationCounts;
}

public ClinicalVariantSummary setEvidenceTraitAssociationCounts(Map<VariantClassification.TraitAssociation, Integer> evidenceTraitAssociationCounts) {
this.evidenceTraitAssociationCounts = evidenceTraitAssociationCounts;
return this;
}

public Map<VariantClassification.FunctionalEffect, Integer> getEvidenceFunctionalEffectCounts() {
return evidenceFunctionalEffectCounts;
}

public ClinicalVariantSummary setEvidenceFunctionalEffectCounts(Map<VariantClassification.FunctionalEffect, Integer> evidenceFunctionalEffectCounts) {
this.evidenceFunctionalEffectCounts = evidenceFunctionalEffectCounts;
return this;
}

public Map<VariantClassification.Tumorigenesis, Integer> getEvidenceTumorigenesisCounts() {
return evidenceTumorigenesisCounts;
}

public ClinicalVariantSummary setEvidenceTumorigenesisCounts(Map<VariantClassification.Tumorigenesis, Integer> evidenceTumorigenesisCounts) {
this.evidenceTumorigenesisCounts = evidenceTumorigenesisCounts;
return this;
}
}

0 comments on commit 7eb2efa

Please sign in to comment.