Phenotype Ontology Library: Phenol

Phenol is a modern Java (version 8 and above) library for working with phenotype and other attribute ontologies (including Gene Ontology). Phenol provides full support for working with the Human Phenotype Ontology and HPO-based disease annotations.

Quick Example

The following snippet will load the hp.obo file (which can be downloaded from the HPO website) into an Ontology object. The HPO has multiple subontologies, and the following code extracts all of the terms of the Phenotypic Abnormality subontology.

String hpoOboFilePath=...; // initialize to path of hp.obo file
Ontology ontology =  OntologyLoader.loadOntology(new File(hpoOboFilePath));
final TermId PHENOTYPIC_ABNORMALITY = TermId.of("HP:0000118");
for (TermId tid : getDescendents(ontology, PHENOTYPIC_ABNORMALITY)) {
  Term hpoTerm = ontology.getTermMap().get(tid);
  // ... do something with the Term
}

History

Phenolib was forked from Ontolib in April 2018, and since has been extensively refactored and extended to provide additional functionality for working with phenotype annotations. Several classes from the Ontologizer, which we initially programmed in Java 1.5, have been refactored to support Gene Ontology overrepresentation analysis (see Bauer et al., 2008).

Feedback

The best place to leave feedback, ask questions, and report bugs is the Phenol Issue Tracker.