Class GeneOntologyServiceImpl
- java.lang.Object
-
- ubic.basecode.ontology.jena.AbstractOntologyService
-
- ubic.basecode.ontology.providers.AbstractOntologyService
-
- ubic.gemma.core.ontology.providers.GeneOntologyServiceImpl
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean,OntologyService,GeneOntologyService
@Service @ParametersAreNonnullByDefault public class GeneOntologyServiceImpl extends AbstractOntologyService implements GeneOntologyService, org.springframework.beans.factory.InitializingBean
- Author:
- pavlidis
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGeneOntologyServiceImpl.GOAspect-
Nested classes/interfaces inherited from interface ubic.basecode.ontology.providers.OntologyService
OntologyService.InferenceMode, OntologyService.LanguageLevel
-
-
Constructor Summary
Constructors Constructor Description GeneOntologyServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()Map<Long,Collection<OntologyTerm>>calculateGoTermOverlap(Long queryGene, Collection<Long> geneIds)Map<Long,Collection<OntologyTerm>>calculateGoTermOverlap(Gene queryGene, Collection<Long> geneIds)Given a query Gene, and a collection of gene ids calculates the go term overlap for each pair of queryGene and gene in the given collection.Collection<OntologyTerm>calculateGoTermOverlap(Gene queryGene1, Gene queryGene2)voidclearCaches()Primarily here for testing, to recover memory.Collection<OntologyTerm>computeOverlap(Collection<OntologyTerm> masterTerms, Collection<OntologyTerm> comparisonTerms)Collection<OntologySearchResult<OntologyTerm>>findTerm(String queryString, int maxResults)Set<OntologyTerm>getAllParents(Collection<OntologyTerm> entries)Set<OntologyTerm>getAllParents(Collection<OntologyTerm> entries, boolean includePartOf)protected StringgetCacheName()Collection<Gene>getGenes(String goId, Taxon taxon)Find genes for a given GO term by GO ID.Collection<Gene>getGenes(OntologyTerm term, Taxon taxon)Find genes for a given of GO term.Collection<OntologyTerm>getGOTerms(Gene gene)Collection<OntologyTerm>getGOTerms(Gene gene, boolean includePartOf, GeneOntologyServiceImpl.GOAspect goAspect)Get all GO terms for a gene, including parents of terms via is-a relationships; and optionally also parents via part-of relationships.protected StringgetOntologyName()protected StringgetOntologyUrl()OntologyResourcegetResource(String goId)Retrieve a GO resource by ID or URI.OntologyTermgetTerm(String goId)Retrieve a GO term by ID or URI.GeneOntologyServiceImpl.GOAspectgetTermAspect(String goId)GeneOntologyServiceImpl.GOAspectgetTermAspect(Characteristic goId)StringgetTermDefinition(String goId)Return a definition for a GO ID.Collection<OntologyIndividual>getTermIndividuals(String goId)Retrieve a GO individuals by ID or URI.GeneOntologyTermValueObjectgetValueObject(OntologyTerm term)Converts the given Ontology Term to a Gene Ontology Value Object.List<GeneOntologyTermValueObject>getValueObjects(Collection<OntologyTerm> terms)Converts the given collection of Ontology Terms to Gene Ontology Value Objects.List<GeneOntologyTermValueObject>getValueObjects(Gene gene)Returns GO Terms VOs for the given Gene.voidinitialize(InputStream stream, boolean forceIndexing)booleanisBiologicalProcess(OntologyTerm term)protected booleanisOntologyEnabled()-
Methods inherited from class ubic.basecode.ontology.jena.AbstractOntologyService
cancelInitializationThread, findIndividuals, findResources, findTerm, findUsingAlternativeId, getAdditionalPropertyUris, getAllURIs, getChildren, getDescription, getExcludedWordsFromStemming, getInferenceMode, getLanguageLevel, getName, getParents, getProcessImports, index, initialize, isEnabled, isInitializationThreadAlive, isInitializationThreadCancelled, isOntologyLoaded, isSearchEnabled, loadModel, loadModelFromStream, loadTermsInNameSpace, setAdditionalPropertyUris, setExcludedWordsFromStemming, setInferenceMode, setLanguageLevel, setProcessImports, setSearchEnabled, startInitializationThread, toString, waitForInitializationThread
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ubic.basecode.ontology.providers.OntologyService
cancelInitializationThread, findIndividuals, findIndividuals, findResources, findResources, findTerm, findUsingAlternativeId, getAdditionalPropertyUris, getAllURIs, getChildren, getChildren, getDescription, getExcludedWordsFromStemming, getInferenceMode, getLanguageLevel, getName, getParents, getParents, getProcessImports, index, initialize, isEnabled, isInitializationThreadAlive, isInitializationThreadCancelled, isOntologyLoaded, isSearchEnabled, loadTermsInNameSpace, setAdditionalPropertyUris, setExcludedWordsFromStemming, setInferenceMode, setLanguageLevel, setProcessImports, setSearchEnabled, startInitializationThread, waitForInitializationThread
-
-
-
-
Method Detail
-
getOntologyName
protected String getOntologyName()
- Specified by:
getOntologyNamein classAbstractOntologyService
-
getOntologyUrl
protected String getOntologyUrl()
- Specified by:
getOntologyUrlin classAbstractOntologyService
-
isOntologyEnabled
protected boolean isOntologyEnabled()
- Specified by:
isOntologyEnabledin classAbstractOntologyService
-
getCacheName
@Nullable protected String getCacheName()
- Specified by:
getCacheNamein classAbstractOntologyService
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
calculateGoTermOverlap
public Map<Long,Collection<OntologyTerm>> calculateGoTermOverlap(Gene queryGene, Collection<Long> geneIds)
Description copied from interface:GeneOntologyServiceGiven a query Gene, and a collection of gene ids calculates the go term overlap for each pair of queryGene and gene in the given collection. Returns a Map<Gene,Collection<OntologyEntries>>. The key is the gene (from the [queryGene,gene] pair) and the values are a collection of the overlapping ontology entries.
- Specified by:
calculateGoTermOverlapin interfaceGeneOntologyService- Parameters:
queryGene- query genegeneIds- gene ids- Returns:
- map of gene ids to collections of ontologyTerms. This will always be populated but collection values will be empty when there is no overlap.
-
calculateGoTermOverlap
public Collection<OntologyTerm> calculateGoTermOverlap(Gene queryGene1, Gene queryGene2)
- Specified by:
calculateGoTermOverlapin interfaceGeneOntologyService- Parameters:
queryGene1- query gene 1queryGene2- query gene 2- Returns:
- Collection>OntologyEntries<s
-
calculateGoTermOverlap
public Map<Long,Collection<OntologyTerm>> calculateGoTermOverlap(Long queryGene, Collection<Long> geneIds)
- Specified by:
calculateGoTermOverlapin interfaceGeneOntologyService
-
computeOverlap
public Collection<OntologyTerm> computeOverlap(Collection<OntologyTerm> masterTerms, Collection<OntologyTerm> comparisonTerms)
- Specified by:
computeOverlapin interfaceGeneOntologyService
-
findTerm
public Collection<OntologySearchResult<OntologyTerm>> findTerm(String queryString, int maxResults) throws OntologySearchException
- Specified by:
findTermin interfaceOntologyService- Throws:
OntologySearchException
-
getAllParents
public Set<OntologyTerm> getAllParents(Collection<OntologyTerm> entries)
- Specified by:
getAllParentsin interfaceGeneOntologyService- Parameters:
entries- NOTE terms that are in this collection are NOT explicitly included; however, some of them may be included incidentally if they are parents of other terms in the collection.- Returns:
- ontology terms
-
getAllParents
public Set<OntologyTerm> getAllParents(Collection<OntologyTerm> entries, boolean includePartOf)
- Specified by:
getAllParentsin interfaceGeneOntologyService
-
getResource
public OntologyResource getResource(String goId)
Description copied from interface:GeneOntologyServiceRetrieve a GO resource by ID or URI.- Specified by:
getResourcein interfaceGeneOntologyService- Specified by:
getResourcein interfaceOntologyService- Overrides:
getResourcein classAbstractOntologyService
-
getTerm
public OntologyTerm getTerm(String goId)
Description copied from interface:GeneOntologyServiceRetrieve a GO term by ID or URI.- Specified by:
getTermin interfaceGeneOntologyService- Specified by:
getTermin interfaceOntologyService- Overrides:
getTermin classAbstractOntologyService
-
getTermIndividuals
public Collection<OntologyIndividual> getTermIndividuals(String goId)
Description copied from interface:GeneOntologyServiceRetrieve a GO individuals by ID or URI.- Specified by:
getTermIndividualsin interfaceGeneOntologyService- Specified by:
getTermIndividualsin interfaceOntologyService- Overrides:
getTermIndividualsin classAbstractOntologyService
-
getGenes
public Collection<Gene> getGenes(OntologyTerm term, @Nullable Taxon taxon)
Description copied from interface:GeneOntologyServiceFind genes for a given of GO term.- Specified by:
getGenesin interfaceGeneOntologyService- Returns:
- Collection of all genes in the given taxon that are annotated with the given id, including its child terms in the hierarchy, or null if the GO term is not found
-
getGenes
public Collection<Gene> getGenes(String goId, @Nullable Taxon taxon)
Description copied from interface:GeneOntologyServiceFind genes for a given GO term by GO ID.- Specified by:
getGenesin interfaceGeneOntologyService- Parameters:
goId- a GO ID (i.e. GO:000001) or URI- See Also:
GeneOntologyService.getGenes(OntologyTerm, Taxon)
-
getGOTerms
public Collection<OntologyTerm> getGOTerms(Gene gene)
- Specified by:
getGOTermsin interfaceGeneOntologyService- Parameters:
gene- Take a gene and return a set of all GO terms including the parents of each GO term- Returns:
- ontology terms
-
getGOTerms
public Collection<OntologyTerm> getGOTerms(Gene gene, boolean includePartOf, @Nullable GeneOntologyServiceImpl.GOAspect goAspect)
Description copied from interface:GeneOntologyServiceGet all GO terms for a gene, including parents of terms via is-a relationships; and optionally also parents via part-of relationships.- Specified by:
getGOTermsin interfaceGeneOntologyService- Parameters:
gene- geneincludePartOf- include part ofgoAspect- limit only to the given aspect (pass null to use all)- Returns:
- ontology terms
-
getTermAspect
public GeneOntologyServiceImpl.GOAspect getTermAspect(Characteristic goId)
- Specified by:
getTermAspectin interfaceGeneOntologyService
-
getTermAspect
public GeneOntologyServiceImpl.GOAspect getTermAspect(String goId)
- Specified by:
getTermAspectin interfaceGeneOntologyService- Parameters:
goId- GO ID e.g. GO:0038128 or URI- Returns:
- aspect if found, null otherwise
-
getTermDefinition
public String getTermDefinition(String goId)
Description copied from interface:GeneOntologyServiceReturn a definition for a GO ID.- Specified by:
getTermDefinitionin interfaceGeneOntologyService- Parameters:
goId- e.g. GO:0094491 or URI- Returns:
- Definition or null if there is no definition.
-
getValueObject
public GeneOntologyTermValueObject getValueObject(OntologyTerm term)
Description copied from interface:GeneOntologyServiceConverts the given Ontology Term to a Gene Ontology Value Object.- Specified by:
getValueObjectin interfaceGeneOntologyService- Parameters:
term- the term to be converted.- Returns:
- value object representing the given term.
-
getValueObjects
public List<GeneOntologyTermValueObject> getValueObjects(Collection<OntologyTerm> terms)
Description copied from interface:GeneOntologyServiceConverts the given collection of Ontology Terms to Gene Ontology Value Objects.- Specified by:
getValueObjectsin interfaceGeneOntologyService- Parameters:
terms- the terms to be converted.- Returns:
- collection of value objects representing the given terms.
-
getValueObjects
public List<GeneOntologyTermValueObject> getValueObjects(Gene gene)
Description copied from interface:GeneOntologyServiceReturns GO Terms VOs for the given Gene.- Specified by:
getValueObjectsin interfaceGeneOntologyService- Parameters:
gene- the Gene to retrieve GO Terms for and convert them to VOs.- Returns:
- Gene Ontology VOs representing all GO Terms associated with the given gene.
-
isBiologicalProcess
public boolean isBiologicalProcess(OntologyTerm term)
- Specified by:
isBiologicalProcessin interfaceGeneOntologyService
-
clearCaches
public void clearCaches()
Description copied from interface:GeneOntologyServicePrimarily here for testing, to recover memory.- Specified by:
clearCachesin interfaceGeneOntologyService
-
initialize
public void initialize(InputStream stream, boolean forceIndexing)
- Specified by:
initializein interfaceOntologyService- Overrides:
initializein classAbstractOntologyService
-
-