RNAModel Class Reference

#include <RNAModel.h>

Inheritance diagram for RNAModel:

Noschain Range mRNAModel ESTAssembly JGIModel mRNAModelUpdate ESTAssemblyid

List of all members.

Public Member Functions

 RNAModel ()
 RNAModel (const Noschain &seg, const string &chrom, const string &gs)
 RNAModel (const string &exstr, const string &gname, const string &gs, int oi)
 RNAModel (const string &exstr, const string &gname, const string &gs, int oi, int gene_id)
 RNAModel (const string &exstarts, const string &exends, char strand, const string &gi, const string &genomic) throw (Badinput, exception)
 RNAModel (const string &exstarts, const string &exends, char strand, const string &gi, const string &genomic, int oo) throw (Badinput)
 RNAModel (const RNAModel &rm)
RNAModeloperator= (const RNAModel &rm)
void assignNewId ()
int getOid () const
void setOid (int oi)
void setNextOid ()
void assignNewGeneId ()
void modelidAsGeneid ()
void assignCurrentGeneId ()
int getGeneId () const
int geneId () const
void setGeneId (const int gene_id)
void setGenomic (const string &gs)
void setGenomicPointer (const string *gs)
void trimAfterPoint (const int p) throw (PointOutChain)
void trimBeforePoint (const int p) throw (PointOutChain)
const string & RNASequence () const
int genomicIndex (int mrnaidx) const throw (OutsideGenomicSequence)
int RNAIndex (int gidx) const throw (PointOutChain)
bool sameExons (const RNAModel &gm) const
const string * getGenomicPointer () const
int exonLength () const
virtual bool valid () const
bool sameRNA (const RNAModel &rmd) const
const string & genomicId () const
int RNALength () const
const string & RNAString () const
void resetRNA () throw (Badinput)
void setRNA (const string &rseq)
virtual void reset ()
void setGenomicId (const string &gg)
bool append (Noschain &mod)
RNAModelreverse ()
string seqGenomic () const
int genomicLength () const
virtual modeltype objtype () const
ostream & writeExon (ostream &ous, char sep='\t') const
ostream & print (ostream &ous) const
void intronBound (map< string, int > &spsite) const

Static Public Member Functions

static int currentId ()
static int nextId ()
static void advanceId ()
static void rollbackId ()
static void setId (int oi)
static int nextGeneId ()
static int currentGeneId ()
static void advanceGeneId ()

Static Public Attributes

static const char exonheader [] = "exonid\tmodelid\texstart\texfinish"

Protected Attributes

string gid
const string * gseq
string rna
int oid
int genid

Static Protected Attributes

static int serialid = 1
 static member initialization
static int exonid = 1
static int geneid = 1


Detailed Description

now build a more permanent class for storage and model compare and update

This class should be used to derive ESTModel. I all common operations between JGI model and ESTModel should be implemented in this class.

All classes in this family have actual Genomic sequence and they produce RNA and protein sequence. This diff from objects where the main feature is simply Ranges with the ability to splice externally supplied genomic sequences.

Constructors don't assign geneid, it left as an operation by external programs. In this case combest assigns geneid of ESTAssemblyid class.


Constructor & Destructor Documentation

RNAModel::RNAModel (  )  [inline]

default constructor, initialize oid will have default geneid 0

References nextId(), and oid.

RNAModel::RNAModel ( const Noschain seg,
const string &  chrom,
const string &  gs 
) [inline, explicit]

constructor from Bases class object. Assign gene id to zero. Geneid is usually assigned by external operations such as gathercaiwegene program. Or the ESTAssembly assigns primitive geneids.

References gseq, nextId(), oid, rna, and Noschain::subsequence().

RNAModel::RNAModel ( const string &  exstr,
const string &  gname,
const string &  gs,
int  oi 
) [inline]

reading from stored objects from text files, object id is provided.

Parameters:
gname genomic sequence id.
gs genomic sequence string. object identifier, mostly used for database interaction.

References gseq, rna, and Noschain::subsequence().

RNAModel::RNAModel ( const string &  exstr,
const string &  gname,
const string &  gs,
int  oi,
int  gene_id 
) [inline]

for reading object from text file with geneid

References gseq, rna, and Noschain::subsequence().

RNAModel::RNAModel ( const string &  exstarts,
const string &  exends,
char  strand,
const string &  gi,
const string &  genomic 
) throw (Badinput, exception) [inline]

constructor from JGI model table. The oid is assigned from the serialid counter. Another version will take from existing id. The base class throws Badinput exceptions.

References Noschain::exons, gseq, Noschain::isNull(), rna, and Noschain::subsequence().

RNAModel::RNAModel ( const string &  exstarts,
const string &  exends,
char  strand,
const string &  gi,
const string &  genomic,
int  oo 
) throw (Badinput) [inline]

JGI input with know oid or primary key

Parameters:
oo. The unique identifier for this object. It is usually the primary key.

References Noschain::exons, gseq, Noschain::isNull(), rna, and Noschain::subsequence().

RNAModel::RNAModel ( const RNAModel rm  )  [inline]

