OmimPriorityResult extends AbstractPriorityResult { @Override public String getHTMLCode() { StringBuilder sb = new StringBuilder("<dl>\n"); if (hasNoKnownDisease()) { return "<dt>No known disease</dt>"; } sb.append("<dt>Known diseases"); if (this.score < 1f) { sb.append(" - observed variants incompatible with mode of inheritance"); } sb.append(":</dt>\n"); for (Disease disease : diseases) { String display = makeDisplayString(disease); sb.append("<dd>" + display + "</dd>\n"); } sb.append("</dl>"); return sb.toString(); } OmimPriorityResult(int geneId, String geneSymbol, double score, List<Disease> diseases, Map<ModeOfInheritance, Double> scoresByMode); List<Disease> getAssociatedDiseases(); Map<ModeOfInheritance, Double> getScoresByMode(); double getScoreForMode(ModeOfInheritance modeOfInheritance); @Override double getScore(); @Override String getHTMLCode(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testToHtmlNoDiseases() { OmimPriorityResult instance = new OmimPriorityResult(1234, "GENE1", 1d, Collections.emptyList(), Collections.emptyMap()); System.out.println(instance.getHTMLCode()); }
@Test public void testToHtmlOmimDiseases() { Disease disease = Disease.builder().diseaseId("OMIM:12345").diseaseName("OMIM disease name").diseaseType(Disease.DiseaseType.DISEASE).inheritanceModeCode("D").build(); Disease nonDisease = Disease.builder().diseaseId("OMIM:54321").diseaseName("OMIM non-disease name").diseaseType(Disease.DiseaseType.NON_DISEASE).inheritanceModeCode("U").build(); OmimPriorityResult instance = new OmimPriorityResult(1234, "GENE1", 1d, Lists.newArrayList(disease, nonDisease), Collections.emptyMap()); System.out.println(instance.getHTMLCode()); }
@Test public void testToHtmlIncompatibleOmimDiseases() { Disease disease = Disease.builder().diseaseId("OMIM:12345").diseaseName("Incompatible OMIM disease name").build(); OmimPriorityResult instance = new OmimPriorityResult(1234, "GENE1", 0.5d, Lists.newArrayList(disease), Collections.emptyMap()); System.out.println(instance.getHTMLCode()); }
@Test public void testToHtmlIncompatibleOrphanetDiseases() { Disease disease = Disease.builder().diseaseId("ORPHANET:12345").diseaseName("Incompatible Orphanet disease name").build(); OmimPriorityResult instance = new OmimPriorityResult(1234, "GENE1", 0.5d, Lists.newArrayList(disease), Collections.emptyMap()); System.out.println(instance.getHTMLCode()); }
@Test public void testToHtmlUnknownDiseaseId() { Disease disease = Disease.builder().diseaseId("WIBBLE:12345").diseaseName("Unknown diseaseId name").build(); OmimPriorityResult instance = new OmimPriorityResult(1234, "GENE1", 1d, Lists.newArrayList(disease), Collections.emptyMap()); System.out.println(instance.getHTMLCode()); }