AMOS::Contig_t Class Reference

A tiling of assembled sequence reads. More...

#include <Contig_AMOS.hh>

Inheritance diagram for AMOS::Contig_t:

[legend]
Collaboration diagram for AMOS::Contig_t:
[legend]
List of all members.

Public Member Functions

 Contig_t ()
 Constructs an empty Contig_t object.
 Contig_t (const Contig_t &source)
 Copy constructor.
 ~Contig_t ()
 Destroys a Contig_t object.
virtual void clear ()
 Clears all object data, reinitializes the object.
Pos_t gap2ungap (Pos_t gap)
 Translates a 0-based gapped position (offset) to a 1-based ungapped position (sequence coordinate).
Pos_t ungap2gap (Pos_t ungap)
 Translates an 1-based ungapped position to a 0-based gapped position.
virtual double getGCContent (const Range_t &rng) const
 Get the gc content of the sequence.
virtual double getGCContent () const
 Get the gc content of the sequence.
virtual NCode_t getNCode () const
 Get the AMOS NCode type identifier.
const std::vector< Tile_t > & getReadTiling () const
 Get the tiling of underlying reads.
std::vector< Tile_t > & getReadTiling ()
Size_t getSpan () const
 Get the span of the read layout.
Size_t getUngappedLength () const
 Get the ungapped consensus length.
std::string getUngappedQualString () const
 Get the ungapped quality score string.
std::string getUngappedQualString (Range_t range) const
 Get an ungapped quality score substring.
std::string getUngappedSeqString () const
 Get the ungapped sequence base string.
std::string getUngappedSeqString (Range_t range) const
 Get an ungapped sequence base substring.
void insertGapColumn (Pos_t gindex)
 Insert a gap column at the specified position in the contig.
double getCovStat (const double globalArrivalRate) const
 Get the cov stat of the sequence.
double getAvgRho () const
 Get the length of the sequence with more than 1X coverage.
virtual void readMessage (const Message_t &msg)
 Reads in data from a Message object.
bool readUMD (std::istream &in)
 Read a UMD contig message from an input stream.
void reverseComplement ()
 Reverse Complement the contig and layout of reads.
void setReadTiling (const std::vector< Tile_t > &reads)
 Set the tiling of underlying reads.
void setReadTiling (const Layout_t &layout)
 Set the tiling of underlying reads.
void setSequence (const char *seq, const char *qual)
 Set the consensus sequence of the contig.
void setSequence (const std::string &seq, const std::string &qual)
 Set the consensus sequence of the contig.
virtual void writeMessage (Message_t &msg) const
 Writes data to a Message object.
void writeUMD (std::ostream &out) const
 Write a UMD contig message to an output stream.
std::pair< char, char > getBase (Pos_t index) const
 Get a single base and its quality score.
Size_t getLength () const
 Get the length of the sequence.
std::string getQualString () const
 Get the quality score string.
std::string getQualString (Range_t range) const
 Get a quality score substring.
std::string getSeqString () const
 Get the sequence base string.
std::string getSeqString (Range_t range) const
 Get a sequence base substring.
bool isCompressed () const
 Checks if the sequence data is compressed.
void setBase (char seqchar, char qualchar, Pos_t index)
 Set a sequence base and its quality score.
const std::string & getComment () const
 Get the comment string.
const Status_t getStatus () const
 Get the status value.
void setComment (const std::string &comment)
 Set the comment string.
void setStatus (Status_t status)
 Set the status value.
const std::string & getEID () const
 Get the external ID.
ID_t getIID () const
 Get the internal ID.
bool isRemoved () const
 Check if the object is waiting to be removed from the bank.
bool isModified () const
 Check if the object has been modified.
bool isFlagA () const
 Check the value of flag A.
bool isFlagB () const
 Check the value of flag B.
void setEID (const std::string &eid)
 Set the external ID.
void setFlagA (bool flag)
 Set flag A.
void setFlagB (bool flag)
 Set flag B.
void setIID (ID_t iid)
 Set the internal ID.

Static Public Attributes

static const NCode_t NCODE = M_CONTIG
 The NCode type identifier for this object.

Protected Member Functions

virtual void readRecord (std::istream &fix, std::istream &var)
 Read selected class members from a biserial record.
virtual void readRecordFix (std::istream &fix)
 Read selected class members from a fixed store only.
virtual void writeRecord (std::ostream &fix, std::ostream &var) const
 Write selected class members to a biserial record.

Static Protected Member Functions

static uint8_t compress (char seqchar, char qualchar)
 Compresses a sequence char and quality char into a single byte.
static std::pair< char, char > uncompress (uint8_t byte)
 Uncompresses a byte into a sequence and quality char.

Protected Attributes