consturctor of the same type. Oid is updated. The assignment of old is thread-safe if modify nextId() method. Now using simple serialid++. This is not thread safe.


Member Function Documentation

RNAModel & RNAModel::operator= ( const RNAModel rm  ) 

do we copy oid?. copy oid. Up to the user to call assign new id to make up new id. use assignNewId() to do this.

References genid, gid, gseq, oid, Noschain::operator=(), and rna.

Referenced by mRNAModel::operator=().

void RNAModel::assignNewId (  )  [inline]

assign oid to serialid then increment the serialid

References nextId(), and oid.

int RNAModel::getOid (  )  const [inline]

void RNAModel::setOid ( int  oi  )  [inline]

References oid.

void RNAModel::setNextOid (  )  [inline]

this is the same as assignnewId(), just a different name

References nextId(), and oid.

void RNAModel::assignNewGeneId (  )  [inline]

assign the current geneid to genid member, then increment geneid. use this one to control gene id. This is one way of assigning gene id. Another way to do it is to use the modelid. For single isoform genes, the modelid is the geneid. For genes with alternative splicing, the most highly expressed isoform's modelid will be used as the geneid. The programmer has the freedom to use whichever system that is the best.

References genid, and nextGeneId().

void RNAModel::modelidAsGeneid (  )  [inline]

References genid, and oid.

Referenced by assembleChain(), and computeRelativeProfileHeight().

void RNAModel::assignCurrentGeneId (  )  [inline]

assign the geneid to current genid, without increment

References currentGeneId(), and genid.

int RNAModel::getGeneId (  )  const [inline]

int RNAModel::geneId (  )  const [inline]

void RNAModel::setGeneId ( const int  gene_id  )  [inline]

void RNAModel::setGenomic ( const string &  gs  )  [inline]

will try to guess at the best ORF, may reverse the chain

Parameters:
cngid congregation id, user increment this value outside this object. This value is used for output only, not for computation. It is class member of Graph

References gseq.

void RNAModel::setGenomicPointer ( const string *  gs  )  [inline]

References gseq.

void RNAModel::trimAfterPoint ( const int  p  )  throw (PointOutChain)

overload Noschain method, to do RNA trimming in addition to the genomic chain trimming.

Reimplemented from Noschain.

Reimplemented in mRNAModel.

References rna, RNAIndex(), and Noschain::trimAfterPoint().

Referenced by mRNAModel::trimAfterPoint().

void RNAModel::trimBeforePoint ( const int  p  )  throw (PointOutChain)

overload Noschain method so it will also trim RNA

Reimplemented from Noschain.

Reimplemented in mRNAModel.

References rna, RNAIndex(), and Noschain::trimBeforePoint().

const string& RNAModel::RNASequence (  )  const [inline]

write the object in several output streams

References rna.

Referenced by mRNAModel::JGITranscriptRow(), mRNAModel::printJGITranscriptRow(), mRNAModel::printJGITranscriptRowNoId(), and ESTAssembly::write().

int RNAModel::genomicIndex ( int  mrnaidx  )  const throw (OutsideGenomicSequence)

int RNAModel::RNAIndex ( int  gidx  )  const throw (PointOutChain)

bool RNAModel::sameExons ( const RNAModel gm  )  const [inline]

const string* RNAModel::getGenomicPointer (  )  const [inline]

get a string pointer that points to the parent genomic sequence

References gseq.

int RNAModel::exonLength (  )  const [inline]

in Noschain this is implemented as sum of exon length This derived class store the same information into the length of the RNA string. No computation is needed. Overwrite parent class method.

Reimplemented from Noschain.

References rna.

Referenced by mRNAModel::CDSFractionRNA(), mRNAModelUpdate::ESTCoverage(), mRNAModel::ThreePrimeUTRLength(), valid(), ESTAssembly::write(), ESTAssembly::writeModel(), mRNAModelUpdate::writeModelTable(), and mRNAModel::writeModelTable().

bool RNAModel::valid (  )  const [virtual]

I am making this a virtual function. it checks 1. rna string length is the same as parent class exonLength() 2. all exons are in the same direction.

Reimplemented in mRNAModel.

References Noschain::directionAgree(), exonLength(), Noschain::exonLength(), and rna.

Referenced by mRNAModel::valid().

bool RNAModel::sameRNA ( const RNAModel rmd  )  const [inline]

more advanced than comparing the ranges. Now it is comparing the actual RNA sequence which is the spliced product. It could be very expensive comparing long sequences! This is much slower than the parent class comparision, should not overload.

References rna.

const string& RNAModel::genomicId (  )  const [inline]

int RNAModel::RNALength (  )  const [inline]

const string& RNAModel::RNAString (  )  const [inline]

References rna.

Referenced by readESTModel().

void RNAModel::resetRNA (  )  throw (Badinput) [inline]

Given the genomic sequence, this object will resplice the genomic DNA asscording to exons in the parent class (Noschain). rna will be reset according to this new splice result.

References gseq, rna, and Noschain::subsequence().

Referenced by mRNAModel::growCDS3Prime(), mRNAModel::reset(), reverse(), mRNAModel::trimCDSStop(), mRNAModel::trimCDSTail(), and JGIModel::valid().

