Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# gnSourceSpec Class Reference

gnSourceSpec stores sequence and annotation data from another source. More...

`#include <gnSourceSpec.h>`

Inheritance diagram for gnSourceSpec:

List of all members.

## Public Member Functions
| gnSourceSpec ()
| Empty constructor.
| gnSourceSpec (gnBaseSource *m_pSource, const uint32 m_ContigIndex=ALL_CONTIGS, const gnSeqI startI=0, const gnSeqI endI=GNSEQI_END, const boolean revComp=false)
| Constructor, creates a gnSourceSpec using sequence data in the given source.
| gnSourceSpec (const gnSourceSpec &s)
| Copy constructor.
| ~gnSourceSpec ()
gnSourceSpec * | Clone () const
virtual void | Clear ()
| Clears all data from this spec.
virtual gnSeqI | GetSourceLength () const
| Get the length of the source for this spec.
virtual gnBaseSource * | GetSource () const
virtual gnSourceSpec * | CloneRange (const gnSeqI startI, const gnSeqI len) const
| Copies a specified range of bases and returns a pointer to the resulting gnSourceSpec.
virtual gnContigSpec * | CloneRange (const uint32 startI, const uint32 len) const=0
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.
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 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 void | SetLength (const gnSeqI len)
| Sets the length of reads into this sequence.
virtual void | SetSourceContigIndex (const uint32 contigI)
| Sets this contig's index in its source sequence.
virtual void | SetReverseComplement (const boolean value)
| Sets the reverse complement bit for this contig.
virtual void | CropStart (gnSeqI cropLen)
| Crop the first cropLen bases from the sequence.
virtual void | CropEnd (gnSeqI cropLen)
| Crop the last cropLen bases from the sequence.
virtual boolean | SeqRead (const gnSeqI start, gnSeqC *buf, uint32 &bufLen, const uint32 contigI) const
| Reads sequence data from this spec.
virtual string | GetName () const
| Get the name of the contig associated with this spec.
virtual void | SetName (const string &name)
| Sets the name for this contig.
virtual boolean | IsReverseComplement () const
| Returns true if this spec is read reverse complement.
virtual boolean | IsCircular () const
| Returns true if this spec's sequence is circular.
virtual void | SetCircular (const boolean value)
| Sets whether this spec should be read circular.
## Protected Member Functions
virtual boolean | Read (const gnSeqI start, gnSeqC *buf, uint32 &bufLen) const
| all derived classes must implement this! it simply reads the specified bases into buf, disregarding circularity and reverse complement.
## Protected Attributes
gnBaseSource * | m_pSource
gnSeqI | m_start
gnSeqI | m_length
uint32 | m_SourceContigIndex
boolean | m_reverseComplement
boolean | m_circular
string | m_name
string | m_sourceName

## Detailed Description

gnSourceSpec stores sequence and annotation data from another source.

See also:
  gnContigSpec

  gnBaseSpec

Definition at line 26 of file gnSourceSpec.h.

## Constructor & Destructor Documentation

gnSourceSpec::gnSourceSpec | ( |  | ) |

| Empty constructor. Definition at line 15 of file gnSourceSpec.cpp. References Clear(). Referenced by Clone(), and CloneRange().

gnSourceSpec::gnSourceSpec | ( | gnBaseSource * | m_pSource,
|  | const uint32 | m_ContigIndex = ALL_CONTIGS,
|  | const gnSeqI | startI = 0,
|  | const gnSeqI | endI = GNSEQI_END,
|  | const boolean | revComp = false
| ) |

  | Constructor, creates a gnSourceSpec using sequence data in the given source. A circular spec will be created if the end index is greater than the start. Parameters:
  m_pSource | The source to read base pairs from.
  m_ContigIndex | The index of the contig in the source, ALL_CONTIGS by default.
  startI | The index to start reading base pairs from the source.
  endI | The index to stop reading base pairs from the source.
  revComp | True if the sequence is read reverse complement.
Definition at line 32 of file gnSourceSpec.cpp. References gnSeqI, gnBaseSpec::m_circular, gnContigSpec::m_length, gnBaseSpec::m_name, m_pSource, gnBaseSpec::m_reverseComplement, gnContigSpec::m_SourceContigIndex, and gnContigSpec::m_start.

