HiPhivePriorityResult extends AbstractPriorityResult { @JsonIgnore @Override public String getHTMLCode() { StringBuilder stringBuilder = new StringBuilder(); for (GeneModelPhenotypeMatch geneModelPhenotypeMatch : phenotypeEvidence) { switch (geneModelPhenotypeMatch.getOrganism()) { case HUMAN: GeneDiseaseModel geneDiseaseModel = (GeneDiseaseModel) geneModelPhenotypeMatch.getModel(); String diseaseLink = makeDiseaseLink(geneDiseaseModel.getDiseaseId(), geneDiseaseModel.getDiseaseTerm()); stringBuilder.append(String.format("<dl><dt>Phenotypic similarity %.3f to %s associated with %s.</dt>", geneModelPhenotypeMatch .getScore(), diseaseLink, geneModelPhenotypeMatch.getHumanGeneSymbol())); break; case MOUSE: stringBuilder.append(String.format("<dl><dt>Phenotypic similarity %.3f to mouse mutant involving <a href=\"http: .getScore(), geneModelPhenotypeMatch.getHumanGeneSymbol(), geneModelPhenotypeMatch.getHumanGeneSymbol())); break; case FISH: stringBuilder.append(String.format("<dl><dt>Phenotypic similarity %.3f to zebrafish mutant involving <a href=\"http: .getScore(), geneModelPhenotypeMatch.getHumanGeneSymbol(), geneModelPhenotypeMatch.getHumanGeneSymbol())); break; } Map<PhenotypeTerm, PhenotypeMatch> bestMatchesForModel = getPhenotypeTermPhenotypeMatchMap(geneModelPhenotypeMatch); makeBestPhenotypeMatchHtml(stringBuilder, bestMatchesForModel); stringBuilder.append("</dl>"); } for (GeneModelPhenotypeMatch geneModelPhenotypeMatch : ppiEvidence) { String stringDbLink = "http: .getHumanGeneSymbol() + "&required_score=700&network_flavor=evidence&species=9606&limit=20"; switch (geneModelPhenotypeMatch.getOrganism()) { case HUMAN: GeneDiseaseModel geneDiseaseModel = (GeneDiseaseModel) geneModelPhenotypeMatch.getModel(); String diseaseLink = makeDiseaseLink(geneDiseaseModel.getDiseaseId(), geneDiseaseModel.getDiseaseTerm()); stringBuilder.append(String.format("<dl><dt>Proximity score %.3f in <a href=\"%s\">interactome to %s</a> and phenotypic similarity %.3f to %s associated with %s.</dt>", ppiScore, stringDbLink, geneModelPhenotypeMatch .getHumanGeneSymbol(), geneModelPhenotypeMatch.getScore(), diseaseLink, geneModelPhenotypeMatch .getHumanGeneSymbol())); break; case MOUSE: stringBuilder.append(String.format("<dl><dt>Proximity score %.3f in <a href=\"%s\">interactome to %s</a> and phenotypic similarity %.3f to mouse mutant of %s.</dt>", ppiScore, stringDbLink, geneModelPhenotypeMatch .getHumanGeneSymbol(), geneModelPhenotypeMatch.getScore(), geneModelPhenotypeMatch.getHumanGeneSymbol())); break; case FISH: stringBuilder.append(String.format("<dl><dt>Proximity score %.3f in <a href=\"%s\">interactome to %s</a> and phenotypic similarity %.3f to fish mutant of %s.</dt>", ppiScore, stringDbLink, geneModelPhenotypeMatch .getHumanGeneSymbol(), geneModelPhenotypeMatch.getScore(), geneModelPhenotypeMatch.getHumanGeneSymbol())); break; } Map<PhenotypeTerm, PhenotypeMatch> bestModelPhenotypeMatches = getPhenotypeTermPhenotypeMatchMap(geneModelPhenotypeMatch); makeBestPhenotypeMatchHtml(stringBuilder, bestModelPhenotypeMatches); stringBuilder.append("</dl>"); } String html = stringBuilder.toString(); if (html.isEmpty()) { return "<dl><dt>No phenotype or PPI evidence</dt></dl>"; } return html; } HiPhivePriorityResult(int geneId, String geneSymbol, double score, List<PhenotypeTerm> queryPhenotypeTerms, List<GeneModelPhenotypeMatch> phenotypeEvidence, List<GeneModelPhenotypeMatch> ppiEvidence, double ppiScore, boolean candidateGeneMatch); @Override String getGeneSymbol(); @Override double getScore(); List<PhenotypeTerm> getQueryPhenotypeTerms(); List<GeneModelPhenotypeMatch> getPhenotypeEvidence(); List<GeneModelPhenotypeMatch> getPpiEvidence(); double getHumanScore(); double getMouseScore(); double getFishScore(); double getPpiScore(); boolean isCandidateGeneMatch(); @JsonIgnore String getPhenotypeEvidenceText(); @JsonIgnore @Override String getHTMLCode(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testGetHTMLCode() { assertThat(instance.getHTMLCode(), equalTo("<dl><dt>No phenotype or PPI evidence</dt></dl>")); }