uint8_t * seq_m
 compressed seq and qual data or uncompressed seq
uint8_t * qual_m
 uncompressed qual data
Size_t length_m
 length of the sequence and quality data
ID_t iid_m
 internal ID (integer AMOS identifier)
std::string eid_m
 external ID (anything you want sans newlines)
BankFlags_t flags_m
 bank flags, derived classes may use "nibble"

Static Protected Attributes

static const uint8_t COMPRESS_BIT = 0x1
 compressed sequence flag
static const uint8_t ADENINE_BITS = 0x0
 'A' bit
static const uint8_t CYTOSINE_BITS = 0x40
 'C' bit
static const uint8_t GUANINE_BITS = 0x80
 'G' bit
static const uint8_t THYMINE_BITS = 0xC0
 'T' bit
static const uint8_t SEQ_BITS = 0xC0
 sequence bit mask
static const uint8_t QUAL_BITS = 0x3F
 quality bit mask

Detailed Description

A tiling of assembled sequence reads.

A Contig_t consists of a consensus sequence with quality scores and a tiling of underlying reads that produce the consensus. The consensus sequence is stored as a 'gapped consensus'. That is the gaps are stored as gap characters in the consensus sequence instead of as a position list. The ungapped version of the consensus can be generated with the getUngapped... methods. Gap characters should be '-' but '*' is also accepted. The compress and uncompress methods inherited from Sequence_t are made private because they would corrupt the gap characters.

Definition at line 35 of file Contig_AMOS.hh.


Constructor & Destructor Documentation

AMOS::Contig_t::Contig_t (  )  [inline]

Constructs an empty Contig_t object.

Definition at line 83 of file Contig_AMOS.hh.

AMOS::Contig_t::Contig_t ( const Contig_t source  )  [inline]

Copy constructor.

Definition at line 93 of file Contig_AMOS.hh.

AMOS::Contig_t::~Contig_t (  )  [inline]

Destroys a Contig_t object.

Definition at line 102 of file Contig_AMOS.hh.


Member Function Documentation

virtual void AMOS::Contig_t::clear (  )  [inline, virtual]

Clears all object data, reinitializes the object.

All data will be cleared, but object compression status will remain unchanged. Use the compress/uncompress members to change this info.

Reimplemented from AMOS::Sequence_t.

Definition at line 109 of file Contig_AMOS.hh.

References AMOS::Sequence_t::clear().

Referenced by readMessage(), and writeMessage().

static uint8_t AMOS::Sequence_t::compress ( char  seqchar,
char  qualchar 
) [inline, static, protected, inherited]

Compresses a sequence char and quality char into a single byte.

Note:
Must work with uncompress(uint8_t) method
Parameters:
seqchar The sequence base character (case insensitive)
qualchar The quality score character
Returns:
The compressed byte

Definition at line 64 of file Sequence_AMOS.hh.

References AMOS::Sequence_t::ADENINE_BITS, AMOS::Char2Qual(), AMOS::Sequence_t::CYTOSINE_BITS, AMOS::Sequence_t::GUANINE_BITS, AMOS::Sequence_t::SEQ_BITS, and AMOS::Sequence_t::THYMINE_BITS.

Pos_t Contig_t::gap2ungap ( Pos_t  gap  ) 

Translates a 0-based gapped position (offset) to a 1-based ungapped position (sequence coordinate).

This method requires O(num gaps). If the gapped position points to a gap the returned ungapped position will point to the base immediately preceeding the gap.

Parameters:
The gapped position
Precondition:
gap < getLength( )
Returns:
The ungapped position

Definition at line 44 of file Contig_AMOS.cc.

Referenced by AMOS::ContigIterator_t::seek().

double Contig_t::getAvgRho (  )  const

Get the length of the sequence with more than 1X coverage.

Returns:
The length for the sequence

Definition at line 193 of file Contig_AMOS.cc.

References AMOS::Sequence_t::getLength().

Referenced by getCovStat().

std::pair<char, char> AMOS::Sequence_t::getBase ( Pos_t  index  )  const [inline, inherited]

Get a single base and its quality score.

Retrieves and uncompresses the sequence base for the requested index.

Parameters:
index The index of the requested base
Precondition:
index >= 0 && index < length
Exceptions:
ArgumentException_t 
Returns:
The requested (uppercase) base character and its quality score

Definition at line 205 of file Sequence_AMOS.hh.

References AMOS_THROW_ARGUMENT, AMOS::Sequence_t::isCompressed(), AMOS::Sequence_t::length_m, AMOS::Sequence_t::qual_m, AMOS::Sequence_t::seq_m, and AMOS::Sequence_t::uncompress().

Referenced by AMOS::Sequence_t::getGCContent(), AMOS::Sequence_t::getQualString(), AMOS::Sequence_t::getSeqString(), getUngappedLength(), getUngappedQualString(), getUngappedSeqString(), and AMOS::Sequence_t::writeMessage().

const std::string& AMOS::Universal_t::getComment (  )  const [inline, inherited]

Get the comment string.

Returns:
The comment string

Definition at line 116 of file Universal_AMOS.hh.

Referenced by AMOS::operator<<().

double Contig_t::getCovStat ( const double  globalArrivalRate  )  const

Get the cov stat of the sequence.

Returns:
The coverage stat for the sequence

Definition at line 183 of file Contig_AMOS.cc.

References getAvgRho().

const std::string& AMOS::IBankable_t::getEID (  )  const [inline, inherited]

Get the external ID.

Returns:
The external ID

Definition at line 174 of file Bank_AMOS.hh.

References AMOS::IBankable_t::eid_m.

Referenced by AMOS::TiledRead_t::TiledRead_t().

virtual double AMOS::Contig_t::getGCContent (  )  const [inline, virtual]

Get the gc content of the sequence.

Returns:
The gc content of the full range of the sequence

Reimplemented from AMOS::Sequence_t.

Definition at line 185 of file Contig_AMOS.hh.

References AMOS::Sequence_t::length_m.

virtual double AMOS::Contig_t::getGCContent ( const Range_t rng  )  const [inline, virtual]

Get the gc content of the sequence.

Returns:
The gc content for the specified range of the sequence

Reimplemented from AMOS::Sequence_t.

Definition at line 148 of file Contig_AMOS.hh.

References AMOS_THROW_ARGUMENT, AMOS::Range_t::getHi(), AMOS::Range_t::getLo(), AMOS::Sequence_t::length_m, and AMOS::Sequence_t::seq_m.

ID_t AMOS::IBankable_t::getIID (  )  const [inline, inherited]

Get the internal ID.

Returns:
The internal ID

Definition at line 185 of file Bank_AMOS.hh.

References AMOS::IBankable_t::iid_m.

Referenced by AMOS::Index_t::buildContigFeature(), AMOS::Index_t::buildContigScaffold(), AMOS::Index_t::buildReadContig(), AMOS::Index_t::buildReadLibrary(), AMOS::Index_t::buildScaffoldFeature(), and AMOS::operator<<().

Size_t AMOS::Sequence_t::getLength (  )  const [inline, inherited]

Get the length of the sequence.

Returns:
The length of the sequence

Definition at line 272 of file Sequence_AMOS.hh.

References AMOS::Sequence_t::length_m.

Referenced by getAvgRho(), getSpan(), getUngappedQualString(), getUngappedSeqString(), and AMOS::Read_t::writeMessage().

virtual NCode_t AMOS::Contig_t::getNCode (  )  const [inline, virtual]

Get the AMOS NCode type identifier.

Returns:
The AMOS NCode type identifier

Reimplemented from AMOS::Sequence_t.

Definition at line 193 of file Contig_AMOS.hh.

References NCODE.

string Sequence_t::getQualString ( Range_t  range  )  const [inherited]

Get a quality score substring.

Returns a subrange of quality scores [begin, end) or (end, begin]. The reversed range will pull the reverse string of quality scores.

Parameters:
range The range of quality scores to get
Precondition:
range lo >= 0 && hi <= length
Exceptions:
ArgumentException_t 
Returns:
A subrange quality scores

Definition at line 59 of file Sequence_AMOS.cc.

References AMOS_THROW_ARGUMENT, AMOS::Sequence_t::getBase(), AMOS::Sequence_t::length_m, AMOS::NULL_CHAR, and AMOS::Reverse().

std::string AMOS::Sequence_t::getQualString (  )  const [inline, inherited]

Get the quality score string.

Returns:
The full string of quality scores

Definition at line 290 of file Sequence_AMOS.hh.

References AMOS::Sequence_t::length_m.

Referenced by AMOS::ContigIterator_t::ContigIterator_t(), insertGapColumn(), AMOS::operator<<(), and reverseComplement().

std::vector<Tile_t>& AMOS::Contig_t::getReadTiling (  )  [inline]

Definition at line 211 of file Contig_AMOS.hh.

const std::vector<Tile_t>& AMOS::Contig_t::getReadTiling (  )  const [inline]

Get the tiling of underlying reads.

Returns:
The vector of underlying reads

Definition at line 204 of file Contig_AMOS.hh.

Referenced by AMOS::ContigIterator_t::advanceNext(), AMOS::ContigIterator_t::ContigIterator_t(), and AMOS::ContigIterator_t::seek().

string Sequence_t::getSeqString ( Range_t  range  )  const [inherited]

Get a sequence base substring.

Returns a subrange of sequence bases [begin, end) or (end, being]. The reversed range will pull the reverse complement string of sequences bases.

Parameters:
range The range of sequence bases to get
Precondition:
range lo >= 0 && hi <= length
Exceptions:
ArgumentException_t 
Returns:
A subrange of sequence bases

Definition at line 83 of file Sequence_AMOS.cc.

References AMOS_THROW_ARGUMENT, AMOS::Sequence_t::getBase(), AMOS::Sequence_t::length_m, AMOS::NULL_CHAR, and AMOS::ReverseComplement().

std::string AMOS::Sequence_t::getSeqString (  )  const [inline, inherited]

Get the sequence base string.

Returns:
The full string of sequence bases

Definition at line 315 of file Sequence_AMOS.hh.

References AMOS::Sequence_t::length_m.

Referenced by AMOS::ContigIterator_t::ContigIterator_t(), insertGapColumn(), AMOS::operator<<(), and reverseComplement().

Size_t Contig_t::getSpan (  )  const

Get the span of the read layout.

Returns the difference between min(offset) and max(offset+len). Since the layout is not necessarily sorted, this method requires linear time.

Returns:
The span of the layout

Definition at line 82 of file Contig_AMOS.cc.

References AMOS::Sequence_t::getLength().

const Status_t AMOS::Universal_t::getStatus (  )  const [inline, inherited]

Get the status value.

Returns:
The status value

Definition at line 127 of file Universal_AMOS.hh.

Size_t Contig_t::getUngappedLength (  )  const

Get the ungapped consensus length.

Unlike getLength( ) which is constant time, this method requires linear time.

Returns:
The ungapped length of the consensus sequence

Definition at line 112 of file Contig_AMOS.cc.

References AMOS::Sequence_t::getBase(), and AMOS::Sequence_t::length_m.

string Contig_t::getUngappedQualString ( Range_t  range  )  const

Get an ungapped quality score substring.

Returns a subrange of quality scores [begin, end) or (end, begin] with all the gap scores removed. The range bounds are relative to the gapped consensus sequence, and a reversed range will pull the reverse string of quality scores.

Parameters:
range The range of quality scores to get
Precondition:
range lo >= 0 && hi <= length
Exceptions:
ArgumentException 
Returns:
A subrange of ungapped quality scores

Definition at line 125 of file Contig_AMOS.cc.

References AMOS_THROW_ARGUMENT, AMOS::Sequence_t::getBase(), AMOS::Sequence_t::getLength(), and AMOS::Reverse().

std::string AMOS::Contig_t::getUngappedQualString (  )  const [inline]

Get the ungapped quality score string.

Returns the quality string with all the gap scores removed.

Returns:
The full string of ungapped quality scores

Definition at line 246 of file Contig_AMOS.hh.

References AMOS::Sequence_t::getLength().

string Contig_t::getUngappedSeqString ( Range_t  range  )  const

Get an ungapped sequence base substring.

Returns a subrange of ungapped sequence bases [begin, end) or (end, begin] with all the gaps (non-alphas) removed. The range bounds are relative to the gapped consensus sequence, and reversed range will pull the reverse complement string of sequence bases.

Parameters:
range The range of sequence bases to get
Precondition:
range lo >= 0 && hi <= length
Exceptions:
ArgumentException 
Returns:
A subrange of ungapped sequence bases

Definition at line 154 of file Contig_AMOS.cc.

References AMOS_THROW_ARGUMENT, AMOS::Sequence_t::getBase(), AMOS::Sequence_t::getLength(), and AMOS::ReverseComplement().

std::string AMOS::Contig_t::getUngappedSeqString (  )  const [inline]

Get the ungapped sequence base string.

Returns:
The full string of ungapped sequence bases

Definition at line 273 of file Contig_AMOS.hh.

References AMOS::Sequence_t::getLength().

void Contig_t::insertGapColumn ( Pos_t  gindex  ) 

Insert a gap column at the specified position in the contig.

Inserts a gap into the consensus and tiling reads at the specified position. The downstream reads are shifted appropriately, and the consensus grows by 1bp.

Parameters:
gindex The gapped consensus position to insert the gap column
Precondition:
0 <= gindex <= |consensus|
Exceptions:
ArgumentException 
Returns:
void

Definition at line 229 of file Contig_AMOS.cc.

References AMOS_THROW_ARGUMENT, AMOS::Sequence_t::getQualString(), AMOS::Sequence_t::getSeqString(), and setSequence().

bool AMOS::Sequence_t::isCompressed (  )  const [inline, inherited]

Checks if the sequence data is compressed.

Returns true if the Sequence is currently operating in compressed mode, or false if under normal operation.

Returns:
True if compressed, false if not

Definition at line 343 of file Sequence_AMOS.hh.

References AMOS::Sequence_t::COMPRESS_BIT, and AMOS::IBankable_t::flags_m.

Referenced by AMOS::Sequence_t::compress(), AMOS::Sequence_t::getBase(), AMOS::Sequence_t::operator=(), AMOS::Sequence_t::setBase(), AMOS::Sequence_t::setSequence(), and AMOS::Sequence_t::uncompress().

bool AMOS::IBankable_t::isFlagA (  )  const [inline, inherited]

Check the value of flag A.

Returns:
The value of flag A

Definition at line 228 of file Bank_AMOS.hh.

References AMOS::IBankable_t::flags_m.

Referenced by AMOS::Universal_t::writeMessage(), and AMOS::Overlap_t::writeMessage().

bool AMOS::IBankable_t::isFlagB (  )  const [inline, inherited]

Check the value of flag B.

Returns:
The value of flag B

Definition at line 239 of file Bank_AMOS.hh.

References AMOS::IBankable_t::flags_m.

Referenced by AMOS::Universal_t::writeMessage(), and AMOS::Overlap_t::writeMessage().

bool AMOS::IBankable_t::isModified (  )  const [inline, inherited]

Check if the object has been modified.

Returns:
true if modified, otherwise false

Definition at line 217 of file Bank_AMOS.hh.

References AMOS::IBankable_t::flags_m.

bool AMOS::IBankable_t::isRemoved (  )  const [inline, inherited]

Check if the object is waiting to be removed from the bank.

Note:
Useful for debugging only
Returns:
true if removed, otherwise false

Definition at line 206 of file Bank_AMOS.hh.

References AMOS::IBankable_t::flags_m.

void Contig_t::readMessage ( const Message_t msg  )  [virtual]

Reads in data from a Message object.

Reads the data contained in a Message object and stores it in the Messagable object. Will not complain if incoming message is of the wrong type, will only try and suck out the fields it recognizes. All previous data in the Messagable object will be cleared or overwritten.

Parameters:
msg The Message to read from
Precondition:
The expected fields are formatted properly
Exceptions:
ArgumentException_t 
Returns:
void

Reimplemented from AMOS::Sequence_t.

Definition at line 299 of file Contig_AMOS.cc.

References clear(), AMOS::M_TILE, and AMOS::Sequence_t::readMessage().

virtual void AMOS::Contig_t::readRecord ( std::istream &  fix,
std::istream &  var 
) [protected, virtual]

Read selected class members from a biserial record.

Reads the fixed and variable length streams from a biserial record and initializes the class members to the values stored within. Used in translating a biserial IBankable object, and needed to retrieve objects from a bank.

Note:
This method must be able to interpret the biserial record produced by its related function writeRecord.
Parameters:
fix The fixed length stream (stores all fixed length members)
var The variable length stream (stores all var length members)
Precondition:
The get pointer of fix is at the beginning of the record

The get pointer of var is at the beginning of the record

Returns:
void

Reimplemented from AMOS::Sequence_t.

virtual void AMOS::Contig_t::readRecordFix ( std::istream &  fix  )  [protected, virtual]

Read selected class members from a fixed store only.

Reads the fixed stream and initializes the class members to the values stored within. Used to fetch the fixed portion of a biserial IBankable object, and needed to retrieve objects from a bank.

Note:
This method must be able to interpret the biserial record produced by its related function writeRecord.
Parameters:
fix The fixed length stream (stores all fixed length members)
Precondition:
The get pointer of fix is at the beginning of the record
Returns:
void

Reimplemented from AMOS::Sequence_t.

bool AMOS::Contig_t::readUMD ( std::istream &  in  ) 

Read a UMD contig message from an input stream.

Reads a University of Maryland style contig message and populates the appropriate fields with the values read from the stream. Will throw an exception if a message is found, but is not properly formatted. All fields not included in the message will be reinitialized. Contig EID will be set, and each tile will be stored with Read IID, read offset, and read range. Read range will be flipped to represent reverse complement.

Parameters:
in The input stream to read from
Precondition:
The incoming message is properly formatted
Exceptions:
IOException_t 
Returns:
true if a message was read, false if no message read (EOF)

void Contig_t::reverseComplement (  ) 

Reverse Complement the contig and layout of reads.

Reverse complements the consensus, reverses the consensus quality values and flips the orientations of the tiling reads. Note: The scaffold and contig edges are NOT updated.

Returns:
void

Definition at line 414 of file Contig_AMOS.cc.

References AMOS::Sequence_t::getQualString(), AMOS::Sequence_t::getSeqString(), AMOS::ReverseComplement(), and setSequence().

void AMOS::Sequence_t::setBase ( char  seqchar,
char  qualchar,
Pos_t  index 
) [inline, inherited]

Set a sequence base and its quality score.

Any characters may be used for seq and qualchar unless dealing with a compressed sequence. If compressed, the sequence should only contain A,C,G,T and Ns and quality scores in the range [MIN_QUALITY,MAX_QUALITY], if either of these conditions are not met the information will be lost when the data is compressed (see postconditions below).

Parameters:
seqchar The sequence base character
qualchar The quality score character
index The index to assign these values
Precondition:
index >= 0 && index < length
Postcondition:
If compressed:
  • All invalid quality scores will be cast to MIN_QUALITY
  • All N's will be assigned a MIN_QUALITY quality score
  • All MIN_QUALITY scores will be assigned a N seqchar
Exceptions:
ArgumentException_t 
Returns:
void

Definition at line 373 of file Sequence_AMOS.hh.

References AMOS_THROW_ARGUMENT, AMOS::Sequence_t::compress(), AMOS::Sequence_t::isCompressed(), AMOS::Sequence_t::length_m, AMOS::Sequence_t::qual_m, and AMOS::Sequence_t::seq_m.

Referenced by AMOS::Sequence_t::setSequence().

void AMOS::Universal_t::setComment ( const std::string &  comment  )  [inline, inherited]

Set the comment string.

Parameters:
comment The new comment string
Returns:
void

Definition at line 150 of file Universal_AMOS.hh.

void AMOS::IBankable_t::setEID ( const std::string &  eid  )  [inline, inherited]

Set the external ID.

Will only use the characters up to but not including the first newline.

Returns:
void

Definition at line 252 of file Bank_AMOS.hh.

References AMOS::IBankable_t::eid_m, and AMOS::NL_CHAR.

void AMOS::IBankable_t::setFlagA ( bool  flag  )  [inline, inherited]

Set flag A.

Has no effect on the actual object in memory other than setting a flag. This is one of two user accessible flags to be used as needed, the other is flag B.

Parameters:
flag The new flag A value
Returns:
void

Definition at line 272 of file Bank_AMOS.hh.

References AMOS::IBankable_t::flags_m.

Referenced by AMOS::Universal_t::readMessage(), and AMOS::Overlap_t::readMessage().

void AMOS::IBankable_t::setFlagB ( bool  flag  )  [inline, inherited]

Set flag B.

Has no effect on the actual object in memory other than setting a flag. This is one of two user accessible flags to be used as needed, the other is flag A.

Parameters:
flag The new flag B value
Returns:
void

Definition at line 288 of file Bank_AMOS.hh.

References AMOS::IBankable_t::flags_m.

Referenced by AMOS::Universal_t::readMessage(), and AMOS::Overlap_t::readMessage().

void AMOS::IBankable_t::setIID ( ID_t  iid  )  [inline, inherited]

Set the internal ID.

Parameters:
iid The new internal ID
Returns:
void

Definition at line 300 of file Bank_AMOS.hh.

References AMOS::IBankable_t::iid_m.

void AMOS::Contig_t::setReadTiling ( const Layout_t layout  )  [inline]

Set the tiling of underlying reads.

Parameters:
layout The new read layout
Returns:
void

Definition at line 380 of file Contig_AMOS.hh.

void AMOS::Contig_t::setReadTiling ( const std::vector< Tile_t > &  reads  )  [inline]

Set the tiling of underlying reads.

Parameters:
reads The new vector of underlying reads
Returns:
void

Definition at line 368 of file Contig_AMOS.hh.

void AMOS::Contig_t::setSequence ( const std::string &  seq,
const std::string &  qual 
) [inline]

Set the consensus sequence of the contig.

See Sequence_t::setSequence()

Reimplemented from AMOS::Sequence_t.

Definition at line 401 of file Contig_AMOS.hh.

References AMOS::Sequence_t::setSequence().

void AMOS::Contig_t::setSequence ( const char *  seq,
const char *  qual 
) [inline]

Set the consensus sequence of the contig.

See Sequence_t::setSequence()

Reimplemented from AMOS::Sequence_t.

Definition at line 390 of file Contig_AMOS.hh.

References AMOS::Sequence_t::setSequence().

Referenced by insertGapColumn(), and reverseComplement().

void AMOS::Universal_t::setStatus ( Status_t  status  )  [inline, inherited]

Set the status value.

Parameters:
status The new status value
Returns:
void

Definition at line 162 of file Universal_AMOS.hh.

Referenced by AMOS::Universal_t::readMessage().

static std::pair<char, char> AMOS::Sequence_t::uncompress ( uint8_t  byte  )  [inline, static, protected, inherited]

Uncompresses a byte into a sequence and quality char.

Note:
Must work with compress(char,char)
Parameters:
byte The compressed sequence and quality byte
Returns:
The sequence and quality char respectively

Definition at line 93 of file Sequence_AMOS.hh.

References AMOS::Sequence_t::ADENINE_BITS, AMOS::Sequence_t::CYTOSINE_BITS, AMOS::Sequence_t::GUANINE_BITS, AMOS::Qual2Char(), AMOS::Sequence_t::QUAL_BITS, AMOS::Sequence_t::SEQ_BITS, and AMOS::Sequence_t::THYMINE_BITS.

Size_t Contig_t::ungap2gap ( Pos_t  ungap  ) 

Translates an 1-based ungapped position to a 0-based gapped position.

This method requires O(number gaps) time.

Parameters:
The ungapped position
Precondition:
ungap < getUngappedLength( )
Returns:
The gapped position

Definition at line 64 of file Contig_AMOS.cc.

void Contig_t::writeMessage ( Message_t msg  )  const [virtual]

Writes data to a Message object.

Writes the data contained in a Messagable object to a Message object. All previous data in the Message will be cleared or overwritten.

Parameters:
msg The Message to write to
Returns:
void

Reimplemented from AMOS::Sequence_t.

Definition at line 450 of file Contig_AMOS.cc.

References clear(), NCODE, and AMOS::Sequence_t::writeMessage().

virtual void AMOS::Contig_t::writeRecord ( std::ostream &  fix,
std::ostream &  var 
) const [protected, virtual]

Write selected class members to a biserial record.

Writes the fixed and variable length streams to a biserial record. Used in generating a biserial IBankable object, and needed to commit objects to a bank. Should not write the flags, EID, or IID of the object because the bank will handle the storage of these fields on its own.

Note:
This method must be able to produce a biserial record that can be read by its related funtion readRecord.
Parameters:
fix The fixed length stream (stores all fixed length members)
var The variable length stream (stores all var length members)
Returns:
void

Reimplemented from AMOS::Sequence_t.

void AMOS::Contig_t::writeUMD ( std::ostream &  out  )  const

Write a UMD contig message to an output stream.

Writes a University of Maryland style contig message to the output stream. Will throw an exception if there was an error trying to write to the output stream.

Parameters:
out The output stream to write to
Precondition:
The ostream is open and writable
Exceptions:
IOException_t 
Returns:
void


Member Data Documentation

const uint8_t AMOS::Sequence_t::ADENINE_BITS = 0x0 [static, protected, inherited]

'A' bit

Definition at line 47 of file Sequence_AMOS.hh.

Referenced by AMOS::Sequence_t::compress(), and AMOS::Sequence_t::uncompress().

const uint8_t AMOS::Sequence_t::COMPRESS_BIT = 0x1 [static, protected, inherited]

compressed sequence flag

Definition at line 46 of file Sequence_AMOS.hh.

Referenced by AMOS::Sequence_t::clear(), AMOS::Sequence_t::compress(), AMOS::Sequence_t::isCompressed(), and AMOS::Sequence_t::uncompress().

const uint8_t AMOS::Sequence_t::CYTOSINE_BITS = 0x40 [static, protected, inherited]

'C' bit

Definition at line 48 of file Sequence_AMOS.hh.

Referenced by AMOS::Sequence_t::compress(), and AMOS::Sequence_t::uncompress().

std::string AMOS::IBankable_t::eid_m [protected, inherited]

external ID (anything you want sans newlines)

Definition at line 66 of file Bank_AMOS.hh.

Referenced by AMOS::Bank_t::append(), AMOS::IBankable_t::clear(), AMOS::IBankable_t::getEID(), AMOS::BankStream_t::operator<<(), AMOS::BankStream_t::operator>>(), AMOS::Universal_t::readMessage(), AMOS::BankStream_t::replace(), AMOS::Bank_t::replace(), AMOS::BankStream_t::replaceByBID(), AMOS::IBankable_t::setEID(), and AMOS::Universal_t::writeMessage().

BankFlags_t AMOS::IBankable_t::flags_m [protected, inherited]

bank flags, derived classes may use "nibble"

Definition at line 68 of file Bank_AMOS.hh.

Referenced by AMOS::Bank_t::appendBID(), AMOS::Sequence_t::clear(), AMOS::IBankable_t::clear(), AMOS::Sequence_t::compress(), AMOS::Bank_t::fetchBID(), AMOS::Bank_t::fetchBIDFix(), AMOS::Overlap_t::getAdjacency(), AMOS::Link_t::getAdjacency(), AMOS::Sequence_t::isCompressed(), AMOS::IBankable_t::isFlagA(), AMOS::IBankable_t::isFlagB(), AMOS::Overlap_t::isFlagC(), AMOS::IBankable_t::isModified(), AMOS::IBankable_t::isRemoved(), AMOS::BankStream_t::operator<<(), AMOS::BankStream_t::operator>>(), AMOS::Bank_t::replaceBID(), AMOS::Overlap_t::setAdjacency(), AMOS::Link_t::setAdjacency(), AMOS::IBankable_t::setFlagA(), AMOS::IBankable_t::setFlagB(), AMOS::Overlap_t::setFlagC(), and AMOS::Sequence_t::uncompress().

const uint8_t AMOS::Sequence_t::GUANINE_BITS = 0x80 [static, protected, inherited]

'G' bit

Definition at line 49 of file Sequence_AMOS.hh.

Referenced by AMOS::Sequence_t::compress(), and AMOS::Sequence_t::uncompress().

ID_t AMOS::IBankable_t::iid_m [protected, inherited]

internal ID (integer AMOS identifier)

Definition at line 64 of file Bank_AMOS.hh.

Referenced by AMOS::Bank_t::append(), AMOS::IBankable_t::clear(), AMOS::IBankable_t::getIID(), AMOS::IBankable_t::IBankable_t(), AMOS::BankStream_t::operator<<(), AMOS::BankStream_t::operator>>(), AMOS::Universal_t::readMessage(), AMOS::BankStream_t::replace(), AMOS::Bank_t::replace(), AMOS::BankStream_t::replaceByBID(), AMOS::IBankable_t::setIID(), and AMOS::Universal_t::writeMessage().

Size_t AMOS::Sequence_t::length_m [protected, inherited]

length of the sequence and quality data

Definition at line 43 of file Sequence_AMOS.hh.

Referenced by AMOS::Sequence_t::clear(), AMOS::Sequence_t::compress(), AMOS::Sequence_t::getBase(), AMOS::Sequence_t::getGCContent(), getGCContent(), AMOS::Sequence_t::getLength(), AMOS::Sequence_t::getQualString(), AMOS::Sequence_t::getSeqString(), getUngappedLength(), AMOS::Sequence_t::operator=(), AMOS::Sequence_t::Sequence_t(), AMOS::Sequence_t::setBase(), AMOS::Sequence_t::setSequence(), AMOS::Sequence_t::uncompress(), and AMOS::Sequence_t::writeMessage().

const NCode_t Contig_t::NCODE = M_CONTIG [static]

The NCode type identifier for this object.

Reimplemented from AMOS::Sequence_t.

Definition at line 77 of file Contig_AMOS.hh.

Referenced by AMOS::Index_t::buildContigFeature(), AMOS::Index_t::buildContigScaffold(), AMOS::Index_t::buildReadContig(), getNCode(), AMOS::ContigLink_t::getNodeType(), and writeMessage().

const uint8_t AMOS::Sequence_t::QUAL_BITS = 0x3F [static, protected, inherited]

quality bit mask

Definition at line 52 of file Sequence_AMOS.hh.

Referenced by AMOS::Sequence_t::uncompress().

uint8_t* AMOS::Sequence_t::qual_m [protected, inherited]

uncompressed qual data

Definition at line 42 of file Sequence_AMOS.hh.

Referenced by AMOS::Sequence_t::clear(), AMOS::Sequence_t::compress(), AMOS::Sequence_t::getBase(), AMOS::Sequence_t::Sequence_t(), AMOS::Sequence_t::setBase(), AMOS::Sequence_t::setSequence(), and AMOS::Sequence_t::~Sequence_t().

const uint8_t AMOS::Sequence_t::SEQ_BITS = 0xC0 [static, protected, inherited]

sequence bit mask

Definition at line 51 of file Sequence_AMOS.hh.

Referenced by AMOS::Sequence_t::compress(), and AMOS::Sequence_t::uncompress().

uint8_t* AMOS::Sequence_t::seq_m [protected, inherited]

compressed seq and qual data or uncompressed seq

Definition at line 41 of file Sequence_AMOS.hh.

Referenced by AMOS::Sequence_t::clear(), AMOS::Sequence_t::compress(), AMOS::Sequence_t::getBase(), getGCContent(), AMOS::Sequence_t::Sequence_t(), AMOS::Sequence_t::setBase(), and AMOS::Sequence_t::~Sequence_t().

const uint8_t AMOS::Sequence_t::THYMINE_BITS = 0xC0 [static, protected, inherited]

'T' bit

Definition at line 50 of file Sequence_AMOS.hh.

Referenced by AMOS::Sequence_t::compress(), and AMOS::Sequence_t::uncompress().


The documentation for this class was generated from the following files:
Generated on Mon Feb 22 17:36:35 2010 for libAMOS by  doxygen 1.4.7