Sleipnir
Public Member Functions
Sleipnir::IOntology Class Reference

Encapsulates a functional catalog/hierarchy/ontology such as GO, KEGG, or MIPS. More...

#include <annotation.h>

Inheritance diagram for Sleipnir::IOntology:
Sleipnir::COntologyKEGG Sleipnir::COntologyMIPS Sleipnir::COntologyOBO Sleipnir::COntologyMIPSPhenotypes

Public Member Functions

virtual const std::string & GetID () const =0
 Returns string identifier of the encapsulated ontology.
virtual size_t GetNodes () const =0
 Returns the number of nodes (terms) in the ontology.
virtual const std::string & GetID (size_t iTerm) const =0
 Returns the ontology-specific ID string of the requested term.
virtual const std::string & GetGloss (size_t iTerm) const =0
 Returns the ontology-specific description of the requested term.
virtual size_t GetParents (size_t iTerm) const =0
 Returns the number of parents of the requested term.
virtual size_t GetParent (size_t iTerm, size_t iParent) const =0
 Returns the ontology term index of the requested parent of the requested term.
virtual size_t GetChildren (size_t iTerm) const =0
 Returns the number of children of the requested term.
virtual size_t GetChild (size_t iTerm, size_t iChild) const =0
 Returns the ontology term index of the requested child of the requested term.
virtual bool GetParents (size_t iTerm, std::set< size_t > &setiParents) const =0
 Retrieves the parent term IDs of the requested term.
virtual bool GetChildren (size_t iTerm, std::set< size_t > &setiChildren) const =0
 Retrieves the descendant term IDs of the requested term.
virtual size_t GetGenes (size_t iTerm, bool fRecursive=false) const =0
 Returns the number of genes annotated to or (optionally) below this term.
virtual const CGeneGetGene (size_t iTerm, size_t iGene) const =0
 Returns the requested gene annotated to or below the given term.
virtual bool IsAnnotated (size_t iTerm, const CGene &Gene, bool fRecursive=true) const =0
 Indicates whether the given gene is annotated to or (optionally) below the given term.
virtual size_t GetNode (const std::string &strID) const =0
 Returns the ontology term index corresponding to the given ontology-specific ID string.
virtual void GetGeneNames (std::vector< std::string > &vecstrGenes) const =0
 Obtain the primary gene names for all genes in the ontology.
virtual void TermFinder (const CGenes &Genes, std::vector< STermFound > &vecsTerms, bool fBonferroni=true, bool fRecursive=true, bool fGenome=false, float dPValue=1, const CGenes *pBackground=NULL) const =0
 Uses the hypergeometric distribution to find functional enrichments of the given gene set.

Detailed Description

Encapsulates a functional catalog/hierarchy/ontology such as GO, KEGG, or MIPS.

IOntology provides a uniform interface able to capture ontological functional catalogs such as the Gene Ontology, hierarchical catalogs such as MIPS, and (essentially) flag functional groupings such as KEGG. IOntology's structure is modeled on GO's, being the most general: each term in the functional catalog has zero or more parents (more general terms), zero or more children (more specific terms), and zero or more directly annotated genes. A gene annotated to some term is also implicitly annotated to that term's ancestors.

See also:
COntologyKEGG | COntologyOBO | COntologyMIPS | COntologyMIPSPhenotypes | CSlim

Definition at line 117 of file annotation.h.


Member Function Documentation

virtual size_t Sleipnir::IOntology::GetChild ( size_t  iTerm,
size_t  iChild 
) const [pure virtual]

Returns the ontology term index of the requested child of the requested term.

Parameters:
iTermIndex of ontology term.
iChildChild to retrieve.
Returns:
Ontology term index of the requested child.
Remarks:
Requested child must be less than IOntology::GetChildren.

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.

virtual size_t Sleipnir::IOntology::GetChildren ( size_t  iTerm) const [pure virtual]

Returns the number of children of the requested term.

Parameters:
iTermIndex of ontology term.
Returns:
Number of children of the requested term.

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.

virtual bool Sleipnir::IOntology::GetChildren ( size_t  iTerm,
std::set< size_t > &  setiChildren 
) const [pure virtual]

Retrieves the descendant term IDs of the requested term.

Parameters:
iTermIndex of ontology term.
setiChildrenOutput set of descendant term IDs.
Returns:
True on success, false otherwise.
Remarks:
Operates recursively, returning all nodes between iTerm and the ontology leaves.
See also:
GetChildren | GetChild

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.

virtual const CGene& Sleipnir::IOntology::GetGene ( size_t  iTerm,
size_t  iGene 
) const [pure virtual]

Returns the requested gene annotated to or below the given term.

Parameters:
iTermOntology term index from which to retrieve gene.
iGeneIndex of gene within the requested term.
Returns:
Gene annotation at the requested index.
Remarks:
If iGene is less than the number of genes annotated directly to the term, a direct annotation is returned. Otherwise, descendant terms are searched and the requested gene index is retrieved from this set. iGene must be less than the value of IOntology::GetGenes.

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.

