Sleipnir
|
Represents a gene with a single primary unique identifier, zero or more synonyms, and zero or more functional annotations. More...
#include <genome.h>
Public Member Functions | |
CGene (const std::string &strID) | |
Create a new gene with the given primary identifier. | |
bool | AddSynonym (const std::string &strName) |
Appends the given synonym to the gene's synonym list. | |
bool | AddAnnotation (const IOntology *pOntology, size_t iTerm) |
Adds an annotation in the gene object to a specific functional ontology term. | |
bool | SetWeight (float weight) |
bool | IsAnnotated (const IOntology *pOntology) const |
Return true if the gene is annotated within the given ontology. | |
bool | IsAnnotated (const IOntology *pOntology, size_t iTerm) const |
Return true if the gene is directly annotated to the given ontology term. | |
const std::string & | GetName () const |
Return the gene's primary identifier. | |
size_t | GetSynonyms () const |
Return the number of synonyms of the current gene. | |
const std::string & | GetSynonym (size_t iSynonym) const |
Return the requested synonym of the current gene. | |
void | SetGloss (const std::string &strGloss) |
Sets the human-readable text description of the gene. | |
const std::string & | GetGloss () const |
Return the human-readable text description of the gene. | |
void | SetDubious (bool fDubious) |
Sets whether the gene encodes a dubious reading frame. | |
bool | GetDubious () const |
Return whether the gene encodes a dubious reading frame. | |
void | SetRNA (bool fRNA) |
Sets whether the gene encodes an RNA gene. | |
bool | GetRNA () const |
Return whether the gene encodes an RNA gene. | |
const float | GetWeight () const |
Return weight of the gene. | |
size_t | GetOntologies () const |
Return the number of different ontologies in which this gene is annotated. | |
const IOntology * | GetOntology (size_t iOntology) const |
Return the ontology at the requested index. | |
size_t | GetAnnotations (size_t iOntology) const |
Return the number of annotations of this gene within the requested ontology. | |
size_t | GetAnnotation (size_t iOntology, size_t iAnnotation) const |
Return the ontology term index of the requested annotation. |
Represents a gene with a single primary unique identifier, zero or more synonyms, and zero or more functional annotations.
Uniquely identifying genes is a daunting task in many organisms; in yeast, almost every gene has a single transcript, a single protein, a single systematic name, and at most a few common names. In higher organisms, multiple transcripts, multiple naming schemes, and a lack of standards make consistent gene identification nearly impossible.
Fortunately or unfortunately, Sleipnir ignores most of this complexity. A Sleipnir gene consists of at least one unique systematic name - but that's it. A gene's primary identifier should be unique within its genome, and it can have zero or more (optionally unique) synonyms; CGenome does its best to disambiguate overlapping synonyms, but the primary identifier must be unique within a gene set of interest.
Each gene can also have an optional textual description (gloss), zero or more functional annotations tying it to IOntology objects, and reflective of Sleipnir's roots in yeast biology, genes can also be decorated with a few features indicating whether they encode dubious ORFs or RNA genes.
Sleipnir::CGene::CGene | ( | const std::string & | strID | ) |
Create a new gene with the given primary identifier.
strID | Unique primary identifier of the new gene. |
Definition at line 39 of file genome.cpp.
bool Sleipnir::CGene::AddAnnotation | ( | const IOntology * | pOntology, |
size_t | iTerm | ||
) |
Adds an annotation in the gene object to a specific functional ontology term.
pOntology | Ontology into which the gene should be annotated. |
iTerm | Ontology term to which the gene should be annotated. |
Adds an annotation directly to the current gene based on the given ontology and functional term. This is usually called from from the appropriate IOntology implementation during parsing and is used to provide a local cache of direct annotations to the gene object.
Definition at line 100 of file genome.cpp.
Referenced by Sleipnir::COntologyKEGG::Open().
bool Sleipnir::CGene::AddSynonym | ( | const std::string & | strName | ) |
Appends the given synonym to the gene's synonym list.
strName | Synonym to be added. |
Definition at line 198 of file genome.cpp.
Referenced by Sleipnir::CGenome::AddSynonym().
size_t Sleipnir::CGene::GetAnnotation | ( | size_t | iOntology, |
size_t | iAnnotation | ||
) | const [inline] |
Return the ontology term index of the requested annotation.
iOntology | Ontology index of requested annotation. |
iAnnotation | Requested annotation index. |
size_t Sleipnir::CGene::GetAnnotations | ( | size_t | iOntology | ) | const [inline] |
Return the number of annotations of this gene within the requested ontology.
iOntology | Ontology whose annotations should be counted. |
bool Sleipnir::CGene::GetDubious | ( | ) | const [inline] |
Return whether the gene encodes a dubious reading frame.
const std::string& Sleipnir::CGene::GetGloss | ( | ) | const [inline] |
Return the human-readable text description of the gene.
Definition at line 137 of file genome.h.
Referenced by Sleipnir::CDat::SaveMATISSE().
const std::string& Sleipnir::CGene::GetName | ( | ) | const [inline] |
Return the gene's primary identifier.
Definition at line 78 of file genome.h.
Referenced by Sleipnir::CGenome::AddSynonym(), Sleipnir::CPCL::Distance(), Sleipnir::CDat::FilterGenes(), Sleipnir::CDat::Open(), Sleipnir::CGenes::Open(), Sleipnir::CDatasetCompact::Open(), Sleipnir::CGenes::OpenWeighted(), and Sleipnir::CDat::SaveDOT().
size_t Sleipnir::CGene::GetOntologies | ( | ) | const [inline] |
Return the number of different ontologies in which this gene is annotated.
const IOntology* Sleipnir::CGene::GetOntology | ( | size_t | iOntology | ) | const [inline] |
bool Sleipnir::CGene::GetRNA | ( | ) | const [inline] |
const std::string& Sleipnir::CGene::GetSynonym | ( | size_t | iSynonym | ) | const [inline] |
Return the requested synonym of the current gene.
iSynonym | Synonym to retrieve. |
Definition at line 109 of file genome.h.
Referenced by Sleipnir::CGenome::FindGene(), Sleipnir::CDat::SaveDOT(), and Sleipnir::CDat::SaveMATISSE().
size_t Sleipnir::CGene::GetSynonyms | ( | ) | const [inline] |
Return the number of synonyms of the current gene.
Definition at line 92 of file genome.h.
Referenced by Sleipnir::CGenome::FindGene(), Sleipnir::CDat::SaveDOT(), and Sleipnir::CDat::SaveMATISSE().
const float Sleipnir::CGene::GetWeight | ( | ) | const [inline] |
bool Sleipnir::CGene::IsAnnotated | ( | const IOntology * | pOntology | ) | const |
Return true if the gene is annotated within the given ontology.
pOntology | Ontology to test for gene annotation. |
Definition at line 144 of file genome.cpp.
bool Sleipnir::CGene::IsAnnotated | ( | const IOntology * | pOntology, |
size_t | iTerm | ||
) | const |
Return true if the gene is directly annotated to the given ontology term.
pOntology | Ontology to test for gene annotation. |
iTerm | Term to test for direct gene annotation. |
Definition at line 170 of file genome.cpp.
void Sleipnir::CGene::SetDubious | ( | bool | fDubious | ) | [inline] |
Sets whether the gene encodes a dubious reading frame.
fDubious | Value to store for dubious reading frame status. |
Definition at line 151 of file genome.h.
Referenced by Sleipnir::CGenome::Open().
void Sleipnir::CGene::SetGloss | ( | const std::string & | strGloss | ) | [inline] |
Sets the human-readable text description of the gene.
strGloss | Text description of the gene. |
Definition at line 123 of file genome.h.
Referenced by Sleipnir::CGenome::Open().
void Sleipnir::CGene::SetRNA | ( | bool | fRNA | ) | [inline] |
Sets whether the gene encodes an RNA gene.
fRNA | Value to store for RNA gene status. |
Definition at line 179 of file genome.h.
Referenced by Sleipnir::CGenome::Open().