Sleipnir
Public Member Functions
Sleipnir::CGene Class Reference

Represents a gene with a single primary unique identifier, zero or more synonyms, and zero or more functional annotations. More...

#include <genome.h>

Inheritance diagram for Sleipnir::CGene:
Sleipnir::CGeneImpl

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 IOntologyGetOntology (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.

Detailed Description

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.

Remarks:
For clarity, this documentation will refer to a gene's unique primary identifier as its ID and to its optional synonyms as either synonyms or simply names.
See also:
CGenes

Definition at line 61 of file genome.h.


Constructor & Destructor Documentation

Sleipnir::CGene::CGene ( const std::string &  strID)

Create a new gene with the given primary identifier.

Parameters:
strIDUnique primary identifier of the new gene.
See also:
GetName

Definition at line 39 of file genome.cpp.


Member Function Documentation

bool Sleipnir::CGene::AddAnnotation ( const IOntology pOntology,
size_t  iTerm 
)

Adds an annotation in the gene object to a specific functional ontology term.

Parameters:
pOntologyOntology into which the gene should be annotated.
iTermOntology term to which the gene should be annotated.
Returns:
True if the annotation was added successfully.

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.

Remarks:
This does not inform pOntology of the annotation, so if it is not already reflected in that ontology, the annotation will only be visible from the CGene object, not from the IOntology.
See also:
IsAnnotated

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.

Parameters:
strNameSynonym to be added.
Returns:
True if the synonym was successfully added.
Remarks:
Addition will fail if the synonym is the same as the gene's name or an existing synonym.
See also:
GetSynonym

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.

Parameters:
iOntologyOntology index of requested annotation.
iAnnotationRequested annotation index.
Returns:
Ontology term of the requested annotation.
Remarks:
For efficiency, no bounds checking is performed. The given indices must be smaller than GetOntologies and GetAnnotations.

Definition at line 273 of file genome.h.

size_t Sleipnir::CGene::GetAnnotations ( size_t  iOntology) const [inline]

Return the number of annotations of this gene within the requested ontology.

Parameters:
iOntologyOntology whose annotations should be counted.
Returns:
Number of annotations of this gene within the requested ontology.
Remarks:
For efficiency, no bounds checking is performed. The given index must be smaller than GetOntologies.

Definition at line 252 of file genome.h.

bool Sleipnir::CGene::GetDubious ( ) const [inline]

Return whether the gene encodes a dubious reading frame.

Returns:
Dubious reading frame status.
See also:
SetDubious

Definition at line 165 of file genome.h.

const std::string& Sleipnir::CGene::GetGloss ( ) const [inline]

Return the human-readable text description of the gene.

Returns:
Human-readable text description of the gene.
See also:
SetGloss

Definition at line 137 of file genome.h.

Referenced by Sleipnir::CDat::SaveMATISSE().

const std::string& Sleipnir::CGene::GetName ( ) const [inline]
size_t Sleipnir::CGene::GetOntologies ( ) const [inline]

Return the number of different ontologies in which this gene is annotated.

Returns:
Number of ontologies in which this gene is annotated.
See also:
GetOntology

Definition at line 218 of file genome.h.

const IOntology* Sleipnir::CGene::GetOntology ( size_t  iOntology) const [inline]

Return the ontology at the requested index.

Parameters:
iOntologyIndex of ontology to return.
Returns:
Ontology at requested index.
Remarks:
For efficiency, no bounds checking is performed. The given index must be smaller than GetOntologies.

Definition at line 235 of file genome.h.

bool Sleipnir::CGene::GetRNA ( ) const [inline]

Return whether the gene encodes an RNA gene.

Returns:
RNA gene status.
See also:
SetRNA

Definition at line 193 of file genome.h.

const std::string& Sleipnir::CGene::GetSynonym ( size_t  iSynonym) const [inline]

Return the requested synonym of the current gene.

Parameters:
iSynonymSynonym to retrieve.
Returns:
Requested synonym.
Remarks:
For efficiency, no bounds checking is performed. The given index must be smaller than GetSynonyms.

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.

Returns:
Current gene's number of synonyms.
See also:
GetSynonym

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]

Return weight of the gene.

Returns:
Gene weight.
See also:
SetWeight

Definition at line 206 of file genome.h.

bool Sleipnir::CGene::IsAnnotated ( const IOntology pOntology) const

Return true if the gene is annotated within the given ontology.

Parameters:
pOntologyOntology to test for gene annotation.
Returns:
True if gene is annotated within the given ontology.

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.

Parameters:
pOntologyOntology to test for gene annotation.
iTermTerm to test for direct gene annotation.
Returns:
True if gene is directly annotated to the given ontology term.
Remarks:
Does not examine the ontology or term descendants directly, so will only return true if the gene has been directly annotated to the given term using AddAnnotation.

Definition at line 170 of file genome.cpp.

void Sleipnir::CGene::SetDubious ( bool  fDubious) [inline]

Sets whether the gene encodes a dubious reading frame.

Parameters:
fDubiousValue to store for dubious reading frame status.
See also:
GetDubious

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.

Parameters:
strGlossText description of the gene.
See also:
GetGloss

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.

Parameters:
fRNAValue to store for RNA gene status.
See also:
GetRNA

Definition at line 179 of file genome.h.

Referenced by Sleipnir::CGenome::Open().


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