Search in sources :

Example 1 with MalformedHpoTermIdException

use of org.monarchinitiative.loinc2hpo.exception.MalformedHpoTermIdException in project loinc2hpo by monarch-initiative.

the class FromFile method getHpoTermId.

TermId getHpoTermId(String termString) throws MalformedHpoTermIdException {
    logger.trace("getHpoTermId=" + termString);
    if (termString.equalsIgnoreCase("NA"))
        return null;
    int i = termString.indexOf(":");
    if (i != 2)
        throw new MalformedHpoTermIdException("Malformed HPO String: " + termString);
    TermId id = new ImmutableTermId(HPPREFIX, termString.substring(3));
    if (ontology.getTermMap().containsKey(id))
        return id;
    else
        throw new MalformedHpoTermIdException("Could not find id " + termString);
}
Also used : MalformedHpoTermIdException(org.monarchinitiative.loinc2hpo.exception.MalformedHpoTermIdException) ImmutableTermId(com.github.phenomics.ontolib.ontology.data.ImmutableTermId) TermId(com.github.phenomics.ontolib.ontology.data.TermId) ImmutableTermId(com.github.phenomics.ontolib.ontology.data.ImmutableTermId)

Aggregations

ImmutableTermId (com.github.phenomics.ontolib.ontology.data.ImmutableTermId)1 TermId (com.github.phenomics.ontolib.ontology.data.TermId)1 MalformedHpoTermIdException (org.monarchinitiative.loinc2hpo.exception.MalformedHpoTermIdException)1