Skip to content

Commit

Permalink
fix(reporter): fix missing phenotype and activity score in drug secti…
Browse files Browse the repository at this point in the history
…on of HTML report
  • Loading branch information
whaleyr committed Feb 9, 2024
1 parent 428b068 commit e3f1029
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class AnnotationReport implements Comparable<AnnotationReport> {
private String m_classification;
@Expose
@SerializedName("activityScore")
private final SortedMap<String, String> m_activityScore = new TreeMap<>();
private final SortedMap<String, String> f_activityScores = new TreeMap<>();
@Expose
@SerializedName("population")
private String m_population = TextConstants.NA;
Expand All @@ -52,6 +52,9 @@ public class AnnotationReport implements Comparable<AnnotationReport> {
@Expose
@SerializedName("otherPrescribingGuidance")
private boolean m_otherPrescribingGuidance = false;
@Expose
@SerializedName("phenotypes")
private Map<String,String> f_phenotypes = new TreeMap<>();


/**
Expand Down Expand Up @@ -110,6 +113,19 @@ public SortedSet<Genotype> getGenotypes() {

public void addGenotype(Genotype genotype) {
m_genotypes.add(genotype);

for (Diplotype dip : genotype.getDiplotypes()) {
for (String phenotype : dip.getPhenotypes()) {
f_phenotypes.put(dip.getGene(), phenotype);
}
if (dip.hasActivityScore()) {
f_activityScores.put(dip.getGene(), dip.getActivityScore());
}
}
}

public Map<String,String> getPhenotypes() {
return f_phenotypes;
}

public String getDrugRecommendation() {
Expand All @@ -129,7 +145,7 @@ public List<String> getImplications() {
}

public Map<String, String> getActivityScores() {
return m_activityScore;
return f_activityScores;
}


Expand Down Expand Up @@ -193,7 +209,7 @@ public int compareTo(@NonNull AnnotationReport o) {
.compare(m_genotypes, o.getGenotypes())
.compare(m_population, o.getPopulation())
.compare(m_highlightedVariants, o.getHighlightedVariants())
.compare(m_activityScore, o.getActivityScores())
.compare(this.getActivityScores(), o.getActivityScores())
.compare(m_classification, o.getClassification())
.compare(m_drugRecommendation, o.getDrugRecommendation())
.compare(m_implications, o.getImplications())
Expand Down

0 comments on commit e3f1029

Please sign in to comment.