Search in sources :

Example 1 with AnnotationProperty

use of ubic.basecode.ontology.model.AnnotationProperty in project Gemma by PavlidisLab.

the class GeneOntologyServiceImpl method getTermAspect.

private GOAspect getTermAspect(OntologyTerm term) {
    assert term != null;
    String goId = term.getTerm();
    if (GeneOntologyServiceImpl.term2Aspect.containsKey(goId)) {
        return GeneOntologyServiceImpl.term2Aspect.get(goId);
    }
    String nameSpace = null;
    for (AnnotationProperty annot : term.getAnnotations()) {
        /*
             * Why they changed this, I can't say. It used to be hasOBONamespace but now comes through as
             * has_obo_namespace.
             */
        if (annot.getProperty().equals("hasOBONamespace") || annot.getProperty().equals("has_obo_namespace")) {
            nameSpace = annot.getContents();
            break;
        }
    }
    if (nameSpace == null) {
        GeneOntologyServiceImpl.log.warn("aspect could not be determined for: " + term);
        return null;
    }
    GOAspect aspect = GOAspect.valueOf(nameSpace.toUpperCase());
    GeneOntologyServiceImpl.term2Aspect.put(goId, aspect);
    return aspect;
}
Also used : AnnotationProperty(ubic.basecode.ontology.model.AnnotationProperty)

Example 2 with AnnotationProperty

use of ubic.basecode.ontology.model.AnnotationProperty in project Gemma by PavlidisLab.

the class GeneOntologyServiceImpl method getTermDefinition.

@Override
public String getTermDefinition(String goId) {
    OntologyTerm t = GeneOntologyServiceImpl.getTermForId(goId);
    assert t != null;
    Collection<AnnotationProperty> annotations = t.getAnnotations();
    for (AnnotationProperty annot : annotations) {
        GeneOntologyServiceImpl.log.info(annot.getProperty());
        if (annot.getProperty().equals("hasDefinition")) {
            return annot.getContents();
        }
    }
    return null;
}
Also used : AnnotationProperty(ubic.basecode.ontology.model.AnnotationProperty) OntologyTerm(ubic.basecode.ontology.model.OntologyTerm)

Aggregations

AnnotationProperty (ubic.basecode.ontology.model.AnnotationProperty)2 OntologyTerm (ubic.basecode.ontology.model.OntologyTerm)1