gnSourceSpec::gnSourceSpec | ( | const gnSourceSpec & | s | ) |

  | Copy constructor. Parameters:
  s | the gnSourceSpec to copy.
Definition at line 20 of file gnSourceSpec.cpp. References gnBaseSpec::m_circular, gnContigSpec::m_length, gnBaseSpec::m_name, m_pSource, gnBaseSpec::m_reverseComplement, gnContigSpec::m_SourceContigIndex, gnBaseSpec::m_sourceName, and gnContigSpec::m_start.

gnSourceSpec::~gnSourceSpec | ( |  | ) |

| Definition at line 62 of file gnSourceSpec.cpp.

## Member Function Documentation

void gnSourceSpec::Clear | ( |  | ) | `[virtual]`

| Clears all data from this spec. Reimplemented from gnContigSpec. Definition at line 66 of file gnSourceSpec.cpp. References gnContigSpec::Clear(), m_pSource, and gnContigSpec::m_SourceContigIndex. Referenced by gnSourceSpec().

gnSourceSpec * gnSourceSpec::Clone | ( |  | ) | const`[inline, virtual]`

| Implements gnContigSpec. Definition at line 73 of file gnSourceSpec.h. References gnSourceSpec().

virtual gnContigSpec* gnContigSpec::CloneRange | ( | const uint32 | startI,
|  | const uint32 | len
| ) | const`[pure virtual, inherited]`

| Implements gnBaseSpec. Referenced by gnFragmentSpec::CloneRange().

gnSourceSpec * gnSourceSpec::CloneRange | ( | const gnSeqI | startI,
|  | const gnSeqI | len
| ) | const`[virtual]`

  | Copies a specified range of bases and returns a pointer to the resulting gnSourceSpec. You must delete the copy when you are finished with it. Parameters:
  startI | The first base pair to copy
  len | The length of the piece to copy
Returns: A copy of the gnSourceSpec containing only the specified bases Definition at line 73 of file gnSourceSpec.cpp. References gnSourceSpec(), gnBaseSpec::m_circular, gnContigSpec::m_length, gnBaseSpec::m_name, m_pSource, gnBaseSpec::m_reverseComplement, gnContigSpec::m_SourceContigIndex, gnBaseSpec::m_sourceName, and gnContigSpec::m_start.

void gnContigSpec::CropEnd | ( | gnSeqI | cropLen | ) | `[virtual, inherited]`

  | 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 gnContigSpec::m_length.

void gnContigSpec::CropStart | ( | gnSeqI | cropLen | ) | `[virtual, inherited]`

  | 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 gnContigSpec::GetSourceLength(), gnContigSpec::m_length, gnBaseSpec::m_reverseComplement, and gnContigSpec::m_start.

gnSeqI gnContigSpec::GetLength | ( |  | ) | const`[inline, virtual, inherited]`

| 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 gnContigSpec::m_length. Referenced by gnFragmentSpec::CloneRange(), gnSEQSource::ParseStream(), and gnGBKSource::ParseStream().

string gnBaseSpec::GetName | ( |  | ) | const`[inline, virtual, inherited]`

| Get the name of the contig associated with this spec. Returns: The contig name or an empty string if none exists. Definition at line 116 of file gnBaseSpec.h. References gnBaseSpec::m_name. Referenced by gnSequence::contigName(), gnDNXSource::GetContigID(), gnDNXSource::GetContigName(), gnMultiSpec::GetSpecIndexByName(), gnDNXSource::HasContig(), gnGBKSource::Write(), and gnDNXSource::Write().

gnBaseSource * gnSourceSpec::GetSource | ( |  | ) | const`[inline, virtual]`

| Definition at line 82 of file gnSourceSpec.h. References m_pSource.

uint32 gnContigSpec::GetSourceContigIndex | ( |  | ) | const`[inline, virtual, inherited]`

| 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 gnContigSpec::m_SourceContigIndex, and uint32. Referenced by gnSequence::globalToSource().

gnSeqI gnSourceSpec::GetSourceLength | ( |  | ) | const`[inline, virtual]`

