Sleipnir
|
Encapsulates a functional catalog/hierarchy/ontology such as GO, KEGG, or MIPS. More...
#include <annotation.h>
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 CGene & | GetGene (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. |
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.
Definition at line 117 of file annotation.h.
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.
iTerm | Index of ontology term. |
iChild | Child to retrieve. |
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.
iTerm | Index of ontology 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.
iTerm | Index of ontology term. |
setiChildren | Output set of descendant term IDs. |
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.
iTerm | Ontology term index from which to retrieve gene. |
iGene | Index of gene within the requested term. |
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.
vecstrGenes | Outputs 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.
iTerm | Ontology term index. |
fRecursive | If true, include gene annotations to descendant terms. |
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.
iTerm | Index of ontology term. |
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.
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.
iTerm | Index of ontology term. |
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.
strID | Ontology term ID to retrieve (e.g. "GO:0007093"). |
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.
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.
iTerm | Index of ontology term. |
iParent | Parent to retrieve. |
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.
iTerm | Index of ontology 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.
iTerm | Index of ontology term. |
setiParents | Output set of parent term IDs. |
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.
iTerm | Ontology term index. |
Gene | Gene for which annotation is tested. |
fRecursive | If true, include annotations to descendants of 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.
Genes | Gene set to test for functional enrichments. |
vecsTerms | Output statistics for the given genes over all terms in the ontology. |
fBonferroni | If true, p-values are Bonferroni corrected. |
fRecursive | If true, annotations to descendants are used when calculating term overlaps. |
fGenome | If true, use all genes in the genome as background; otherwise, use only genes with at least one annotation in the ontology. |
dPValue | Only terms significant below this p-value will be recorded. |
pBackground | If 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.