Class GeneOntologyServiceImpl
- java.lang.Object
- 
- ubic.basecode.ontology.jena.AbstractOntologyService
- 
- ubic.basecode.ontology.providers.AbstractOntologyService
- 
- ubic.gemma.core.ontology.providers.GeneOntologyServiceImpl
 
 
 
- 
- All Implemented Interfaces:
- InitializingBean,- OntologyService,- GeneOntologyService
 
 @Service @ParametersAreNonnullByDefault public class GeneOntologyServiceImpl extends AbstractOntologyService implements GeneOntologyService, InitializingBean - Author:
- pavlidis
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classGeneOntologyServiceImpl.GOAspect- 
Nested classes/interfaces inherited from interface ubic.basecode.ontology.providers.OntologyServiceOntologyService.InferenceMode, OntologyService.LanguageLevel
 
- 
 - 
Field Summary- 
Fields inherited from interface ubic.gemma.core.ontology.providers.GeneOntologyServiceBASE_GO_URI
 
- 
 - 
Constructor SummaryConstructors Constructor Description GeneOntologyServiceImpl()
 - 
Method SummaryAll 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()GeneOntologyServiceImpl.GOAspectgetTermAspect(String goId)GeneOntologyServiceImpl.GOAspectgetTermAspect(Characteristic goId)StringgetTermDefinition(String goId)Return a definition for a GO Id.OntologyTermgetTermForId(String goId)StringgetTermName(String goId)Return human-readable term ("protein kinase") for a GO Id.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.AbstractOntologyServicecancelInitializationThread, findIndividuals, findResources, findTerm, findUsingAlternativeId, getAdditionalPropertyUris, getAllURIs, getChildren, getDescription, getExcludedWordsFromStemming, getInferenceMode, getLanguageLevel, getName, getParents, getProcessImports, getResource, getTerm, getTermIndividuals, 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface ubic.gemma.core.ontology.providers.GeneOntologyServicegetTerm
 - 
Methods inherited from interface ubic.basecode.ontology.providers.OntologyServicecancelInitializationThread, findIndividuals, findIndividuals, findResources, findResources, findTerm, findUsingAlternativeId, getAdditionalPropertyUris, getAllURIs, getChildren, getChildren, getDescription, getExcludedWordsFromStemming, getInferenceMode, getLanguageLevel, getName, getParents, getParents, getProcessImports, getResource, getTermIndividuals, index, initialize, isEnabled, isInitializationThreadAlive, isInitializationThreadCancelled, isOntologyLoaded, isSearchEnabled, loadTermsInNameSpace, setAdditionalPropertyUris, setExcludedWordsFromStemming, setInferenceMode, setLanguageLevel, setProcessImports, setSearchEnabled, startInitializationThread, waitForInitializationThread
 
- 
 
- 
- 
- 
Method Detail- 
getOntologyNameprotected String getOntologyName() - Specified by:
- getOntologyNamein class- AbstractOntologyService
 
 - 
getOntologyUrlprotected String getOntologyUrl() - Specified by:
- getOntologyUrlin class- AbstractOntologyService
 
 - 
isOntologyEnabledprotected boolean isOntologyEnabled() - Specified by:
- isOntologyEnabledin class- AbstractOntologyService
 
 - 
getCacheName@Nullable protected String getCacheName() - Specified by:
- getCacheNamein class- AbstractOntologyService
 
 - 
afterPropertiesSetpublic void afterPropertiesSet() - Specified by:
- afterPropertiesSetin interface- InitializingBean
 
 - 
calculateGoTermOverlappublic 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 interface- GeneOntologyService
- Parameters:
- queryGene- query gene
- geneIds- 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.
 
 - 
calculateGoTermOverlappublic Collection<OntologyTerm> calculateGoTermOverlap(Gene queryGene1, Gene queryGene2) - Specified by:
- calculateGoTermOverlapin interface- GeneOntologyService
- Parameters:
- queryGene1- query gene 1
- queryGene2- query gene 2
- Returns:
- Collection>OntologyEntries<s
 
 - 
calculateGoTermOverlappublic Map<Long,Collection<OntologyTerm>> calculateGoTermOverlap(Long queryGene, Collection<Long> geneIds) - Specified by:
- calculateGoTermOverlapin interface- GeneOntologyService
 
 - 
computeOverlappublic Collection<OntologyTerm> computeOverlap(Collection<OntologyTerm> masterTerms, Collection<OntologyTerm> comparisonTerms) - Specified by:
- computeOverlapin interface- GeneOntologyService
 
 - 