void RNAModel::setRNA ( const string &  rseq  )  [inline]

virtual void RNAModel::reset (  )  [inline, virtual]

simply reset RNA sequence from exon boudns call Noschain::subsequence() method

Reimplemented in mRNAModel.

References gseq, rna, and Noschain::subsequence().

Referenced by append(), and mRNAModel::mRNAModel().

void RNAModel::setGenomicId ( const string &  gg  )  [inline]

References gid.

bool RNAModel::append ( Noschain mod  ) 

RNAModel version, add chain first, then update RNA sequence.

Reimplemented from Noschain.

References Noschain::append(), and reset().

Referenced by mRNAModel::append().

RNAModel & RNAModel::reverse (  ) 

Note, most RNA with introns have direction set from 5' to 3'. So reversing of such RNA should get a warning will also reverse the underlying RNA sequence. This method is used when strand information was not supplied in the right format. Then the guessStrand() function of mRNAModel will reverse - models.

Reimplemented from Noschain.

References resetRNA(), and Noschain::reverse().

Referenced by ESTAssemblyid::breakup(), mRNAModel::mRNAModel(), ESTAssembly::reverse(), and mRNAModel::reverse().

string RNAModel::seqGenomic (  )  const

The subsequence of this object. For constructing JGI table column.

References Range::begin(), Range::direction(), Range::end(), gseq, and reverseComplementInPlace().

Referenced by mRNAModel::JGITranscriptRow(), mRNAModel::printJGITranscriptRow(), and mRNAModel::printJGITranscriptRowNoId().

int RNAModel::genomicLength (  )  const [inline]

References gseq.

Referenced by mRNAModel::growCDS3Prime().

virtual modeltype RNAModel::objtype (  )  const [inline, virtual]

Reimplemented in mRNAModel, JGIModel, and ESTAssembly.

References RNA.

ostream & RNAModel::writeExon ( ostream &  ous,
char  sep = '\t' 
) const

will not output endl. This method is enough for all derived classes. Generate a table row.

References exonid, Noschain::exons, getOid(), and Noschain::numberOfRanges().

Referenced by ESTAssembly::write(), ESTAssemblyid::writetab(), ESTAssembly::writetab(), mRNAModelUpdate::writetab(), and mRNAModel::writetab().

ostream & RNAModel::print ( ostream &  ous  )  const [virtual]

for operator<<

Reimplemented from Noschain.

Reimplemented in mRNAModel, JGIModel, and ESTAssembly.

References genid, gid, oid, and Noschain::print().

Referenced by mRNAModel::print().

void RNAModel::intronBound ( map< string, int > &  spsite  )  const

extract the boundary 4 bp, GTAG and count them

Parameters:
spsite is the accumulator. This function collect stat info for all introns.

References Range::begin(), Range::direction(), Range::end(), Noschain::exons, genomicId(), getOid(), gseq, Noschain::numberOfRanges(), and reverseComplement().

Referenced by assembleChain().

static int RNAModel::currentId (  )  [inline, static]

Returns:
serialid. does not increment serialid

References serialid.

static int RNAModel::nextId (  )  [inline, static]

Returns:
current serialid then increment it

References serialid.

Referenced by assignNewId(), RNAModel(), and setNextOid().

static void RNAModel::advanceId (  )  [inline, static]

References serialid.

static void RNAModel::rollbackId (  )  [inline, static]

References serialid.

static void RNAModel::setId ( int  oi  )  [inline, static]

References serialid.

static int RNAModel::nextGeneId (  )  [inline, static]

Returns:
current geneid, then increment it

References geneid.

Referenced by assignNewGeneId().

static int RNAModel::currentGeneId (  )  [inline, static]

Returns:
current geneid

References geneid.

Referenced by assignCurrentGeneId().

static void RNAModel::advanceGeneId (  )  [inline, static]

References geneid.

Referenced by assignGeneId().


Member Data Documentation

const char RNAModel::exonheader = "exonid\tmodelid\texstart\texfinish" [static]

Referenced by main(), and makeModels().

string RNAModel::gid [protected]

const string* RNAModel::gseq [protected]

string RNAModel::rna [protected]

int RNAModel::oid [protected]

this is the unique object id obtained by advancing serialid class-wise variable Or this can assigned from external database primary key.

Referenced by assignNewId(), getOid(), modelidAsGeneid(), operator=(), print(), RNAModel(), setNextOid(), and setOid().

int RNAModel::genid [protected]

gene id. This is the member. I also have a global counter: geneid

Referenced by assignCurrentGeneId(), assignNewGeneId(), geneId(), getGeneId(), modelidAsGeneid(), operator=(), print(), and setGeneId().

int RNAModel::serialid = 1 [static, protected]

static member initialization

for making unique identifier of objects in this class

Referenced by advanceId(), currentId(), nextId(), rollbackId(), and setId().

int RNAModel::exonid = 1 [static, protected]

Referenced by writeExon().

int RNAModel::geneid = 1 [static, protected]


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

Generated on Wed Aug 10 11:57:15 2011 for Softwares from Orpara by  doxygen 1.5.6