Package psidev.psi.mi.jami.bridges.obo
Class AbstractOboLoader<T extends CvTerm>
- java.lang.Object
-
- uk.ac.ebi.ols.loader.impl.BaseOBO2AbstractLoader
-
- psidev.psi.mi.jami.bridges.obo.AbstractOboLoader<T>
-
- 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)
-
-
Field Summary
Fields Modifier and Type Field Description static String
ALIAS_IDENTIFIER
ConstantALIAS_IDENTIFIER="Alternate label curated by PSI-MI"
static String
COMMENT_KEY
ConstantCOMMENT_KEY="comment"
static String
EXACT_KEY
ConstantEXACT_KEY="exact"
static String
GO
ConstantGO="go"
static String
GO_MI_REF
ConstantGO_MI_REF="MI:0448"
static String
HTTP_DEF
ConstantHTTP_DEF="http"
static String
LINE_BREAK
ConstantLINE_BREAK="\n"
static org.apache.commons.logging.Log
log
Sets up a logger for that class.static String
META_XREF_SEPARATOR
ConstantMETA_XREF_SEPARATOR=":"
static String
METHOD_REFERENCE
ConstantMETHOD_REFERENCE="method reference"
static String
METHOD_REFERENCE_MI_REF
ConstantMETHOD_REFERENCE_MI_REF="MI:0357"
static String
MOD_ALIAS_IDENTIFIER
ConstantMOD_ALIAS_IDENTIFIER="Alternate name curated by PSI-MOD"
static String
MOD_SHORTLABEL_IDENTIFIER
ConstantMOD_SHORTLABEL_IDENTIFIER="Short label curated by PSI-MOD"
static String
PMID
ConstantPMID="PMID"
static String
PMID_APPLICATION
ConstantPMID_APPLICATION="PMID for application instance"
static String
QUOTE
ConstantQUOTE="""
static String
RESID
ConstantRESID="resid"
static String
RESID_IDENTIFIER
ConstantRESID_IDENTIFIER="Alternate name from RESID"
static String
RESID_MI_REF
ConstantRESID_MI_REF="MI:0248"
static String
RESID_MISNOMER_IDENTIFIER
ConstantRESID_MISNOMER_IDENTIFIER="Misnomer tagged alternate name from RES"{trunked}
static String
RESID_NAME_IDENTIFIER
ConstantRESID_NAME_IDENTIFIER="Name from RESID"
static String
RESID_SYSTEMATIC_IDENTIFIER
ConstantRESID_SYSTEMATIC_IDENTIFIER="Systematic name from RESID"
static String
SEARCH_URL
ConstantSEARCH_URL="search-url"
static String
SEARCH_URL_MI_REF
ConstantSEARCH_URL_MI_REF="MI:0615"
static String
SHORTLABEL_IDENTIFIER
ConstantSHORTLABEL_IDENTIFIER="Unique short label curated by PSI-MI"
static String
SO
ConstantSO="so"
static String
SO_MI_REF
ConstantSO_MI_REF="MI:0601"
static String
UNIPROT_FEATURE_IDENTIFIER
ConstantUNIPROT_FEATURE_IDENTIFIER="Protein feature description from UniPro"{trunked}
static int
XREF_TYPE
ConstantXREF_TYPE=3
static String
XREF_VALIDATION_REGEXP
ConstantXREF_VALIDATION_REGEXP="id-validation-regexp"
static String
XREF_VALIDATION_REGEXP_MI_REF
ConstantXREF_VALIDATION_REGEXP_MI_REF="MI:0628"
-
Fields inherited from class uk.ac.ebi.ols.loader.impl.BaseOBO2AbstractLoader
ALT_ID, BATCH_MODE, BROAD, DEV_FROM_SET, DEVELOPS_FROM, EXACT, FULL_NAME, IS_A, IS_A_SET, logger, NARROW, ontBean, ONTOLOGY_DEFINITION, ontologyTerms, parser, PART_OF, PART_OF_SET, QUERY_URL, RELATED, SHORT_NAME, SOURCE_URL, SYNONYM, useGreedy
-
-
Constructor Summary
Constructors Constructor Description AbstractOboLoader(String databaseName)
Constructor for AbstractOboLoader.AbstractOboLoader(CvTerm database)
Constructor for AbstractOboLoader.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
buildOntology(Map<String,T> id2Terms, Map<String,T> name2Terms)
buildOntology.protected void
configure(String filePath)
configure.protected abstract void
createDefinitionFor(String def, T term)
createDefinitionFor.protected T
createNewTerm(uk.ac.ebi.ols.model.interfaces.Term t)
createNewTerm.protected CvTerm
getOntologyDatabase()
Getter for the fieldontologyDatabase
.protected abstract T
instantiateNewTerm(String name, Xref identity)
instantiateNewTerm.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.protected void
processAnnotations(uk.ac.ebi.ols.model.interfaces.Term term, T ontologyTerm)
Process the annotations of a termprotected void
processDefinition(String definition, T ontologyTerm)
Process the definition Stringprotected void
processDefinition(uk.ac.ebi.ols.model.interfaces.Term term, T ontologyTerm)
Process the definition of a termprotected void
processInfoInDescription(String definition, String otherInfoString, T ontologyTerm)
Process the other information in the descriptionprotected void
processShortLabel(uk.ac.ebi.ols.model.interfaces.Term term, T ontologyTerm)
processShortLabel.protected void
processSynonyms(uk.ac.ebi.ols.model.interfaces.Term term, T ontologyTerm)
processSynonyms.protected void
processXref(String db, String accession, T ontologyTerm)
processXref.protected String
processXrefDefinition(String xref, String database, String accession, String pubmedPrimary, T ontologyTerm)
processXrefDefinition.protected void
processXrefs(uk.ac.ebi.ols.model.interfaces.Term term, T ontologyTerm)
processXrefs.-
Methods inherited from class uk.ac.ebi.ols.loader.impl.BaseOBO2AbstractLoader
dumpOntology, dumpOntologyStats, dumpTerm, getOntology, getRootTerms, getUnknownRelationTermBean, initializeCommonObjects, initializeTermBean, load, process, processTerm, safeTrim, safeTrim, setParser, setUseGreedy, unload
-
-
-
-
Field Detail
-
SHORTLABEL_IDENTIFIER
public static final String SHORTLABEL_IDENTIFIER
ConstantSHORTLABEL_IDENTIFIER="Unique short label curated by PSI-MI"
- See Also:
- Constant Field Values
-
ALIAS_IDENTIFIER
public static final String ALIAS_IDENTIFIER
ConstantALIAS_IDENTIFIER="Alternate label curated by PSI-MI"
- See Also:
- Constant Field Values
-
MOD_SHORTLABEL_IDENTIFIER
public static final String MOD_SHORTLABEL_IDENTIFIER
ConstantMOD_SHORTLABEL_IDENTIFIER="Short label curated by PSI-MOD"
- See Also:
- Constant Field Values
-
EXACT_KEY
public static final String EXACT_KEY
ConstantEXACT_KEY="exact"
- See Also:
- Constant Field Values
-
MOD_ALIAS_IDENTIFIER
public static final String MOD_ALIAS_IDENTIFIER
ConstantMOD_ALIAS_IDENTIFIER="Alternate name curated by PSI-MOD"
- See Also:
- Constant Field Values
-
RESID_IDENTIFIER
public static final String RESID_IDENTIFIER
ConstantRESID_IDENTIFIER="Alternate name from RESID"
- See Also:
- Constant Field Values
-
RESID_MISNOMER_IDENTIFIER
public static final String RESID_MISNOMER_IDENTIFIER
ConstantRESID_MISNOMER_IDENTIFIER="Misnomer tagged alternate name from RES"{trunked}
- See Also:
- Constant Field Values
-
RESID_NAME_IDENTIFIER
public static final String RESID_NAME_IDENTIFIER
ConstantRESID_NAME_IDENTIFIER="Name from RESID"
- See Also:
- Constant Field Values
-
RESID_SYSTEMATIC_IDENTIFIER
public static final String RESID_SYSTEMATIC_IDENTIFIER
ConstantRESID_SYSTEMATIC_IDENTIFIER="Systematic name from RESID"
- See Also:
- Constant Field Values
-
UNIPROT_FEATURE_IDENTIFIER
public static final String UNIPROT_FEATURE_IDENTIFIER
ConstantUNIPROT_FEATURE_IDENTIFIER="Protein feature description from UniPro"{trunked}
- See Also:
- Constant Field Values
-
XREF_TYPE
public static final int XREF_TYPE
ConstantXREF_TYPE=3
- See Also:
- Constant Field Values
-
PMID_APPLICATION
public static final String PMID_APPLICATION
ConstantPMID_APPLICATION="PMID for application instance"
- See Also:
- Constant Field Values
-
SO
public static final String SO
ConstantSO="so"
- See Also:
- Constant Field Values
-
SO_MI_REF
public static final String SO_MI_REF
ConstantSO_MI_REF="MI:0601"
- See Also:
- Constant Field Values
-
HTTP_DEF
public static final String HTTP_DEF
ConstantHTTP_DEF="http"
- See Also:
- Constant Field Values
-
XREF_VALIDATION_REGEXP
public static final String XREF_VALIDATION_REGEXP
ConstantXREF_VALIDATION_REGEXP="id-validation-regexp"
- See Also:
- Constant Field Values
-
XREF_VALIDATION_REGEXP_MI_REF
public static final String XREF_VALIDATION_REGEXP_MI_REF
ConstantXREF_VALIDATION_REGEXP_MI_REF="MI:0628"
- See Also:
- Constant Field Values
-
SEARCH_URL
public static final String SEARCH_URL
ConstantSEARCH_URL="search-url"
- See Also:
- Constant Field Values
-
SEARCH_URL_MI_REF
public static final String SEARCH_URL_MI_REF
ConstantSEARCH_URL_MI_REF="MI:0615"
- See Also:
- Constant Field Values
-
QUOTE
public static final String QUOTE
ConstantQUOTE="""
- See Also:
- Constant Field Values
-
META_XREF_SEPARATOR
public static final String META_XREF_SEPARATOR
ConstantMETA_XREF_SEPARATOR=":"
- See Also:
- Constant Field Values
-
LINE_BREAK
public static final String LINE_BREAK
ConstantLINE_BREAK="\n"
- See Also:
- Constant Field Values
-
COMMENT_KEY
public static final String COMMENT_KEY
ConstantCOMMENT_KEY="comment"
- See Also:
- Constant Field Values
-
PMID
public static final String PMID
ConstantPMID="PMID"
- See Also:
- Constant Field Values
-
METHOD_REFERENCE
public static final String METHOD_REFERENCE
ConstantMETHOD_REFERENCE="method reference"
- See Also:
- Constant Field Values
-
METHOD_REFERENCE_MI_REF
public static final String METHOD_REFERENCE_MI_REF
ConstantMETHOD_REFERENCE_MI_REF="MI:0357"
- See Also:
- Constant Field Values
-
GO
public static final String GO
ConstantGO="go"
- See Also:
- Constant Field Values
-
GO_MI_REF
public static final String GO_MI_REF
ConstantGO_MI_REF="MI:0448"
- See Also:
- Constant Field Values
-
RESID
public static final String RESID
ConstantRESID="resid"
- See Also:
- Constant Field Values
-
RESID_MI_REF
public static final String RESID_MI_REF
ConstantRESID_MI_REF="MI:0248"
- See Also:
- Constant Field Values
-
log
public static final org.apache.commons.logging.Log log
Sets up a logger for that class.
-
-
Method Detail
-
getOntologyDatabase
protected CvTerm getOntologyDatabase()
Getter for the field
ontologyDatabase
.- Returns:
- a
CvTerm
object.
-
configure
protected void configure(String filePath)
configure.
- Parameters:
filePath
- aString
object.
-
buildOntology
public void buildOntology(Map<String,T> id2Terms, Map<String,T> name2Terms)
buildOntology.
-
createNewTerm
protected T createNewTerm(uk.ac.ebi.ols.model.interfaces.Term t)
createNewTerm.
- Parameters:
t
- aTerm
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
- aTerm
object.ontologyTerm
- a T object.
-
processXrefs
protected void processXrefs(uk.ac.ebi.ols.model.interfaces.Term term, T ontologyTerm)
processXrefs.
- Parameters:
term
- aTerm
object.ontologyTerm
- a T object.
-
processXrefDefinition
protected String processXrefDefinition(String xref, String database, String accession, String pubmedPrimary, T ontologyTerm)
processXrefDefinition.
-
processDefinition
protected void processDefinition(uk.ac.ebi.ols.model.interfaces.Term term, T ontologyTerm)
Process the definition of a term- Parameters:
term
- aTerm
object.ontologyTerm
- a T object.
-
processDefinition
protected void processDefinition(String definition, T ontologyTerm)
Process the definition String- Parameters:
definition
- aString
object.ontologyTerm
- a T object.
-
processInfoInDescription
protected void processInfoInDescription(String definition, String otherInfoString, T ontologyTerm)
Process the other information in the description
-
processSynonyms
protected void processSynonyms(uk.ac.ebi.ols.model.interfaces.Term term, T ontologyTerm)
processSynonyms.
- Parameters:
term
- aTerm
object.ontologyTerm
- a T object.
-
processShortLabel
protected void processShortLabel(uk.ac.ebi.ols.model.interfaces.Term term, T ontologyTerm)
processShortLabel.
- Parameters:
term
- aTerm
object.ontologyTerm
- a T object.
-
instantiateNewTerm
protected abstract T instantiateNewTerm(String name, Xref identity)
instantiateNewTerm.
-
createDefinitionFor
protected abstract void createDefinitionFor(String def, T term)
createDefinitionFor.
- Parameters:
def
- aString
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 populatename2Terms
- : the map name2Term to populate
-
-