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-2103 #224

Merged
merged 1 commit into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class ClinicalVariantEvidence {
private boolean fullyExplainPhenotypes;
private List<String> compoundHeterozygousVariantIds;
private RoleInCancer roleInCancer;
@Deprecated
private boolean actionable;

private ClinicalEvidenceReview review;
Expand All @@ -52,6 +53,7 @@ public ClinicalVariantEvidence() {
review = new ClinicalEvidenceReview();
}

@Deprecated
public ClinicalVariantEvidence(String interpretationMethodName, List<Phenotype> phenotypes, GenomicFeature genomicFeature,
List<ModeOfInheritance> modeOfInheritances, String panelId, VariantClassification classification,
Penetrance penetrance, double score, boolean fullyExplainPhenotypes,
Expand All @@ -72,6 +74,25 @@ public ClinicalVariantEvidence(String interpretationMethodName, List<Phenotype>
this.review = review;
}

public ClinicalVariantEvidence(String interpretationMethodName, List<Phenotype> phenotypes, GenomicFeature genomicFeature,
List<ModeOfInheritance> modeOfInheritances, String panelId, VariantClassification classification,
Penetrance penetrance, double score, boolean fullyExplainPhenotypes,
List<String> 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{");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,29 +58,24 @@ public abstract class ClinicalVariantCreator {
protected Penetrance penetrance;

protected Map<String, RoleInCancer> roleInCancer;
protected Map<String, List<String>> actionableVariants;

protected String assembly;

public ClinicalVariantCreator(List<DiseasePanel> diseasePanels, Disorder disorder,
List<ModeOfInheritance> modeOfInheritances, Penetrance penetrance,
Map<String, RoleInCancer> roleInCancer, Map<String, List<String>> actionableVariants,
String assembly) {
this(diseasePanels, disorder, modeOfInheritances, penetrance, roleInCancer, actionableVariants, assembly,
new ArrayList<>(proteinCoding), new ArrayList<>(extendedLof));
public ClinicalVariantCreator(List<DiseasePanel> diseasePanels, Disorder disorder, List<ModeOfInheritance> modeOfInheritances,
Penetrance penetrance, Map<String, RoleInCancer> roleInCancer, String assembly) {
this(diseasePanels, disorder, modeOfInheritances, penetrance, roleInCancer, assembly, new ArrayList<>(proteinCoding),
new ArrayList<>(extendedLof));
}

public ClinicalVariantCreator(List<DiseasePanel> diseasePanels, Disorder disorder,
List<ModeOfInheritance> modeOfInheritances, Penetrance penetrance,
Map<String, RoleInCancer> roleInCancer, Map<String, List<String>> actionableVariants,
String assembly, List<String> biotypes, List<String> soNames) {
public ClinicalVariantCreator(List<DiseasePanel> diseasePanels, Disorder disorder, List<ModeOfInheritance> modeOfInheritances,
Penetrance penetrance, Map<String, RoleInCancer> roleInCancer, String assembly, List<String> biotypes,
List<String> 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<>();
Expand Down Expand Up @@ -113,20 +108,6 @@ public List<ClinicalVariant> createSecondaryFindings(List<Variant> variants) {
for (Variant variant : variants) {
List<ClinicalVariantEvidence> 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(),
Expand Down Expand Up @@ -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<Phenotype> 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;
}

Expand Down Expand Up @@ -347,7 +307,7 @@ protected List<ClinicalVariantEvidence> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@ public class DefaultClinicalVariantCreator extends ClinicalVariantCreator {

private boolean includeUntieredVariants;

public DefaultClinicalVariantCreator(Map<String, ClinicalProperty.RoleInCancer> roleInCancer,
Map<String, List<String>> actionableVariants, Disorder disorder,
public DefaultClinicalVariantCreator(Map<String, ClinicalProperty.RoleInCancer> roleInCancer, Disorder disorder,
List<ModeOfInheritance> modeOfInheritances, Penetrance penetrance,
List<DiseasePanel> diseasePanels, List<String> biotypes, List<String> 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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@

public class TeamClinicalVariantCreator extends ClinicalVariantCreator {

public TeamClinicalVariantCreator(List<DiseasePanel> diseasePanels, Map<String, RoleInCancer> roleInCancer,
Map<String, List<String>> actionableVariants, Disorder disorder,
public TeamClinicalVariantCreator(List<DiseasePanel> diseasePanels, Map<String, RoleInCancer> roleInCancer, Disorder disorder,
List<ModeOfInheritance> modeOfInheritances, Penetrance penetrance) {
super(diseasePanels, disorder, modeOfInheritances, penetrance, roleInCancer, actionableVariants, null);
super(diseasePanels, disorder, modeOfInheritances, penetrance, roleInCancer, null);
}

@Override
Expand Down Expand Up @@ -106,22 +105,6 @@ public List<ClinicalVariant> create(List<Variant> 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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<DiseasePanel> diseasePanels, Map<String, RoleInCancer> roleInCancer,
Map<String, List<String>> actionableVariants, Disorder disorder,
public TieringClinicalVariantCreator(List<DiseasePanel> diseasePanels, Map<String, RoleInCancer> 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
Expand Down