| Get the length of the source for this spec. Returns: The source length. Implements gnContigSpec. Definition at line 78 of file gnSourceSpec.h. References gnBaseSource::GetContigSeqLength(), gnSeqI, and m_pSource.

string gnContigSpec::GetSourceName | ( |  | ) | const`[inline, virtual, inherited]`

| 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. References gnBaseSpec::m_sourceName.

gnSeqI gnContigSpec::GetStart | ( |  | ) | const`[inline, virtual, inherited]`

| 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 gnContigSpec::m_start. Referenced by gnSequence::globalToSource().

boolean gnBaseSpec::IsCircular | ( |  | ) | const`[inline, virtual, inherited]`

| Returns true if this spec's sequence is circular. Returns: True if this spec's sequence is circular. Definition at line 128 of file gnBaseSpec.h. References gnBaseSpec::m_circular. Referenced by gnSequence::isCircular(), and gnGBKSource::Write().

boolean gnBaseSpec::IsReverseComplement | ( |  | ) | const`[inline, virtual, inherited]`

| Returns true if this spec is read reverse complement. Returns: True if this spec is read reverse complement. Definition at line 124 of file gnBaseSpec.h. References gnBaseSpec::m_reverseComplement. Referenced by gnSequence::globalToSource(), gnSequence::isReverseComplement(), gnGenomeSpec::SetReverseComplement(), and gnFragmentSpec::SetReverseComplement().

boolean gnSourceSpec::Read | ( | const gnSeqI | start,
|  | gnSeqC * | buf,
|  | uint32 & | bufLen
| ) | const`[inline, protected, virtual]`

| all derived classes must implement this! it simply reads the specified bases into buf, disregarding circularity and reverse complement. Implements gnContigSpec. Definition at line 88 of file gnSourceSpec.h. References m_pSource, and gnBaseSource::SeqRead().

boolean gnContigSpec::SeqRead | ( | const gnSeqI | start,
|  | gnSeqC * | buf,
|  | uint32 & | bufLen,
|  | const uint32 | contigI
| ) | const`[virtual, inherited]`

  | 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(), gnContigSpec::GetSourceLength(), gnSeqI, gnContigSpec::m_length, gnBaseSpec::m_reverseComplement, gnContigSpec::m_start, gnContigSpec::Read(), and gnFilter::ReverseFilter().

void gnBaseSpec::SetCircular | ( | const boolean | value | ) | `[inline, virtual, inherited]`

  | Sets whether this spec should be read circular. If circular is set, reads beyond the end of this spec will pick up at the beginning and read up to the start index. Parameters:
  value | True for circular, false otherwise.
Definition at line 132 of file gnBaseSpec.h. References gnBaseSpec::m_circular. Referenced by gnSEQSource::ParseStream(), gnGBKSource::ParseStream(), and gnSequence::setCircular().

void gnContigSpec::SetLength | ( | const gnSeqI | len | ) | `[inline, virtual, inherited]`

  | 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 gnContigSpec::m_length. Referenced by gnSEQSource::ParseStream(), and gnGBKSource::ParseStream().

void gnBaseSpec::SetName | ( | const string & | name | ) | `[inline, virtual, inherited]`

  | Sets the name for this contig. Parameters:
  name | The new name.
Returns: True if successful. Honestly, I don't know how this could be unsuccessful... Definition at line 120 of file gnBaseSpec.h. References gnBaseSpec::m_name. Referenced by gnFASSource::GetSpec(), gnSEQSource::ParseStream(), gnGBKSource::ParseStream(), gnDNXSource::ParseStream(), and gnSequence::setContigName().

void gnContigSpec::SetReverseComplement | ( | const boolean | value | ) | `[virtual, inherited]`

  | 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 gnContigSpec::GetSourceLength(), gnContigSpec::m_length, gnBaseSpec::m_reverseComplement, and gnContigSpec::m_start. Referenced by gnFragmentSpec::SetReverseComplement().

void gnContigSpec::SetSourceContigIndex | ( | const uint32 | contigI | ) | `[inline, virtual, inherited]`

  | 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 gnContigSpec::m_SourceContigIndex.

