Class AbstractOboLoader<T extends CvTerm>

  • All Implemented Interfaces:
    uk.ac.ebi.ols.loader.interfaces.Loader
    Direct Known Subclasses:
    CvOboLoader, OntologyOboLoader, SourceOboLoader

    public abstract class AbstractOboLoader<T extends CvTerm>
    extends uk.ac.ebi.ols.loader.impl.BaseOBO2AbstractLoader
    Abstract obo loader
    Since:
    17/07/13
    Version:
    $Id$
    Author:
    Marine Dumousseau (marine@ebi.ac.uk)
    • Constructor Detail

      • AbstractOboLoader

        public AbstractOboLoader​(CvTerm database)

        Constructor for AbstractOboLoader.

        Parameters:
        database - a CvTerm object.
      • AbstractOboLoader

        public AbstractOboLoader​(String databaseName)

        Constructor for AbstractOboLoader.

        Parameters:
        databaseName - a String object.
    • Method Detail

      • getOntologyDatabase

        protected CvTerm getOntologyDatabase()

        Getter for the field ontologyDatabase.

        Returns:
        a CvTerm object.
      • configure

        protected void configure​(String filePath)

        configure.

        Parameters:
        filePath - a String object.
      • buildOntology

        public void buildOntology​(Map<String,​T> id2Terms,
                                  Map<String,​T> name2Terms)

        buildOntology.

        Parameters:
        id2Terms - a Map object.
        name2Terms - a Map object.
      • createNewTerm

        protected T createNewTerm​(uk.ac.ebi.ols.model.interfaces.Term t)

        createNewTerm.

        Parameters:
        t - a Term object.
        Returns:
        a T object.
      • processAnnotations

        protected void processAnnotations​(uk.ac.ebi.ols.model.interfaces.Term term,
                                          T ontologyTerm)
        Process the annotations of a term
        Parameters:
        term - a Term object.
        ontologyTerm - a T object.
      • processXrefs

        protected void processXrefs​(uk.ac.ebi.ols.model.interfaces.Term term,
                                    T ontologyTerm)

        processXrefs.

        Parameters:
        term - a Term object.
        ontologyTerm - a T object.
      • processXrefDefinition

        protected String processXrefDefinition​(String xref,
                                               String database,
                                               String accession,
                                               String pubmedPrimary,
                                               T ontologyTerm)

        processXrefDefinition.

        Parameters:
        xref - a String object.
        database - a String object.
        accession - a String object.
        pubmedPrimary - a String object.
        ontologyTerm - a T object.
        Returns:
        a String object.
      • processXref

        protected void processXref​(String db,
                                   String accession,
                                   T ontologyTerm)

        processXref.

        Parameters:
        db - a String object.
        accession - a String object.
        ontologyTerm - a T object.
      • processDefinition

        protected void processDefinition​(uk.ac.ebi.ols.model.interfaces.Term term,
                                         T ontologyTerm)
        Process the definition of a term
        Parameters:
        term - a Term object.
        ontologyTerm - a T object.
      • processDefinition

        protected void processDefinition​(String definition,
                                         T ontologyTerm)
        Process the definition String
        Parameters:
        definition - a String object.
        ontologyTerm - a T object.
      • processInfoInDescription

        protected void processInfoInDescription​(String definition,
                                                String otherInfoString,
                                                T ontologyTerm)
        Process the other information in the description
        Parameters:
        definition - a String object.
        otherInfoString - a String object.
        ontologyTerm - a T object.
      • processSynonyms

        protected void processSynonyms​(uk.ac.ebi.ols.model.interfaces.Term term,
                                       T ontologyTerm)

        processSynonyms.

        Parameters:
        term - a Term object.
        ontologyTerm - a T object.
      • processShortLabel

        protected void processShortLabel​(uk.ac.ebi.ols.model.interfaces.Term term,
                                         T ontologyTerm)

        processShortLabel.

        Parameters:
        term - a Term object.
        ontologyTerm - a T object.
      • instantiateNewTerm

        protected abstract T instantiateNewTerm​(String name,
                                                Xref identity)

        instantiateNewTerm.

        Parameters:
        name - a String object.
        identity - a Xref object.
        Returns:
        a T object.
      • createDefinitionFor

        protected abstract void createDefinitionFor​(String def,
                                                    T term)

        createDefinitionFor.

        Parameters:
        def - a String object.
        term - a T object.
      • parseOboFile

        public void parseOboFile​(File file,
                                 Map<String,​T> id2Terms,
                                 Map<String,​T> name2Terms)
        Parse the given OBO file and build a representation of the DAG into an Ontology.
        Parameters:
        file - the input file. It has to exist and to be readable, otherwise it will break.
        id2Terms - : the map id2Term to populate
        name2Terms - : the map name2Term to populate