@Override public void initialize() throws InitializationException { this.totalTerms = this.omim.count(Collections.singletonMap(SEARCH_FOR, "HP:0000001")); }
@Override public void initialize() throws InitializationException { this.totalTerms = this.omim.count(Collections.singletonMap(SEARCH_FOR, "HP:0000001")); }
private boolean hasDescendantsInOntology(String id) { if (!id.startsWith("HP:")) { return false; } Map<String, String> params = new HashMap<>(); params.put(INDEXED_PARENT_KEY, id); return (this.ontologyService.count(params) > 0); }
private boolean hasDescendantsInOntology(String id) { if (!id.startsWith("HP:")) { return false; } Map<String, String> params = new HashMap<>(); params.put(INDEXED_PARENT_KEY, id); return (this.ontologyService.count(params) > 0); }
/** * How much information is captured by a feature? In other words, how many diseases are selected by a feature out of * the total selectable diseases. If a feature doesn't select any diseases at all, the information content of its * nearest represented ancestor is considered, with a slight boost for even more specificity. * * @param f the target feature to measure * @return the information content captured by this term */ private double informationContent(Feature f) { String toSearch = f.getId(); double ic = informationContent(this.omim.count(Collections.singletonMap(SEARCH_FOR, toSearch))); int i = 0; while (ic == 0 && ++i < 5) { VocabularyTerm term = this.hpo.getTerm(toSearch); if (term == null) { break; } Set<VocabularyTerm> parents = term.getParents(); if (parents.isEmpty()) { break; } toSearch = parents.iterator().next().getId(); ic = informationContent(this.omim.count(Collections.singletonMap(SEARCH_FOR, toSearch))); } return ic * (1 + i / 5); }
/** * How much information is captured by a feature? In other words, how many diseases are selected by a feature out of * the total selectable diseases. If a feature doesn't select any diseases at all, the information content of its * nearest represented ancestor is considered, with a slight boost for even more specificity. * * @param f the target feature to measure * @return the information content captured by this term */ private double informationContent(Feature f) { String toSearch = f.getId(); double ic = informationContent(this.omim.count(Collections.singletonMap(SEARCH_FOR, toSearch))); int i = 0; while (ic == 0 && ++i < 5) { VocabularyTerm term = this.hpo.getTerm(toSearch); if (term == null) { break; } Set<VocabularyTerm> parents = term.getParents(); if (parents.isEmpty()) { break; } toSearch = parents.iterator().next().getId(); ic = informationContent(this.omim.count(Collections.singletonMap(SEARCH_FOR, toSearch))); } return ic * (1 + i / 5); }