Skip to content
Aaron Masino edited this page Jan 7, 2014 · 2 revisions

The API is a Scala project that codifies the notion of an Ontology and annotations of terms in the Ontology to Objects in some domain. Given an Ontology and the annotations, it provide further capabilities for exploring the ontology, determining information content of terms in the ontology with respect to their use as annotating terms, and similarity measures between sets of ontology terms as derived from their information content.

On top of this abstraction, the API implements the codification of the HPO ontology with annotations to the Entrez gene set and provides a number of similarity measures between sets of phenotypes.

Build

Assuming the phenomantics project has been cloned to ~/phenomantics, the API can be packaged as .jar file with dependencies by navigating to ~/phenomantics/apps/api and executing

>sbt assembly

This will generate the file ~/phenomantics/apps/api/target/phenomantics.jar. Include this file on the classpath of the application that will use the API.

Configuration

Configuration is necessary only if your application uses any of the following:

Class: edu.chop.cbmi.phenomantics.api.ontologies.HPOEntrezAnnotatingOntology (only if using following methods)
Methods:
pvalue(gene: EntrezGene, query: Set[HPO_Term], sf: SimilarityFunction)
cdfResultFor(gene : EntrezGene, sf: SimilarityFunction, k: Int)
Configuration: Requires access to a database storing CDF tables. A given table contains the similarity score CDF data for all genes for a given similarity function, SIMFUNC, and a given number of phenotype query terms, k. Tables should be named as SIMFUNC_k## where SIMFUNC is one of the following

  • asymsim1
  • symsim1
  • symsim2

and ## is any valid integer representing the number of query terms used to generate the similarity scores. Integers <10 should be prefixed with a 0, as in 01, 02. Each table should have the following columns:

id serial #database pk

gene_id integer #Entrez gene id

score real #similarity score observed for the gene_id, SIMFUNC, k combination

count integer #[OPTIONAL] the number of times the similarity score was observed for the gene_id, SIMFUNC, k combination

cdf real #the cdf for the score

Additionally, the API requires credential information to access the database. Assuming an application using the API is run from the current directory '.', the credential information must be specified in the file ./conf/credentials.conf which must contain the following content (values in CAPS must be replaced with appropriate values):

db{
    credentials{
        driverClassName="DRIVER.CLASS.NAME"
        jdbcUri="jdbc:DBTYPE://IP:PORT/DBNAME"
        user="USER"
        password="PASSWORD"
    }
}

Usage

For a complex example see this simulation.

import edu.chop.cbmi.phenomantics.api.gene.EntrezGene
import edu.chop.cbmi.phenomantics.api.ontologies._
val ontology = HPOEntrezFactory.informationAO
val gene = ontology.entrezGeneById(100).get
val geneAnnotations = ontology.annotationsFor(gene).get
val phenotypes = Set(ontology.hpoConceptById("HP:0002621").get, 
                     ontology.hpoConceptById("HP:0000001").get)
val similarity = ontology.asymMaxSim1(phenotypes, geneAnnotations)
Clone this wiki locally