findTermpublic Collection<OntologySearchResult<OntologyTerm>> findTerm(String queryString, int maxResults) throws OntologySearchException - Specified by:
- findTermin interface- OntologyService
- Throws:
- OntologySearchException
 
 - 
getAllParentspublic Set<OntologyTerm> getAllParents(Collection<OntologyTerm> entries) - Specified by:
- getAllParentsin interface- GeneOntologyService
- 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
 
 - 
getAllParentspublic Set<OntologyTerm> getAllParents(Collection<OntologyTerm> entries, boolean includePartOf) - Specified by:
- getAllParentsin interface- GeneOntologyService
 
 - 
getGenespublic Collection<Gene> getGenes(OntologyTerm term, @Nullable Taxon taxon) Description copied from interface:GeneOntologyServiceFind genes for a given of GO term.- Specified by:
- getGenesin interface- GeneOntologyService
- 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
 
 - 
getGenespublic 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 interface- GeneOntologyService
- See Also:
- GeneOntologyService.getGenes(OntologyTerm, Taxon)
 
 - 
getGOTermspublic Collection<OntologyTerm> getGOTerms(Gene gene) - Specified by:
- getGOTermsin interface- GeneOntologyService
- Parameters:
- gene- Take a gene and return a set of all GO terms including the parents of each GO term
- Returns:
- ontology terms
 
 - 
getGOTermspublic 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 interface- GeneOntologyService
- Parameters:
- gene- gene
- includePartOf- include part of
- goAspect- limit only to the given aspect (pass null to use all)
- Returns:
- ontology terms
 
 - 
getTermAspectpublic GeneOntologyServiceImpl.GOAspect getTermAspect(Characteristic goId) - Specified by:
- getTermAspectin interface- GeneOntologyService
 
 - 
getTermAspectpublic GeneOntologyServiceImpl.GOAspect getTermAspect(String goId) - Specified by:
- getTermAspectin interface- GeneOntologyService
- Parameters:
- goId- GO ID e.g. GO:0038128 (not URI)
- Returns:
- aspect if found, null otherwise
 
 - 
getTermDefinitionpublic String getTermDefinition(String goId) Description copied from interface:GeneOntologyServiceReturn a definition for a GO Id.- Specified by:
- getTermDefinitionin interface- GeneOntologyService
- Parameters:
- goId- e.g. GO:0094491
- Returns:
- Definition or null if there is no definition.
 
 - 
getTermForIdpublic OntologyTerm getTermForId(String goId) - Specified by:
- getTermForIdin interface- GeneOntologyService
- Parameters:
- goId- e.g. GO_0001312
- Returns:
- null if not found
 
 - 
getTermNamepublic String getTermName(String goId) Description copied from interface:GeneOntologyServiceReturn human-readable term ("protein kinase") for a GO Id.- Specified by:
- getTermNamein interface- GeneOntologyService
- Parameters:
- goId- go id
- Returns:
- term name
 
 - 
getValueObjectpublic GeneOntologyTermValueObject getValueObject(OntologyTerm term) Description copied from interface:GeneOntologyServiceConverts the given Ontology Term to a Gene Ontology Value Object.- Specified by:
- getValueObjectin interface- GeneOntologyService
- Parameters:
- term- the term to be converted.
- Returns:
- value object representing the given term.
 
 - 
getValueObjectspublic 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 interface- GeneOntologyService
- Parameters:
- terms- the terms to be converted.
- Returns:
- collection of value objects representing the given terms.
 
 - 
getValueObjectspublic List<GeneOntologyTermValueObject> getValueObjects(Gene gene) Description copied from interface:GeneOntologyServiceReturns GO Terms VOs for the given Gene.- Specified by:
- getValueObjectsin interface- GeneOntologyService
- 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.
 
 - 
isBiologicalProcesspublic boolean isBiologicalProcess(OntologyTerm term) - Specified by:
- isBiologicalProcessin interface- GeneOntologyService
 
 - 
clearCachespublic void clearCaches() Description copied from interface:GeneOntologyServicePrimarily here for testing, to recover memory.- Specified by:
- clearCachesin interface- GeneOntologyService
 
 - 
initializepublic void initialize(InputStream stream, boolean forceIndexing) - Specified by:
- initializein interface- OntologyService
- Overrides:
- initializein class- AbstractOntologyService
 
 
- 
 
-