Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK-5610 Create the CVDB endpoint analysis/clinical/cvdb/variant/summary and overwrite analysis/clinical/variant #267

Open
wants to merge 11 commits into
base: release-3.x.x
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import org.opencb.biodata.models.clinical.ClinicalComment;
import org.opencb.biodata.models.clinical.ClinicalDiscussion;
import org.opencb.biodata.models.clinical.interpretation.stats.ClinicalVariantSummaryStats;
import org.opencb.biodata.models.variant.Variant;
import org.opencb.biodata.models.variant.avro.VariantAvro;

Expand All @@ -40,6 +41,8 @@ public class ClinicalVariant extends Variant {
private ClinicalVariantConfidence confidence;
private List<String> tags;

private ClinicalVariantSummaryStats stats;

private Status status;

// TODO maybe this parameter should be in Variant
Expand Down Expand Up @@ -95,6 +98,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 +117,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, ClinicalVariantSummaryStats stats,
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.stats = stats;
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 +205,15 @@ public ClinicalVariant setConfidence(ClinicalVariantConfidence confidence) {
return this;
}

public ClinicalVariantSummaryStats getStats() {
return stats;
}

public ClinicalVariant setStats(ClinicalVariantSummaryStats stats) {
this.stats = stats;
return this;
}

public Status getStatus() {
return status;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/*
* <!--
* ~ 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.stats;

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

public class ClinicalVariantSummaryStats {

private int numCases;
private Map<String, Integer> variantStatusCounts;
private Map<String, Integer> variantConfidenceCounts;
private int numPrimaryInterpretations;
private int numSecondaryInterpretations;
private InterpretationSummaryStats interpretationSummaryStats;
private Map<String, Integer> clinicalAnalysisDisorderCounts;

public ClinicalVariantSummaryStats() {
this.numCases = 0;
this.variantStatusCounts = new HashMap<>();
this.variantConfidenceCounts = new HashMap<>();
this.numPrimaryInterpretations = 0;
this.numSecondaryInterpretations = 0;
this.interpretationSummaryStats = new InterpretationSummaryStats();
this.clinicalAnalysisDisorderCounts = new HashMap<>();
}

public ClinicalVariantSummaryStats(int numCases, Map<String, Integer> variantStatusCounts, Map<String, Integer> variantConfidenceCounts,
int numPrimaryInterpretations, int numSecondaryInterpretations,
InterpretationSummaryStats interpretationSummaryStats,
Map<String, Integer> clinicalAnalysisDisorderCounts) {
this.numCases = numCases;
this.variantStatusCounts = variantStatusCounts;
this.variantConfidenceCounts = variantConfidenceCounts;
this.numPrimaryInterpretations = numPrimaryInterpretations;
this.numSecondaryInterpretations = numSecondaryInterpretations;
this.interpretationSummaryStats = interpretationSummaryStats;
this.clinicalAnalysisDisorderCounts = clinicalAnalysisDisorderCounts;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("ClinicalVariantSummaryStats{");
sb.append("numCases=").append(numCases);
sb.append(", variantStatusCounts=").append(variantStatusCounts);
sb.append(", variantConfidenceCounts=").append(variantConfidenceCounts);
sb.append(", numPrimaryInterpretations=").append(numPrimaryInterpretations);
sb.append(", numSecondaryInterpretations=").append(numSecondaryInterpretations);
sb.append(", interpretationSummaryStats=").append(interpretationSummaryStats);
sb.append(", clinicalAnalysisDisorderCounts=").append(clinicalAnalysisDisorderCounts);
sb.append('}');
return sb.toString();
}

public int getNumCases() {
return numCases;
}

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

public Map<String, Integer> getVariantStatusCounts() {
return variantStatusCounts;
}

public ClinicalVariantSummaryStats setVariantStatusCounts(Map<String, Integer> variantStatusCounts) {
this.variantStatusCounts = variantStatusCounts;
return this;
}

public Map<String, Integer> getVariantConfidenceCounts() {
return variantConfidenceCounts;
}

public ClinicalVariantSummaryStats setVariantConfidenceCounts(Map<String, Integer> variantConfidenceCounts) {
this.variantConfidenceCounts = variantConfidenceCounts;
return this;
}

public int getNumPrimaryInterpretations() {
return numPrimaryInterpretations;
}

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

public int getNumSecondaryInterpretations() {
return numSecondaryInterpretations;
}

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

public InterpretationSummaryStats getInterpretationSummaryStats() {
return interpretationSummaryStats;
}

public ClinicalVariantSummaryStats setInterpretationSummaryStats(InterpretationSummaryStats interpretationSummaryStats) {
this.interpretationSummaryStats = interpretationSummaryStats;
return this;
}

public Map<String, Integer> getClinicalAnalysisDisorderCounts() {
return clinicalAnalysisDisorderCounts;
}

public ClinicalVariantSummaryStats setClinicalAnalysisDisorderCounts(Map<String, Integer> clinicalAnalysisDisorderCounts) {
this.clinicalAnalysisDisorderCounts = clinicalAnalysisDisorderCounts;
return this;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
/*
* <!--
* ~ 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.stats;

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

public class InterpretationSummaryStats {

private Map<String, Integer> evidenceTranscriptCounts;
private Map<String, Integer> evidenceGeneNameCounts;
private Map<String, Integer> evidenceModeOfInheritanceCounts;
private Map<String, Integer> evidencePanelCounts;
private Map<String, Integer> evidenceReviewTierCounts;
private Map<String, Integer> evidenceReviewAcmgCounts;
private Map<String, Integer> evidenceReviewClinicalSignificanceCounts;
private Map<String, Integer> evidenceClassificationAcmgCounts;

public InterpretationSummaryStats() {
this.evidenceTranscriptCounts = new HashMap<>();
this.evidenceGeneNameCounts = new HashMap<>();
this.evidenceModeOfInheritanceCounts = new HashMap<>();
this.evidencePanelCounts = new HashMap<>();
this.evidenceReviewTierCounts = new HashMap<>();
this.evidenceReviewAcmgCounts = new HashMap<>();
this.evidenceReviewClinicalSignificanceCounts = new HashMap<>();
this.evidenceClassificationAcmgCounts = new HashMap<>();
}

public InterpretationSummaryStats(Map<String, Integer> evidenceTranscriptCounts, Map<String, Integer> evidenceGeneNameCounts,
Map<String, Integer> evidenceModeOfInheritanceCounts, Map<String, Integer> evidencePanelCounts,
Map<String, Integer> evidenceReviewTierCounts, Map<String, Integer> evidenceReviewAcmgCounts,
Map<String, Integer> evidenceReviewClinicalSignificanceCounts,
Map<String, Integer> evidenceClassificationAcmgCounts) {
this.evidenceTranscriptCounts = evidenceTranscriptCounts;
this.evidenceGeneNameCounts = evidenceGeneNameCounts;
this.evidenceModeOfInheritanceCounts = evidenceModeOfInheritanceCounts;
this.evidencePanelCounts = evidencePanelCounts;
this.evidenceReviewTierCounts = evidenceReviewTierCounts;
this.evidenceReviewAcmgCounts = evidenceReviewAcmgCounts;
this.evidenceReviewClinicalSignificanceCounts = evidenceReviewClinicalSignificanceCounts;
this.evidenceClassificationAcmgCounts = evidenceClassificationAcmgCounts;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("InterpretationSummaryStats{");
sb.append("evidenceTranscriptCounts=").append(evidenceTranscriptCounts);
sb.append(", evidenceGeneNameCounts=").append(evidenceGeneNameCounts);
sb.append(", evidenceModeOfInheritanceCounts=").append(evidenceModeOfInheritanceCounts);
sb.append(", evidencePanelCounts=").append(evidencePanelCounts);
sb.append(", evidenceReviewTierCounts=").append(evidenceReviewTierCounts);
sb.append(", evidenceReviewAcmgCounts=").append(evidenceReviewAcmgCounts);
sb.append(", evidenceReviewClinicalSignificanceCounts=").append(evidenceReviewClinicalSignificanceCounts);
sb.append(", evidenceClassificationAcmgCounts=").append(evidenceClassificationAcmgCounts);
sb.append('}');
return sb.toString();
}

public Map<String, Integer> getEvidenceTranscriptCounts() {
return evidenceTranscriptCounts;
}

public InterpretationSummaryStats setEvidenceTranscriptCounts(Map<String, Integer> evidenceTranscriptCounts) {
this.evidenceTranscriptCounts = evidenceTranscriptCounts;
return this;
}

public Map<String, Integer> getEvidenceGeneNameCounts() {
return evidenceGeneNameCounts;
}

public InterpretationSummaryStats setEvidenceGeneNameCounts(Map<String, Integer> evidenceGeneNameCounts) {
this.evidenceGeneNameCounts = evidenceGeneNameCounts;
return this;
}

public Map<String, Integer> getEvidenceModeOfInheritanceCounts() {
return evidenceModeOfInheritanceCounts;
}

public InterpretationSummaryStats setEvidenceModeOfInheritanceCounts(Map<String, Integer> evidenceModeOfInheritanceCounts) {
this.evidenceModeOfInheritanceCounts = evidenceModeOfInheritanceCounts;
return this;
}

public Map<String, Integer> getEvidencePanelCounts() {
return evidencePanelCounts;
}

public InterpretationSummaryStats setEvidencePanelCounts(Map<String, Integer> evidencePanelCounts) {
this.evidencePanelCounts = evidencePanelCounts;
return this;
}

public Map<String, Integer> getEvidenceReviewTierCounts() {
return evidenceReviewTierCounts;
}

public InterpretationSummaryStats setEvidenceReviewTierCounts(Map<String, Integer> evidenceReviewTierCounts) {
this.evidenceReviewTierCounts = evidenceReviewTierCounts;
return this;
}

public Map<String, Integer> getEvidenceReviewAcmgCounts() {
return evidenceReviewAcmgCounts;
}

public InterpretationSummaryStats setEvidenceReviewAcmgCounts(Map<String, Integer> evidenceReviewAcmgCounts) {
this.evidenceReviewAcmgCounts = evidenceReviewAcmgCounts;
return this;
}

public Map<String, Integer> getEvidenceReviewClinicalSignificanceCounts() {
return evidenceReviewClinicalSignificanceCounts;
}

public InterpretationSummaryStats setEvidenceReviewClinicalSignificanceCounts(Map<String, Integer> evidenceReviewClinicalSignificanceCounts) {
this.evidenceReviewClinicalSignificanceCounts = evidenceReviewClinicalSignificanceCounts;
return this;
}

public Map<String, Integer> getEvidenceClassificationAcmgCounts() {
return evidenceClassificationAcmgCounts;
}

public InterpretationSummaryStats setEvidenceClassificationAcmgCounts(Map<String, Integer> evidenceClassificationAcmgCounts) {
this.evidenceClassificationAcmgCounts = evidenceClassificationAcmgCounts;
return this;
}
}
Loading