void gnContigSpec::SetSourceName | ( | const string & | sourceName | ) | `[inline, virtual, inherited]`

  | 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. References gnBaseSpec::m_sourceName. Referenced by gnFASSource::GetSpec(), gnSEQSource::ParseStream(), gnRAWSource::ParseStream(), gnGBKSource::ParseStream(), and gnDNXSource::ParseStream().

void gnContigSpec::SetStart | ( | const gnSeqI | start | ) | `[inline, virtual, inherited]`

  | 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 gnContigSpec::m_start.

## Member Data Documentation

boolean gnBaseSpec::m_circular`[protected, inherited]`

| Definition at line 108 of file gnBaseSpec.h. Referenced by gnBaseSpec::Clear(), gnStringSpec::CloneRange(), CloneRange(), gnFragmentSpec::gnFragmentSpec(), gnGenomeSpec::gnGenomeSpec(), gnSourceSpec(), gnStringSpec::gnStringSpec(), gnBaseSpec::IsCircular(), and gnBaseSpec::SetCircular().

gnSeqI gnContigSpec::m_length`[protected, inherited]`

| Definition at line 104 of file gnContigSpec.h. Referenced by gnContigSpec::Clear(), gnStringSpec::CloneRange(), CloneRange(), gnContigSpec::CropEnd(), gnContigSpec::CropStart(), gnContigSpec::GetLength(), gnSourceSpec(), gnStringSpec::gnStringSpec(), gnContigSpec::SeqRead(), gnContigSpec::SetLength(), and gnContigSpec::SetReverseComplement().

string gnBaseSpec::m_name`[protected, inherited]`

| Definition at line 110 of file gnBaseSpec.h. Referenced by gnBaseSpec::Clear(), gnStringSpec::CloneRange(), CloneRange(), gnBaseSpec::GetName(), gnFragmentSpec::gnFragmentSpec(), gnGenomeSpec::gnGenomeSpec(), gnSourceSpec(), gnStringSpec::gnStringSpec(), and gnBaseSpec::SetName().

gnBaseSource* gnSourceSpec::m_pSource`[protected]`

| Definition at line 68 of file gnSourceSpec.h. Referenced by Clear(), CloneRange(), GetSource(), GetSourceLength(), gnSourceSpec(), and Read().

boolean gnBaseSpec::m_reverseComplement`[protected, inherited]`

| Definition at line 107 of file gnBaseSpec.h. Referenced by gnBaseSpec::Clear(), gnStringSpec::CloneRange(), CloneRange(), gnContigSpec::CropStart(), gnFragmentSpec::gnFragmentSpec(), gnGenomeSpec::gnGenomeSpec(), gnSourceSpec(), gnStringSpec::gnStringSpec(), gnBaseSpec::IsReverseComplement(), gnContigSpec::SeqRead(), gnGenomeSpec::SetReverseComplement(), gnFragmentSpec::SetReverseComplement(), and gnContigSpec::SetReverseComplement().

uint32 gnContigSpec::m_SourceContigIndex`[protected, inherited]`

| Definition at line 105 of file gnContigSpec.h. Referenced by Clear(), gnContigSpec::Clear(), gnStringSpec::CloneRange(), CloneRange(), gnContigSpec::GetSourceContigIndex(), gnSourceSpec(), gnStringSpec::gnStringSpec(), and gnContigSpec::SetSourceContigIndex().

string gnBaseSpec::m_sourceName`[protected, inherited]`

| Reimplemented in gnMultiSpec. Definition at line 111 of file gnBaseSpec.h. Referenced by gnBaseSpec::Clear(), gnStringSpec::CloneRange(), CloneRange(), gnContigSpec::GetSourceName(), gnSourceSpec(), gnStringSpec::gnStringSpec(), and gnContigSpec::SetSourceName().

gnSeqI gnContigSpec::m_start`[protected, inherited]`

| Definition at line 103 of file gnContigSpec.h. Referenced by gnContigSpec::Clear(), gnStringSpec::CloneRange(), CloneRange(), gnContigSpec::CropStart(), gnContigSpec::GetStart(), gnSourceSpec(), gnStringSpec::gnStringSpec(), gnContigSpec::SeqRead(), gnContigSpec::SetReverseComplement(), and gnContigSpec::SetStart().

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

- gnSourceSpec.h
- gnSourceSpec.cpp