gnContigSpec Class Reference

gnContigSpec is an interface for classes which store contigs, or reads, of DNA or protein sequence More...

#include <gnContigSpec.h>

Inheritance diagram for gnContigSpec:

Inheritance graph
[legend]
Collaboration diagram for gnContigSpec:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void Clear ()
 Clears all data from this spec.
virtual gnContigSpecClone () const =0
virtual gnContigSpecCloneRange (const gnSeqI startI, const gnSeqI len) const =0
virtual void CropEnd (gnSeqI cropLen)
 Crop the last cropLen bases from the sequence.
virtual void CropStart (gnSeqI cropLen)
 Crop the first cropLen bases from the sequence.
virtual gnSeqI GetLength () const
 Get the length of this contig inside of the sequence data.
virtual uint32 GetSourceContigIndex () const
 Returns this contig's index in its source sequence.
virtual gnSeqI GetSourceLength () const =0
 Get the length of the source for this spec.
virtual string GetSourceName () const
 Get the name of the source associated with this spec.
virtual gnSeqI GetStart () const
 Get the base pair index where this contig starts inside of the sequence data.
 gnContigSpec ()
virtual boolean SeqRead (const gnSeqI start, gnSeqC *buf, gnSeqI &bufLen, const uint32 contigI) const
 Reads sequence data from this spec.
virtual void SetLength (const gnSeqI len)
 Sets the length of reads into this sequence.
virtual void SetReverseComplement (const boolean value)
 Sets the reverse complement bit for this contig.
virtual void SetSourceContigIndex (const uint32 contigI)
 Sets this contig's index in its source sequence.
virtual void SetSourceName (const string &sourceName)
 Sets the name of the source associated with this contig.
virtual void SetStart (const gnSeqI start)
 Sets the starting base pair to read from in the contig's sequence.
virtual ~gnContigSpec ()
 Destructor, frees memory.

Protected Member Functions

virtual boolean Read (const gnSeqI start, gnSeqC *buf, gnSeqI &bufLen) const =0
 all derived classes must implement this! it simply reads the specified bases into buf, disregarding circularity and reverse complement.

Protected Attributes

gnSeqI m_length
uint32 m_SourceContigIndex
gnSeqI m_start

Detailed Description

gnContigSpec is an interface for classes which store contigs, or reads, of DNA or protein sequence

Definition at line 27 of file gnContigSpec.h.


Constructor & Destructor Documentation

gnContigSpec::gnContigSpec  )  [inline]
 

Definition at line 30 of file gnContigSpec.h.

virtual gnContigSpec::~gnContigSpec  )  [inline, virtual]
 

Destructor, frees memory.

Definition at line 34 of file gnContigSpec.h.


Member Function Documentation

void gnContigSpec::Clear  )  [virtual]
 

Clears all data from this spec.

Reimplemented from gnBaseSpec.

Reimplemented in gnSourceSpec, and gnStringSpec.

Definition at line 60 of file gnContigSpec.cpp.

References gnBaseSpec::Clear(), m_length, m_SourceContigIndex, and m_start.

Referenced by gnStringSpec::Clear(), gnSourceSpec::Clear(), and gnStringSpec::gnStringSpec().

virtual gnContigSpec* gnContigSpec::Clone  )  const [pure virtual]
 

Implements gnBaseSpec.

Implemented in gnSourceSpec, and gnStringSpec.

Referenced by gnSequence::gnSequence().

virtual gnContigSpec* gnContigSpec::CloneRange const gnSeqI  startI,
const gnSeqI  len
const [pure virtual]
 

Implements gnBaseSpec.

Implemented in gnSourceSpec, and gnStringSpec.

Referenced by gnFragmentSpec::CloneRange().

void gnContigSpec::CropEnd gnSeqI  cropLen  )  [virtual]
 

Crop the last cropLen bases from the sequence.

CropEnd will delete features and headers associated with the cropped bases.

Parameters:
cropLen The number of base pairs to delete from the end.

Implements gnBaseSpec.

Definition at line 22 of file gnContigSpec.cpp.

References gnSeqI, and m_length.

void gnContigSpec::CropStart gnSeqI  cropLen  )  [virtual]
 

Crop the first cropLen bases from the sequence.

CropStart will delete features and headers associated with the cropped bases.

Parameters:
cropLen The number of base pairs to delete from the beginning.

Implements gnBaseSpec.

Definition at line 16 of file gnContigSpec.cpp.

References GetSourceLength(), gnSeqI, m_length, and m_start.

gnSeqI gnContigSpec::GetLength  )  const [inline, virtual]
 

Get the length of this contig inside of the sequence data.

Returns:
This contigs length.

Implements gnBaseSpec.

Definition at line 133 of file gnContigSpec.h.

References gnSeqI, and m_length.

Referenced by gnFragmentSpec::CloneRange(), gnSEQSource::ParseStream(), and gnGBKSource::ParseStream().

uint32 gnContigSpec::GetSourceContigIndex  )  const [inline, virtual]
 

Returns this contig's index in its source sequence.

Returns:
This contig's index in the source sequence.
Definition at line 149 of file gnContigSpec.h.

References m_SourceContigIndex, and uint32.

Referenced by gnSequence::globalToSource().

virtual gnSeqI gnContigSpec::GetSourceLength  )  const [pure virtual]
 

Get the length of the source for this spec.

Returns:
The source length.

Implemented in gnSourceSpec, and gnStringSpec.

