Skip to content

Commit

Permalink
models: update models to support clinical variant summary stats, #TAS…
Browse files Browse the repository at this point in the history
…K-5611, #TASK-5610
  • Loading branch information
jtarraga committed Feb 28, 2024
1 parent 7eb2efa commit 32cf1ab
Show file tree
Hide file tree
Showing 4 changed files with 294 additions and 194 deletions.
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,7 +41,7 @@ public class ClinicalVariant extends Variant {
private ClinicalVariantConfidence confidence;
private List<String> tags;

private ClinicalVariantSummary summary;
private ClinicalVariantSummaryStats summary;

private Status status;

Expand Down Expand Up @@ -118,7 +119,7 @@ public ClinicalVariant(VariantAvro avro, List<ClinicalVariantEvidence> evidences

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,
ClinicalDiscussion discussion, ClinicalVariantConfidence confidence, ClinicalVariantSummaryStats summary,
Status status, List<String> tags, Map<String, Object> attributes) {
super(avro);

Expand Down Expand Up @@ -204,11 +205,11 @@ public ClinicalVariant setConfidence(ClinicalVariantConfidence confidence) {
return this;
}

public ClinicalVariantSummary getSummary() {
public ClinicalVariantSummaryStats getSummary() {
return summary;
}

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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/*
* <!--
* ~ 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;

public class ClinicalVariantSummaryStats {

private int numCases;
private int numPrimaryInterpretations;
private int numSecondaryInterpretations;
private InterpretationSummaryStats primaryInterpretationSummary;
private InterpretationSummaryStats secondaryInterpretationsSummary;

public ClinicalVariantSummaryStats() {
primaryInterpretationSummary = new InterpretationSummaryStats();
secondaryInterpretationsSummary = new InterpretationSummaryStats();
}

public ClinicalVariantSummaryStats(int numCases, int numPrimaryInterpretations, int numSecondaryInterpretations,
InterpretationSummaryStats primaryInterpretationSummary, InterpretationSummaryStats secondaryInterpretationsSummary) {
this.numCases = numCases;
this.numPrimaryInterpretations = numPrimaryInterpretations;
this.numSecondaryInterpretations = numSecondaryInterpretations;
this.primaryInterpretationSummary = primaryInterpretationSummary;
this.secondaryInterpretationsSummary = secondaryInterpretationsSummary;
}

@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(", primaryInterpretationSummary=").append(primaryInterpretationSummary);
sb.append(", secondaryInterpretationsSummary=").append(secondaryInterpretationsSummary);
sb.append('}');
return sb.toString();
}

public int getNumCases() {
return numCases;
}

public ClinicalVariantSummaryStats setNumCases(int numCases) {
this.numCases = numCases;
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 getPrimaryInterpretationSummary() {
return primaryInterpretationSummary;
}

public ClinicalVariantSummaryStats setPrimaryInterpretationSummary(InterpretationSummaryStats primaryInterpretationSummary) {
this.primaryInterpretationSummary = primaryInterpretationSummary;
return this;
}

public InterpretationSummaryStats getSecondaryInterpretationsSummary() {
return secondaryInterpretationsSummary;
}

public ClinicalVariantSummaryStats setSecondaryInterpretationsSummary(InterpretationSummaryStats secondaryInterpretationsSummary) {
this.secondaryInterpretationsSummary = secondaryInterpretationsSummary;
return this;
}
}
Loading

0 comments on commit 32cf1ab

Please sign in to comment.