Sleipnir
|
Implements IOntology for OBO based Ontologies. More...
#include <annotation.h>
Public Member Functions | |
bool | Open (std::istream &istmOntology, std::istream &istmAnnotations, CGenome &Genome, const char *szNamespace, bool fDatabaseIDs=false, bool fSynonyms=false) |
Initializes the ontology from one aspect of the Gene Ontology using OBO structure and GO annotation files. | |
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. | |
Static Public Member Functions | |
static bool | Open (std::istream &istmOntology, std::istream &istmAnnotations, CGenome &Genome, COntologyOBO &OntoBP, COntologyOBO &OntoMF, COntologyOBO &OntoCC, bool fDatabaseIDs=false, bool fSynonyms=false) |
Initializes three aspects of the Gene Ontology using OBO structure and GO annotation files. | |
Static Public Attributes | |
static const char | c_szBiologicalProcess [] = "biological_process" |
Common Gene Ontology aspects/namespaces: biological process. | |
static const char | c_szCellularComponent [] = "cellular_component" |
Common Gene Ontology aspects/namespaces: cellular component. | |
static const char | c_szMolecularFunction [] = "molecular_function" |
Common Gene Ontology aspects/namespaces: molecular function. |
Implements IOntology for OBO based Ontologies.
COntologyOBO parses OBO and annotation files to obtain the structure and annotations for OBO ontologies.
Definition at line 447 of file annotation.h.
size_t Sleipnir::COntologyOBO::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 520 of file annotation.h.
size_t Sleipnir::COntologyOBO::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 516 of file annotation.h.
Referenced by GetChildren().
bool Sleipnir::COntologyOBO::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 536 of file annotation.h.
References GetChildren().
const CGene& Sleipnir::COntologyOBO::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 528 of file annotation.h.
void Sleipnir::COntologyOBO::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 473 of file annotation.h.
size_t Sleipnir::COntologyOBO::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 524 of file annotation.h.
const std::string& Sleipnir::COntologyOBO::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 504 of file annotation.h.
const std::string& Sleipnir::COntologyOBO::GetID | ( | ) | const [inline, virtual] |
Returns string identifier of the encapsulated ontology.
Implements Sleipnir::IOntology.
Definition at line 496 of file annotation.h.
Referenced by GetID().
const std::string& Sleipnir::COntologyOBO::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 500 of file annotation.h.
References GetID().
size_t Sleipnir::COntologyOBO::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 484 of file annotation.h.
size_t Sleipnir::COntologyOBO::GetNodes | ( | ) | const [inline, virtual] |
Returns the number of nodes (terms) in the ontology.
Implements Sleipnir::IOntology.
Definition at line 492 of file annotation.h.
size_t Sleipnir::COntologyOBO::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 512 of file annotation.h.
size_t Sleipnir::COntologyOBO::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 508 of file annotation.h.
Referenced by GetParents().
bool Sleipnir::COntologyOBO::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 532 of file annotation.h.
References GetParents().
bool Sleipnir::COntologyOBO::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 488 of file annotation.h.
bool Sleipnir::COntologyOBO::Open | ( | std::istream & | istmOntology, |
std::istream & | istmAnnotations, | ||
CGenome & | Genome, | ||
COntologyOBO & | OntoBP, | ||
COntologyOBO & | OntoMF, | ||
COntologyOBO & | OntoCC, | ||
bool | fDatabaseIDs = false , |
||
bool | fSynonyms = false |
||
) | [static] |
Initializes three aspects of the Gene Ontology using OBO structure and GO annotation files.
istmOntology | Stream from which OBO structure file is read. |
istmAnnotations | Stream from which gene annotation file is read. |
Genome | Genome into which genes are inserted or read during annotation parsing. |
OntoBP | Ontology initialized with GO's biological process aspect. |
OntoMF | Ontology initialized with GO's molecular function aspect. |
OntoCC | Ontology initialized with GO's cellular compartment aspect. |
fDatabaseIDs | If true, use annotation database IDs as primary gene names. |
fSynonyms | If true, use first gene synonym (if present) as primary gene names. |
Equivalent to calling COntologyOBO::Open three times for the three GO aspects.
Definition at line 94 of file annotationobo.cpp.
References c_szBiologicalProcess, c_szCellularComponent, c_szMolecularFunction, and Open().
Referenced by Open().
bool Sleipnir::COntologyOBO::Open | ( | std::istream & | istmOntology, |
std::istream & | istmAnnotations, | ||
CGenome & | Genome, | ||
const char * | szNamespace, | ||
bool | fDatabaseIDs = false , |
||
bool | fSynonyms = false |
||
) |
Initializes the ontology from one aspect of the Gene Ontology using OBO structure and GO annotation files.
istmOntology | Stream from which OBO structure file is read. |
istmAnnotations | Stream from which gene annotation file is read. |
Genome | Genome into which genes are inserted or read during annotation parsing. |
szNamespace | Aspect (namespace) of GO to use for this ontology. |
fDatabaseIDs | If true, use annotation database IDs as primary gene names. |
fSynonyms | If true, use first gene synonym (if present) as primary gene names. |
COntologyOBO::Open parses the structure of one aspect of the Gene Ontology from the given (organism-independent) OBO file and obtains gene annotations from the given (organism-specific) annotation file. Terms are identified by GO IDs (e.g. "GO:0007093"), and genes are identified by the annotation name, first synonym, or database ID as specified by the fSynonyms and fDatabaseIDs parameters. 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 156 of file annotationobo.cpp.
void Sleipnir::COntologyOBO::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 477 of file annotation.h.