Sleipnir
|
Implements IOntology for the KEGG orthology. More...
#include <annotation.h>
Public Member Functions | |
bool | Open (std::istream &istm, CGenome &Genome, const std::string &strOrganism, bool fSynonyms=false) |
Initializes the ontology using a KEGG "ko" file. | |
void | GetGeneNames (std::vector< std::string > &vecstrGenes) const |
Obtain the primary gene names for all genes in the ontology. | |
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 |
Uses the hypergeometric distribution to find functional enrichments of the given gene set. | |
size_t | GetNode (const std::string &strID) const |
Returns the ontology term index corresponding to the given ontology-specific ID string. | |
bool | IsAnnotated (size_t iTerm, const CGene &Gene, bool fRecursive) const |
Indicates whether the given gene is annotated to or (optionally) below the given term. | |
size_t | GetNodes () const |
Returns the number of nodes (terms) in the ontology. | |
const std::string & | GetID () const |
Returns string identifier of the encapsulated ontology. | |
const std::string & | GetID (size_t iTerm) const |
Returns the ontology-specific ID string of the requested term. | |
const std::string & | GetGloss (size_t iTerm) const |
Returns the ontology-specific description of the requested term. | |
size_t | GetParents (size_t iTerm) const |
Returns the number of parents of the requested term. | |
size_t | GetParent (size_t iTerm, size_t iParent) const |
Returns the ontology term index of the requested parent of the requested term. | |
size_t | GetChildren (size_t iTerm) const |
Returns the number of children of the requested term. | |
size_t | GetChild (size_t iTerm, size_t iChild) const |
Returns the ontology term index of the requested child of the requested term. | |
size_t | GetGenes (size_t iTerm, bool fRecursive) const |
Returns the number of genes annotated to or (optionally) below this term. | |
const CGene & | GetGene (size_t iTerm, size_t iGene) const |
Returns the requested gene annotated to or below the given term. | |
bool | GetParents (size_t iTerm, std::set< size_t > &setiParents) const |
Retrieves the parent term IDs of the requested term. | |
bool | GetChildren (size_t iTerm, std::set< size_t > &setiChildren) const |
Retrieves the descendant term IDs of the requested term. |
Implements IOntology for the KEGG orthology.
COntologyKEGG parses the "ko" file from the Kyoto Encyclopedia of Genes and Genomes to extract organism-independent function annotations from KEGG.
Definition at line 367 of file annotation.h.
size_t Sleipnir::COntologyKEGG::GetChild | ( | size_t | iTerm, |
size_t | iChild | ||
) | const [inline, virtual] |
Returns the ontology term index of the requested child of the requested term.
iTerm | Index of ontology term. |
iChild | Child to retrieve. |
Implements Sleipnir::IOntology.
Definition at line 419 of file annotation.h.
size_t Sleipnir::COntologyKEGG::GetChildren | ( | size_t | iTerm | ) | const [inline, virtual] |
Returns the number of children of the requested term.
iTerm | Index of ontology term. |
Implements Sleipnir::IOntology.
Definition at line 415 of file annotation.h.
Referenced by GetChildren().
bool Sleipnir::COntologyKEGG::GetChildren | ( | size_t | iTerm, |
std::set< size_t > & | setiChildren | ||
) | const [inline, virtual] |
Retrieves the descendant term IDs of the requested term.
iTerm | Index of ontology term. |
setiChildren | Output set of descendant term IDs. |
Implements Sleipnir::IOntology.
Definition at line 435 of file annotation.h.
References GetChildren().
const CGene& Sleipnir::COntologyKEGG::GetGene | ( | size_t | iTerm, |
size_t | iGene | ||
) | const [inline, 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. |
Implements Sleipnir::IOntology.
Definition at line 427 of file annotation.h.
void Sleipnir::COntologyKEGG::GetGeneNames | ( | std::vector< std::string > & | vecstrGenes | ) | const [inline, virtual] |
Obtain the primary gene names for all genes in the ontology.
vecstrGenes | Outputs primary gene names for all genes in the ontology. |
Implements Sleipnir::IOntology.
Definition at line 372 of file annotation.h.
size_t Sleipnir::COntologyKEGG::GetGenes | ( | size_t | iTerm, |
bool | fRecursive | ||
) | const [inline, 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. |
Implements Sleipnir::IOntology.
Definition at line 423 of file annotation.h.
const std::string& Sleipnir::COntologyKEGG::GetGloss | ( | size_t | iTerm | ) | const [inline, virtual] |
Returns the ontology-specific description of the requested term.
iTerm | Index of ontology term. |
Implements Sleipnir::IOntology.
Definition at line 403 of file annotation.h.
const std::string& Sleipnir::COntologyKEGG::GetID | ( | ) | const [inline, virtual] |
Returns string identifier of the encapsulated ontology.
Implements Sleipnir::IOntology.
Definition at line 395 of file annotation.h.
Referenced by GetID().
const std::string& Sleipnir::COntologyKEGG::GetID | ( | size_t | iTerm | ) | const [inline, virtual] |
Returns the ontology-specific ID string of the requested term.
iTerm | Index of ontology term. |
Implements Sleipnir::IOntology.
Definition at line 399 of file annotation.h.
References GetID().
size_t Sleipnir::COntologyKEGG::GetNode | ( | const std::string & | strID | ) | const [inline, virtual] |
Returns the ontology term index corresponding to the given ontology-specific ID string.
strID | Ontology term ID to retrieve (e.g. "GO:0007093"). |
Implements Sleipnir::IOntology.
Definition at line 383 of file annotation.h.
size_t Sleipnir::COntologyKEGG::GetNodes | ( | ) | const [inline, virtual] |
Returns the number of nodes (terms) in the ontology.
Implements Sleipnir::IOntology.
Definition at line 391 of file annotation.h.
size_t Sleipnir::COntologyKEGG::GetParent | ( | size_t | iTerm, |
size_t | iParent | ||
) | const [inline, virtual] |
Returns the ontology term index of the requested parent of the requested term.
iTerm | Index of ontology term. |
iParent | Parent to retrieve. |
Implements Sleipnir::IOntology.
Definition at line 411 of file annotation.h.
size_t Sleipnir::COntologyKEGG::GetParents | ( | size_t | iTerm | ) | const [inline, virtual] |
Returns the number of parents of the requested term.
iTerm | Index of ontology term. |
Implements Sleipnir::IOntology.
Definition at line 407 of file annotation.h.
Referenced by GetParents().
bool Sleipnir::COntologyKEGG::GetParents | ( | size_t | iTerm, |
std::set< size_t > & | setiParents | ||
) | const [inline, virtual] |
Retrieves the parent term IDs of the requested term.
iTerm | Index of ontology term. |
setiParents | Output set of parent term IDs. |
Implements Sleipnir::IOntology.
Definition at line 431 of file annotation.h.
References GetParents().
bool Sleipnir::COntologyKEGG::IsAnnotated | ( | size_t | iTerm, |
const CGene & | Gene, | ||
bool | fRecursive | ||
) | const [inline, 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. |
Implements Sleipnir::IOntology.
Definition at line 387 of file annotation.h.
bool Sleipnir::COntologyKEGG::Open | ( | std::istream & | istm, |
CGenome & | Genome, | ||
const std::string & | strOrganism, | ||
bool | fSynonyms = false |
||
) |
Initializes the ontology using a KEGG "ko" file.
istm | Stream from which ko file is read. |
Genome | Genome into which genes are inserted or read during annotation parsing. |
strOrganism | Organism identifier for which annotations should be read (e.g. "SCE" or "HSA"). |
fSynonyms | If true, use the first ko synonym (when present) as the primary gene name; otherwise, use the ko file's gene identifier. |
Given an input stream containing a ko file from the KEGG orthology, COntologyKEGG::Open parses both the structure of KEGG (usually a flat set of non-hierarchical pathways) and the genes annotated to each KEGG term. Terms are identified by KEGG IDs (e.g. "ko00624"), and genes are identified by the ko ID or first synonym as specified by the fSynonyms parameter. Genes are retrieved from Genome if already present or inserted if not; it is thus important to ensure that the proper primary gene names are used so as to agree with any identifiers already present in Genome.
Definition at line 69 of file annotationkegg.cpp.
References Sleipnir::CGene::AddAnnotation().
void Sleipnir::COntologyKEGG::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 [inline, 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.
Implements Sleipnir::IOntology.
Definition at line 376 of file annotation.h.