Referenced by CropStart(), gnSequence::globalToSource(), SeqRead(), and SetReverseComplement().

string gnContigSpec::GetSourceName  )  const [inline, virtual]
 

Get the name of the source associated with this spec.

Returns:
The source name or an empty string if none exists.
Definition at line 119 of file gnContigSpec.h.

gnSeqI gnContigSpec::GetStart  )  const [inline, virtual]
 

Get the base pair index where this contig starts inside of the sequence data.

Returns:
The starting base pair.
Definition at line 128 of file gnContigSpec.h.

References gnSeqI, and m_start.

Referenced by gnSequence::globalToSource().

virtual boolean gnContigSpec::Read const gnSeqI  start,
gnSeqC buf,
gnSeqI bufLen
const [protected, pure virtual]
 

all derived classes must implement this! it simply reads the specified bases into buf, disregarding circularity and reverse complement.

Implemented in gnSourceSpec, and gnStringSpec.

Referenced by SeqRead().

boolean gnContigSpec::SeqRead const gnSeqI  start,
gnSeqC buf,
gnSeqI bufLen,
const uint32  contigI
const [virtual]
 

Reads sequence data from this spec.

SeqRead will attempt to read "bufLen" base pairs starting at "start", an offset into the sequence. Reading inside a specific contig can be accomplished by supplying the "contigI" parameter with a valid contig index. SeqRead stores the sequence data in "buf" and returns the actual number of bases read in "bufLen". SeqRead will return false if a serious error occurs.

Parameters:
start The base pair to start reading at.
buf The character array to store base pairs into.
bufLen The number of base pairs to read. This will be modified to reflect the actual number of bases read.
contigI The index of the subspec to read or ALL_CONTIGS by default.
Returns:
True if the operation was successful.

Implements gnBaseSpec.

Definition at line 34 of file gnContigSpec.cpp.

References gnFilter::DNAComplementFilter(), GetSourceLength(), gnSeqC, gnSeqI, m_length, m_start, Read(), gnFilter::ReverseFilter(), and uint32.

void gnContigSpec::SetLength const gnSeqI  len  )  [inline, virtual]
 

Sets the length of reads into this sequence.

This does not affect the actual sequence data but only how much of it is used in this contig.

Parameters:
len The new sequence length.
Returns:
True if successful.
Definition at line 144 of file gnContigSpec.h.

References gnSeqI, and m_length.

Referenced by gnSEQSource::ParseStream(), and gnGBKSource::ParseStream().

void gnContigSpec::SetReverseComplement const boolean  value  )  [virtual]
 

Sets the reverse complement bit for this contig.

This routine will translate the start index to the reverse base pair.

Parameters:
value True for reverse complement, false otherwise.
Returns:
True if successful.

Implements gnBaseSpec.

Definition at line 26 of file gnContigSpec.cpp.

References GetSourceLength(), m_length, and m_start.

Referenced by gnFragmentSpec::SetReverseComplement().

void gnContigSpec::SetSourceContigIndex const uint32  contigI  )  [inline, virtual]
 

Sets this contig's index in its source sequence.

Parameters:
contigI This contig's index in the source sequence.
Definition at line 153 of file gnContigSpec.h.

References m_SourceContigIndex, and uint32.

void gnContigSpec::SetSourceName const string &  sourceName  )  [inline, virtual]
 

Sets the name of the source associated with this contig.

Parameters:
sourceName The new name.
Returns:
True if successful.
Definition at line 123 of file gnContigSpec.h.

Referenced by gnFASSource::GetSpec(), gnSEQSource::ParseStream(), gnRAWSource::ParseStream(), gnGBKSource::ParseStream(), and gnDNXSource::ParseStream().

void gnContigSpec::SetStart const gnSeqI  start  )  [inline, virtual]
 

Sets the starting base pair to read from in the contig's sequence.

This does not affect the actual sequence data but only where to begin using it in this contig.

Parameters:
start The new starting base pair.
Returns:
True if successful.
Definition at line 139 of file gnContigSpec.h.

References gnSeqI, and m_start.


Member Data Documentation

gnSeqI gnContigSpec::m_length [protected]
 

Definition at line 104 of file gnContigSpec.h.

Referenced by Clear(), gnStringSpec::CloneRange(), gnSourceSpec::CloneRange(), CropEnd(), CropStart(), GetLength(), gnSourceSpec::gnSourceSpec(), gnStringSpec::gnStringSpec(), SeqRead(), SetLength(), and SetReverseComplement().

uint32 gnContigSpec::m_SourceContigIndex [protected]
 

Definition at line 105 of file gnContigSpec.h.

Referenced by Clear(), gnStringSpec::CloneRange(), gnSourceSpec::CloneRange(), GetSourceContigIndex(), gnSourceSpec::gnSourceSpec(), gnStringSpec::gnStringSpec(), and SetSourceContigIndex().

gnSeqI gnContigSpec::m_start [protected]
 

Definition at line 103 of file gnContigSpec.h.

Referenced by Clear(), gnStringSpec::CloneRange(), gnSourceSpec::CloneRange(), CropStart(), GetStart(), gnSourceSpec::gnSourceSpec(), gnStringSpec::gnStringSpec(), SeqRead(), SetReverseComplement(), and SetStart().


The documentation for this class was generated from the following files:
Generated on Mon Feb 14 19:29:48 2005 for libGenome by doxygen 1.3.8