virtual void Sleipnir::IOntology::GetGeneNames ( std::vector< std::string > &  vecstrGenes) const [pure virtual]

Obtain the primary gene names for all genes in the ontology.

Parameters:
vecstrGenesOutputs primary gene names for all genes in the ontology.

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.

virtual size_t Sleipnir::IOntology::GetGenes ( size_t  iTerm,
bool  fRecursive = false 
) const [pure virtual]

Returns the number of genes annotated to or (optionally) below this term.

Parameters:
iTermOntology term index.
fRecursiveIf true, include gene annotations to descendant terms.
Returns:
Number of genes annotated to or below this term.

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.

virtual const std::string& Sleipnir::IOntology::GetGloss ( size_t  iTerm) const [pure virtual]

Returns the ontology-specific description of the requested term.

Parameters:
iTermIndex of ontology term.
Returns:
Ontology-specific description of the requested term (e.g. "mitotic cell cycle").

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.

virtual const std::string& Sleipnir::IOntology::GetID ( ) const [pure virtual]

Returns string identifier of the encapsulated ontology.

Returns:
String identifier of the ontology.

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.

virtual const std::string& Sleipnir::IOntology::GetID ( size_t  iTerm) const [pure virtual]

Returns the ontology-specific ID string of the requested term.

Parameters:
iTermIndex of ontology term.
Returns:
Ontology-specific ID of the requested term (e.g. "GO:0007093").

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.

virtual size_t Sleipnir::IOntology::GetNode ( const std::string &  strID) const [pure virtual]

Returns the ontology term index corresponding to the given ontology-specific ID string.

Parameters:
strIDOntology term ID to retrieve (e.g. "GO:0007093").
Returns:
The index of the requested term, -1 if not found.

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.

virtual size_t Sleipnir::IOntology::GetNodes ( ) const [pure virtual]

Returns the number of nodes (terms) in the ontology.

Returns:
Number of nodes (terms) in the ontology.

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.

virtual size_t Sleipnir::IOntology::GetParent ( size_t  iTerm,
size_t  iParent 
) const [pure virtual]

Returns the ontology term index of the requested parent of the requested term.

Parameters:
iTermIndex of ontology term.
iParentParent to retrieve.
Returns:
Ontology term index of the requested parent.
Remarks:
Requested parent must be less than IOntology::GetParents.

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.

virtual size_t Sleipnir::IOntology::GetParents ( size_t  iTerm) const [pure virtual]

Returns the number of parents of the requested term.

Parameters:
iTermIndex of ontology term.
Returns:
Number of parents of the requested term.

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.

virtual bool Sleipnir::IOntology::GetParents ( size_t  iTerm,
std::set< size_t > &  setiParents 
) const [pure virtual]

Retrieves the parent term IDs of the requested term.

Parameters:
iTermIndex of ontology term.
setiParentsOutput set of parent term IDs.
Returns:
True on success, false otherwise.
Remarks:
Operates recursively, returning all nodes between iTerm and the ontology root.
See also:
GetParents | GetParent

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.

virtual bool Sleipnir::IOntology::IsAnnotated ( size_t  iTerm,
const CGene Gene,
bool  fRecursive = true 
) const [pure virtual]

Indicates whether the given gene is annotated to or (optionally) below the given term.

Parameters:
iTermOntology term index.
GeneGene for which annotation is tested.
fRecursiveIf true, include annotations to descendants of the given term.
Returns:
True if the given gene is annotated to or (optionally) below the given term.

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.

Referenced by Sleipnir::CGenes::CountAnnotations().

virtual void Sleipnir::IOntology::TermFinder ( const CGenes Genes,
std::vector< STermFound > &  vecsTerms,
bool  fBonferroni = true,
bool  fRecursive = true,
bool  fGenome = false,
float  dPValue = 1,
const CGenes pBackground = NULL 
) const [pure virtual]

Uses the hypergeometric distribution to find functional enrichments of the given gene set.

Parameters:
GenesGene set to test for functional enrichments.
vecsTermsOutput statistics for the given genes over all terms in the ontology.
fBonferroniIf true, p-values are Bonferroni corrected.
fRecursiveIf true, annotations to descendants are used when calculating term overlaps.
fGenomeIf true, use all genes in the genome as background; otherwise, use only genes with at least one annotation in the ontology.
dPValueOnly terms significant below this p-value will be recorded.
pBackgroundIf non-null, use the given gene set as the background.

TermFinder uses the GO::TermFinder technique of Boyle, Sherlock, et al to calculate ontology terms (i.e. functions) enriched in the given gene set. This involves significance testing the overlap of the given gene set with annotations to every ontology term using the hypergeometric test.

Implemented in Sleipnir::COntologyMIPS, Sleipnir::COntologyOBO, and Sleipnir::COntologyKEGG.


The documentation for this class was generated from the following file: