AMOS::Overlap_t Class Reference

An overlap relation between to sequencing reads. More...

#include <Overlap_AMOS.hh>

Inheritance diagram for AMOS::Overlap_t:

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

Public Member Functions

 Overlap_t ()
 Constructs an empty Overlap_t object.
 Overlap_t (const Overlap_t &source)
 Copy constructor.
 ~Overlap_t ()
 Destroys a Overlap_t object.
virtual void clear ()
 Clears all object data, reinitializes the object.
void flip ()
 Flip the orientation of the overlap.
OverlapAdjacency_t getAdjacency () const
 Get the overlapping ends of the reads.
Size_t getAhang () const
 Get the A-hang overlap value.
Size_t getBhang () const
 Get the B-hang overlap value.
virtual NCode_t getNCode () const
 Get the AMOS NCode type identifier.
std::pair< ID_t, ID_tgetReads () const
 Get the pair of contig IIDs joined by this overlap.
uint32_t getScore () const
 Get the overlap score.
bool isFlagC () const
 Check the value of flag C.
virtual void readMessage (const Message_t &msg)
 Reads in data from a Message object.
void setAdjacency (OverlapAdjacency_t adj)
 Set the overlapping ends of the reads.
void setAhang (Size_t aHang)
 Set the A-hang overlap value.
void setBhang (Size_t bHang)
 Set the B-hang overlap value.
void setFlagC (bool flag)
 Set the value of flag C.
void setReads (std::pair< ID_t, ID_t > reads)
 Set the read IID pair for this overlap.
void setScore (uint32_t score)
 Set the overlap score.
virtual void writeMessage (Message_t &msg) const
 Writes data to a Message object.
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_OVERLAP
 The NCode type identifier for this object.
static const OverlapAdjacency_t NULL_ADJACENCY = 0
static const OverlapAdjacency_t NORMAL = 'N'
 E,B.
static const OverlapAdjacency_t ANTINORMAL = 'A'
 B,E.
static const OverlapAdjacency_t INNIE = 'I'
 E,E.
static const OverlapAdjacency_t OUTIE = 'O'
 B,B.

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.

Protected Attributes

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 NORMAL_BITS = 0x1
static const uint8_t ANTINORMAL_BITS = 0x2
static const uint8_t INNIE_BITS = 0x3
static const uint8_t OUTIE_BITS = 0x0
static const uint8_t ADJACENCY_BITS = 0x3
 adjacency info mask
static const uint8_t ADJACENCY_BIT = 0x4
 adjacency exists flag
static const uint8_t FLAGC_BIT = 0x8
 C flag.

Detailed Description

An overlap relation between to sequencing reads.

A similarity based overlap between two Read_t that suggests their relative location (to one another) in the original sequence. If storing a large number of overlaps in an AMOS bank, it is wise to omit the IID and EID fields from the objects as these values will only be written to the bank if they are non-NULL. Also, an extra bit flag (FlagC) is provided in addition to FlagA and FlagB which are inherited.

Definition at line 33 of file Overlap_AMOS.hh.


Constructor & Destructor Documentation

AMOS::Overlap_t::Overlap_t (  )  [inline]

Constructs an empty Overlap_t object.

Sets all members to 0

Definition at line 83 of file Overlap_AMOS.hh.

References AMOS::NULL_ID.

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

Copy constructor.

Definition at line 94 of file Overlap_AMOS.hh.

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

Destroys a Overlap_t object.

Definition at line 103 of file Overlap_AMOS.hh.


Member Function Documentation

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

Clears all object data, reinitializes the object.

Reimplemented from AMOS::Universal_t.

Definition at line 110 of file Overlap_AMOS.hh.

References AMOS::Universal_t::clear(), and AMOS::NULL_ID.

Referenced by readMessage(), and writeMessage().

void Overlap_t::flip (  ) 

Flip the orientation of the overlap.

Reverses the order of the read IIDs and changes the overlap adjacency as altered by the new orientation of the reads. Does not alter adjacency if it is currently a NULL_ADJACENCY. Also, swaps the a/bHang values. After flip, NORMAL becomes ANTINORMAL, ANTINORMAL becomes NORMAL, and INNIE and OUTIE remain the same.

Returns:
void

Definition at line 22 of file Overlap_AMOS.cc.

References ANTINORMAL, getAdjacency(), NORMAL, and setAdjacency().

OverlapAdjacency_t Overlap_t::getAdjacency (  )  const

Get the overlapping ends of the reads.

Get the overlap information for the reads, i.e. [N]ORMAL (EB), [A]NTINORMAL (BE), [I]NNIE (EE) or [O]UTIE (BB). Where B is the beginning of the read and E is the end of the read and [N]ORMAL means the end of read1 overlaps the beginning of read2.

Returns:
The pair of adjacent ends

Definition at line 39 of file Overlap_AMOS.cc.

References ADJACENCY_BIT, ADJACENCY_BITS, ANTINORMAL, ANTINORMAL_BITS, AMOS::IBankable_t::flags_m, INNIE, INNIE_BITS, NORMAL, NORMAL_BITS, NULL_ADJACENCY, OUTIE, and OUTIE_BITS.

Referenced by flip(), and writeMessage().

Size_t AMOS::Overlap_t::getAhang (  )  const [inline]

Get the A-hang overlap value.

Get the length of the non-overlapping portion of the first read.

Returns:
The A-hang overlap value

Definition at line 153 of file Overlap_AMOS.hh.

Size_t AMOS::Overlap_t::getBhang (  )  const [inline]

Get the B-hang overlap value.

Get the length of the non-overlapping portion of the second read.

Returns:
The B-hang overlap value

Definition at line 166 of file Overlap_AMOS.hh.

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

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

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

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

Get the AMOS NCode type identifier.

Returns:
The AMOS NCode type identifier

Reimplemented from AMOS::Universal_t.

Definition at line 173 of file Overlap_AMOS.hh.

References NCODE.

std::pair<ID_t, ID_t> AMOS::Overlap_t::getReads (  )  const [inline]

Get the pair of contig IIDs joined by this overlap.

Returns:
The first and second read IIDs joined by this overlap

Definition at line 184 of file Overlap_AMOS.hh.

uint32_t AMOS::Overlap_t::getScore (  )  const [inline]

Get the overlap score.

Returns:
A 32-bit unsigned integer representing the overlap score

Definition at line 195 of file Overlap_AMOS.hh.

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.

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 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 writeMessage().

bool AMOS::Overlap_t::isFlagC (  )  const [inline]

Check the value of flag C.

Returns:
The value of flag C

Definition at line 206 of file Overlap_AMOS.hh.

References FLAGC_BIT, and AMOS::IBankable_t::flags_m.

Referenced by 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 Overlap_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::Universal_t.

Definition at line 56 of file Overlap_AMOS.cc.

References AMOS_THROW_ARGUMENT, clear(), AMOS::F_ADJACENCY, AMOS::F_AHANG, AMOS::F_BHANG, AMOS::F_FLAG, AMOS::F_READS, AMOS::F_SCORE, AMOS::Universal_t::readMessage(), setAdjacency(), AMOS::IBankable_t::setFlagA(), AMOS::IBankable_t::setFlagB(), and setFlagC().

virtual void AMOS::Overlap_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::Universal_t.

virtual void AMOS::Overlap_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::Universal_t.

void Overlap_t::setAdjacency ( OverlapAdjacency_t  adj  ) 

Set the overlapping ends of the reads.

Set the overlap information for the reads, i.e. [N]ORMAL (EB), [A]NTINORMAL (BE), [I]NNIE (EE) or [O]UTIE (BB). Where B is the beginning of the read and E is the end of the read and EB would mean the end of read1 overlaps the beginning of read2.

Note:
Will store info in nibble portion of BankFlags
Parameters:
adj The new adjacency of the reads
Precondition:
adj must be one of [NAIO]
Exceptions:
ArgumentException_t 
Returns:
void

Definition at line 156 of file Overlap_AMOS.cc.

References ADJACENCY_BIT, ADJACENCY_BITS, AMOS_THROW_ARGUMENT, ANTINORMAL, ANTINORMAL_BITS, AMOS::IBankable_t::flags_m, INNIE, INNIE_BITS, NORMAL, NORMAL_BITS, NULL_ADJACENCY, OUTIE, and OUTIE_BITS.

Referenced by flip(), and readMessage().

void AMOS::Overlap_t::setAhang ( Size_t  aHang  )  [inline]

Set the A-hang overlap value.

Set the length of the non-overlapping portion of the first read.

Parameters:
aHang The new A-hang overlap value
Returns:
The new A-hang overlap value

Definition at line 242 of file Overlap_AMOS.hh.

void AMOS::Overlap_t::setBhang ( Size_t  bHang  )  [inline]

Set the B-hang overlap value.

Set the length of the non-overlapping portion of the second read.

Parameters:
bHang The new B-hang overlap value
Returns:
The new B-hang overlap value

Definition at line 256 of file Overlap_AMOS.hh.

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 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 readMessage().

void AMOS::Overlap_t::setFlagC ( bool  flag  )  [inline]

Set the value of flag C.

Parameters:
flag The new flag C value
Returns:
void

Definition at line 268 of file Overlap_AMOS.hh.

References FLAGC_BIT, and AMOS::IBankable_t::flags_m.

Referenced by 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::Overlap_t::setReads ( std::pair< ID_t, ID_t reads  )  [inline]

Set the read IID pair for this overlap.

Parameters:
reads The new pair of read IIDs

Definition at line 282 of file Overlap_AMOS.hh.

void AMOS::Overlap_t::setScore ( uint32_t  score  )  [inline]

Set the overlap score.

Parameters:
score A 32-bit unsigned integer representing the overlap score
Returns:
void

Definition at line 294 of file Overlap_AMOS.hh.

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

void Overlap_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::Universal_t.

Definition at line 179 of file Overlap_AMOS.cc.

References clear(), AMOS::F_ADJACENCY, AMOS::F_AHANG, AMOS::F_BHANG, AMOS::F_FLAG, AMOS::F_READS, AMOS::F_SCORE, getAdjacency(), AMOS::IBankable_t::isFlagA(), AMOS::IBankable_t::isFlagB(), isFlagC(), NCODE, NULL_ADJACENCY, AMOS::NULL_ID, AMOS::NULL_STRING, and AMOS::Universal_t::writeMessage().

virtual void AMOS::Overlap_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::Universal_t.


Member Data Documentation

const uint8_t AMOS::Overlap_t::ADJACENCY_BIT = 0x4 [static, protected]

adjacency exists flag

Definition at line 51 of file Overlap_AMOS.hh.

Referenced by getAdjacency(), and setAdjacency().

const uint8_t AMOS::Overlap_t::ADJACENCY_BITS = 0x3 [static, protected]

adjacency info mask

Definition at line 50 of file Overlap_AMOS.hh.

Referenced by getAdjacency(), and setAdjacency().

const OverlapAdjacency_t AMOS::Overlap_t::ANTINORMAL = 'A' [static]

B,E.

Definition at line 73 of file Overlap_AMOS.hh.

Referenced by flip(), getAdjacency(), and setAdjacency().

const uint8_t AMOS::Overlap_t::ANTINORMAL_BITS = 0x2 [static, protected]

Definition at line 47 of file Overlap_AMOS.hh.

Referenced by getAdjacency(), and setAdjacency().

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

const uint8_t AMOS::Overlap_t::FLAGC_BIT = 0x8 [static, protected]

C flag.

Definition at line 52 of file Overlap_AMOS.hh.

Referenced by isFlagC(), and setFlagC().

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(), getAdjacency(), AMOS::Link_t::getAdjacency(), AMOS::Sequence_t::isCompressed(), AMOS::IBankable_t::isFlagA(), AMOS::IBankable_t::isFlagB(), isFlagC(), AMOS::IBankable_t::isModified(), AMOS::IBankable_t::isRemoved(), AMOS::BankStream_t::operator<<(), AMOS::BankStream_t::operator>>(), AMOS::Bank_t::replaceBID(), setAdjacency(), AMOS::Link_t::setAdjacency(), AMOS::IBankable_t::setFlagA(), AMOS::IBankable_t::setFlagB(), setFlagC(), 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().

const OverlapAdjacency_t AMOS::Overlap_t::INNIE = 'I' [static]

E,E.

Definition at line 74 of file Overlap_AMOS.hh.

Referenced by getAdjacency(), and setAdjacency().

const uint8_t AMOS::Overlap_t::INNIE_BITS = 0x3 [static, protected]

Definition at line 48 of file Overlap_AMOS.hh.

Referenced by getAdjacency(), and setAdjacency().

const NCode_t Overlap_t::NCODE = M_OVERLAP [static]

The NCode type identifier for this object.

Reimplemented from AMOS::Universal_t.

Definition at line 69 of file Overlap_AMOS.hh.

Referenced by getNCode(), and writeMessage().

const OverlapAdjacency_t AMOS::Overlap_t::NORMAL = 'N' [static]

E,B.

Definition at line 72 of file Overlap_AMOS.hh.

Referenced by flip(), getAdjacency(), and setAdjacency().

const uint8_t AMOS::Overlap_t::NORMAL_BITS = 0x1 [static, protected]

Definition at line 46 of file Overlap_AMOS.hh.

Referenced by getAdjacency(), and setAdjacency().

const OverlapAdjacency_t AMOS::Overlap_t::NULL_ADJACENCY = 0 [static]

Definition at line 71 of file Overlap_AMOS.hh.

Referenced by getAdjacency(), setAdjacency(), and writeMessage().

const OverlapAdjacency_t AMOS::Overlap_t::OUTIE = 'O' [static]

B,B.

Definition at line 75 of file Overlap_AMOS.hh.

Referenced by getAdjacency(), and setAdjacency().

const uint8_t AMOS::Overlap_t::OUTIE_BITS = 0x0 [static, protected]

Definition at line 49 of file Overlap_AMOS.hh.

Referenced by getAdjacency(), and setAdjacency().


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