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

gnGenomeSpec Class Reference

This class contains references to the sequence data, annotation, and other related header data for an organism's genome. More...

#include <gnGenomeSpec.h>

Inheritance diagram for gnGenomeSpec:

gnMultiSpec gnBaseSpec gnClone List of all members.

Public Member Functions

 gnGenomeSpec ()
 gnGenomeSpec (const gnGenomeSpec &s)
 Copy constructor.

virtual ~gnGenomeSpec ()
 Destructor, frees memory.

virtual gnGenomeSpec * Clone () const
virtual void Clear ()
 Clears all data from this spec.

virtual void SetReverseComplement (const boolean value)
 Sets the reverse complement bit for this spec.

virtual uint32 GetSpecListLength () const
 Returns the number of subspecs this spec contains.

virtual gnFragmentSpecGetSpec (const uint32 i) const
 Get the spec at index i in the list of subspecs.

virtual gnFragmentSpecGetSpecByBase (const gnSeqI baseI) const
 Get the spec from the list of subspecs which contains the specified base pair.

virtual void AddSpec (gnBaseSpec *spec, const uint32 i=UINT32_MAX)
 Add a subspec to this spec.

virtual void RemoveSpec (uint32 i)
 Remove a subspec from this spec.

virtual void MergeFragments (const uint32 startC, const uint32 endC)
virtual uint32 AddFeature (gnBaseFeature *feat)
 Add a feature to this spec.

virtual uint32 GetFeatureListLength () const
 Returns the number of features this spec contains.

virtual gnBaseFeatureGetFeature (const uint32 i) const
 Get the feature at index i in the list of features.

virtual void GetContainedFeatures (const gnLocation &lt, vector< gnBaseFeature * > &feature_vector, vector< uint32 > &index_vector) const
 Creates a list of all features which are contained by coordinates specified.

virtual void GetIntersectingFeatures (const gnLocation &lt, vector< gnBaseFeature * > &feature_vector, vector< uint32 > &index_vector) const
 Creates a list of all features which intersect the coordinates specified.

virtual void GetBrokenFeatures (const gnLocation &lt, vector< gnBaseFeature * > &feature_vector) const
 Creates a list of features which may have been broken by an edit.

virtual void RemoveFeature (const uint32 i)
 Remove a feature from this spec.

virtual gnGenomeSpec * CloneRange (const gnSeqI startI, const gnSeqI len) const
 Copies a specified range of bases and returns a pointer to the resulting gnGenomeSpec.

virtual gnSeqI GetLength () const
 Get the length of all the sequence data covered by this spec.

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 string GetSourceName () const
virtual void SetSourceName (const string &sourceName)
virtual boolean SeqRead (const gnSeqI start, gnSeqC *buf, uint32 &bufLen, const uint32 contigI) const
 Reads sequence data from this spec.

virtual uint32 GetSpecIndexByBase (const gnSeqI baseI) const
 Get the index of the subspec which contains the specified base pair.

virtual uint32 GetSpecIndexByName (const string &name) const
 Get the index of the spec which has the given name.

virtual gnSeqI GetSpecStartBase (const uint32 specI) const
 Get the starting base pair, in this spec's sequence, of the given subspec.

virtual gnSeqI GetSpecEndBase (const uint32 specI) const
 Get the ending base pair, in this spec's sequence, of the given subspec.

virtual uint32 GetHeaderListLength () const
 Returns the number of headers this spec contains.

virtual void AddHeader (gnBaseHeader *head, const uint32 i=UINT32_MAX)
 Add a header to this spec, adds to the end of the header list by default.

virtual gnBaseHeaderGetHeader (const uint32 i) const
 Get the headers at index i in the list of headers.

virtual gnBaseHeaderGetHeader (const string &name, uint32 &i) const
 Find the first header with the specified name, starting at index i.

virtual void RemoveHeader (uint32 i)
 Remove a header from this spec.

virtual gnBaseSpecCloneRange (const uint32 startI, const uint32 len) const=0
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 Attributes

vector< gnFragmentSpec * > m_SpecList
string m_sourceName
vector< gnBaseHeader * > m_headerList
boolean m_reverseComplement
boolean m_circular
string m_name

Detailed Description

This class contains references to the sequence data, annotation, and other related header data for an organism's genome.

The genome is organized into a list of sequence fragments (specs), a list of features, and a list of headers.

Definition at line 33 of file gnGenomeSpec.h.


Constructor & Destructor Documentation

gnGenomeSpec::gnGenomeSpec  
 

Definition at line 16 of file gnGenomeSpec.cpp.

References gnBaseSpec::Clear().

Referenced by Clone(), and CloneRange().

gnGenomeSpec::gnGenomeSpec const gnGenomeSpec &    s
 

Copy constructor.

Parameters:
s the gnGenomeSpec to copy.

Definition at line 21 of file gnGenomeSpec.cpp.

References gnBaseSpec::m_circular, gnMultiSpec::m_headerList, gnBaseSpec::m_name, gnBaseSpec::m_reverseComplement, gnMultiSpec::m_sourceName, m_SpecList, and uint32.

gnGenomeSpec::~gnGenomeSpec   [virtual]
 

Destructor, frees memory.

Definition at line 38 of file gnGenomeSpec.cpp.

References Clear().


Member Function Documentation

uint32 gnGenomeSpec::AddFeature gnBaseFeature   feat [virtual]
 

Add a feature to this spec.

Parameters:
feat The feature to add.
Returns:
True if successful

Reimplemented from gnMultiSpec.

Definition at line 128 of file gnGenomeSpec.cpp.

References gnFragmentSpec::AddFeature(), gnFragmentSpec::GetFeatureListLength(), gnMultiSpec::GetLength(), GetSpec(), GetSpecListLength(), gnBaseFeature::IsContainedBy(), SeqIndexOutOfBounds(), Throw_gnEx, and uint32.

Referenced by gnSequence::addFeature().

void gnMultiSpec::AddHeader gnBaseHeader   head,
const uint32    i = UINT32_MAX
[virtual, inherited]
 

Add a header to this spec, adds to the end of the header list by default.

Parameters:
head The header to add.
i The header to insert before. If i is larger than the size of the header list the header will be added to the end of the list.

Definition at line 125 of file gnMultiSpec.cpp.

References gnMultiSpec::m_headerList, uint32, and UINT32_MAX.

Referenced by gnSequence::addHeader(), gnFASSource::GetSpec(), gnSEQSource::ParseStream(), and gnGBKSource::ParseStream().

void gnGenomeSpec::AddSpec gnBaseSpec   spec,
const uint32    i = UINT32_MAX
[inline, virtual]
 

Add a subspec to this spec.

Throws an exception if the insertion index i is out of range

Parameters:
spec The subspec to add.
i The subspec to insert before
Returns:
True if successful

Implements gnMultiSpec.

Definition at line 105 of file gnGenomeSpec.h.

References m_SpecList, uint32, and UINT32_MAX.

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

void gnGenomeSpec::Clear   [virtual]
 

Clears all data from this spec.

Reimplemented from gnMultiSpec.

Definition at line 43 of file gnGenomeSpec.cpp.

References gnMultiSpec::Clear(), m_SpecList, and uint32.

Referenced by ~gnGenomeSpec().

gnGenomeSpec * gnGenomeSpec::Clone   const [inline, virtual]
 

Implements gnMultiSpec.

Definition at line 83 of file gnGenomeSpec.h.

References gnGenomeSpec().

Referenced by gnSequence::assign(), CloneRange(), gnSEQSource::GetSpec(), gnRAWSource::GetSpec(), gnGBKSource::GetSpec(), gnDNXSource::GetSpec(), gnABISource::GetSpec(), gnDNXSource::gnDNXSource(), gnSequence::gnSequence(), gnSequence::insert(), gnSequence::operator=(), and gnSequence::splitContig().

virtual gnBaseSpec* gnBaseSpec::CloneRange const uint32    startI,
const uint32    len
const [pure virtual, inherited]
 

Implemented in gnContigSpec.

gnGenomeSpec * gnGenomeSpec::CloneRange const gnSeqI    startI,
const gnSeqI    len
const [virtual]
 

Copies a specified range of bases and returns a pointer to the resulting gnGenomeSpec.

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 gnGenomeSpec containing only the specified bases

Definition at line 67 of file gnGenomeSpec.cpp.

References AddSpec(), Clone(), gnFragmentSpec::CloneRange(), gnMultiSpec::GetLength(), GetSpec(), gnMultiSpec::GetSpecIndexByBase(), GetSpecListLength(), gnMultiSpec::GetSpecStartBase(), gnGenomeSpec(), gnSeqI, GNSEQI_END, m_SpecList, and uint32.

Referenced by gnSequence::erase(), and gnSequence::subseq().

void gnMultiSpec::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.

Reimplemented in gnFragmentSpec.

Definition at line 104 of file gnMultiSpec.cpp.

References gnBaseSpec::CropEnd(), gnBaseSpec::GetLength(), gnMultiSpec::GetLength(), gnMultiSpec::GetSpec(), gnMultiSpec::GetSpecListLength(), gnSeqI, gnMultiSpec::RemoveSpec(), and uint32.

Referenced by gnFragmentSpec::CropEnd(), gnSequence::erase(), gnSequence::insert(), and gnSequence::splitContig().

void gnMultiSpec::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.

Reimplemented in gnFragmentSpec.

Definition at line 85 of file gnMultiSpec.cpp.

References gnBaseSpec::CropStart(), gnBaseSpec::GetLength(), gnMultiSpec::GetSpec(), gnMultiSpec::GetSpecListLength(), gnSeqI, gnMultiSpec::RemoveSpec(), and uint32.

Referenced by gnFragmentSpec::CropStart(), gnSequence::insert(), and gnSequence::splitContig().

void gnGenomeSpec::GetBrokenFeatures const gnLocation   lt,
vector< gnBaseFeature * > &    feature_vector
const [virtual]
 

Creates a list of features which may have been broken by an edit.

Parameters:
lt The coordinates containing the features to return.
feature_vector The vector to store features in.

Implements gnMultiSpec.

Definition at line 214 of file gnGenomeSpec.cpp.

References gnLocation::CropEnd(), gnFragmentSpec::GetBrokenFeatures(), gnFragmentSpec::GetFeatureListLength(), gnMultiSpec::GetLength(), GetSpec(), GetSpecListLength(), gnSeqI, gnLocation::MoveNegative(), and uint32.

Referenced by gnSequence::getBrokenFeatures().

void gnGenomeSpec::GetContainedFeatures const gnLocation   lt,
vector< gnBaseFeature * > &    feature_vector,
vector< uint32 > &    index_vector
const [virtual]
 

Creates a list of all features which are contained by coordinates specified.

Parameters:
lt The coordinates containing the features to return.
feature_vector The vector to store features in.
index_vector A vector of indices which correspond to the features.

Implements gnMultiSpec.

Definition at line 171 of file gnGenomeSpec.cpp.

References gnLocation::CropEnd(), gnFragmentSpec::GetContainedFeatures(), gnFragmentSpec::GetFeatureListLength(), gnMultiSpec::GetLength(), GetSpec(), GetSpecListLength(), gnSeqI, gnLocation::MoveNegative(), and uint32.

Referenced by gnSequence::getContainedFeatures().

gnBaseFeature * gnGenomeSpec::GetFeature const uint32    i const [virtual]
 

Get the feature at index i in the list of features.

Parameters:
i The index of the feature
Returns:
The feature.

Implements gnMultiSpec.

Definition at line 155 of file gnGenomeSpec.cpp.

References FeatureIndexOutOfBounds(), gnFragmentSpec::GetFeature(), gnFragmentSpec::GetFeatureListLength(), GetSpec(), GetSpecListLength(), gnMultiSpec::GetSpecStartBase(), gnBaseFeature::MovePositive(), Throw_gnEx, and uint32.

Referenced by gnSequence::getFeature().

uint32 gnGenomeSpec::GetFeatureListLength   const [virtual]
 

Returns the number of features this spec contains.

Returns:
The number of features this spec contains.

Implements gnMultiSpec.

Definition at line 147 of file gnGenomeSpec.cpp.

References gnFragmentSpec::GetFeatureListLength(), GetSpec(), GetSpecListLength(), and uint32.

Referenced by gnSequence::getFeatureListLength().

gnBaseHeader * gnMultiSpec::GetHeader const string &    name,
uint32   i
const [virtual, inherited]
 

Find the first header with the specified name, starting at index i.

Parameters:
name The name of the header to find.
i The index to start looking at.
Returns:
The header or NULL if none was found.

Definition at line 131 of file gnMultiSpec.cpp.

References HeaderIndexOutOfBounds(), gnMultiSpec::m_headerList, and Throw_gnEx.

gnBaseHeader * gnMultiSpec::GetHeader const uint32    i const [inline, virtual, inherited]
 

Get the headers at index i in the list of headers.

Throws a HeaderIndexOutOfBounds exception if a nonexistant header is referenced

Parameters:
i The index of the header
Returns:
The header.

Definition at line 197 of file gnMultiSpec.h.

References gnMultiSpec::m_headerList.

Referenced by gnSequence::getHeader(), gnGBKSource::Write(), gnFASSource::Write(), gnDNXSource::Write(), and gnGBKSource::WriteHeader().

uint32 gnMultiSpec::GetHeaderListLength   const [inline, virtual, inherited]
 

Returns the number of headers this spec contains.

Returns:
The number of headers this spec contains.

Definition at line 192 of file gnMultiSpec.h.

References gnMultiSpec::m_headerList, and uint32.

Referenced by gnSequence::getHeaderListLength(), gnSEQSource::ParseStream(), gnGBKSource::ParseStream(), and gnGBKSource::Write().

void gnGenomeSpec::GetIntersectingFeatures const gnLocation   lt,
vector< gnBaseFeature * > &    feature_vector,
vector< uint32 > &    index_vector
const [virtual]
 

Creates a list of all features which intersect the coordinates specified.

Parameters:
lt The coordinates intersecting the features to return.
feature_vector The vector to store features in.
index_vector A vector of indices which correspond to the features.

Implements gnMultiSpec.

Definition at line 193 of file gnGenomeSpec.cpp.

References gnLocation::CropEnd(), gnFragmentSpec::GetFeatureListLength(), gnFragmentSpec::GetIntersectingFeatures(), gnMultiSpec::GetLength(), GetSpec(), GetSpecListLength(), gnSeqI, gnLocation::MoveNegative(), and uint32.

Referenced by gnSequence::getIntersectingFeatures().

gnSeqI gnMultiSpec::GetLength   const [virtual, inherited]
 

Get the length of all the sequence data covered by this spec.

Returns:
This spec's length in base pairs.

Implements gnBaseSpec.

Definition at line 32 of file gnMultiSpec.cpp.

References gnBaseSpec::GetLength(), gnMultiSpec::GetSpec(), gnMultiSpec::GetSpecListLength(), gnSeqI, and uint32.

Referenced by AddFeature(), CloneRange(), gnFragmentSpec::CloneRange(), gnSequence::contigLength(), gnMultiSpec::CropEnd(), gnSequence::erase(), GetBrokenFeatures(), GetContainedFeatures(), gnSEQSource::GetContigSeqLength(), gnGBKSource::GetContigSeqLength(), gnDNXSource::GetContigSeqLength(), GetIntersectingFeatures(), gnSequence::insert(), gnSequence::length(), gnSequence::size(), and gnGBKSource::Write().

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

string gnMultiSpec::GetSourceName   const [inline, virtual, inherited]
 

Definition at line 206 of file gnMultiSpec.h.

References gnMultiSpec::m_sourceName.

Referenced by gnDNXSource::Write().

gnFragmentSpec * gnGenomeSpec::GetSpec const uint32    i const [inline, virtual]
 

Get the spec at index i in the list of subspecs.

Parameters:
i The index of the spec
Returns:
The spec.

Implements gnMultiSpec.

Definition at line 93 of file gnGenomeSpec.h.

References FragmentIndexOutOfBounds(), m_SpecList, and Throw_gnEx.

Referenced by AddFeature(), gnSequence::addHeader(), CloneRange(), gnSequence::contig(), gnSequence::contigByName(), gnSequence::contigLength(), gnSequence::contigName(), GetBrokenFeatures(), GetContainedFeatures(), gnDNXSource::GetContigID(), gnDNXSource::GetContigName(), gnDNXSource::GetContigSeqLength(), GetFeature(), GetFeatureListLength(), gnSequence::getHeader(), gnSequence::getHeaderListLength(), GetIntersectingFeatures(), gnSequence::globalToSource(), gnDNXSource::HasContig(), gnSequence::insert(), gnSequence::isReverseComplement(), RemoveFeature(), gnSequence::removeHeader(), gnSequence::setContigName(), gnSequence::setReverseComplement(), SetReverseComplement(), gnGBKSource::Write(), gnFASSource::Write(), and gnDNXSource::Write().

gnFragmentSpec * gnGenomeSpec::GetSpecByBase const gnSeqI    baseI const [inline, virtual]
 

Get the spec from the list of subspecs which contains the specified base pair.

Parameters:
baseI The base pair index.
Returns:
The spec.

Implements gnMultiSpec.

Definition at line 100 of file gnGenomeSpec.h.

References gnMultiSpec::GetSpecIndexByBase(), and m_SpecList.

Referenced by gnSequence::contigByBase().

gnSeqI gnMultiSpec::GetSpecEndBase const uint32    specI const [virtual, inherited]
 

Get the ending base pair, in this spec's sequence, of the given subspec.

Parameters:
specI The subspec index.
Returns:
The subspec's ending base pair.

Definition at line 73 of file gnMultiSpec.cpp.

References gnBaseSpec::GetLength(), gnMultiSpec::GetSpec(), gnMultiSpec::GetSpecListLength(), gnSeqI, SpecIndexOutOfBounds(), Throw_gnEx, and uint32.

uint32 gnMultiSpec::GetSpecIndexByBase const gnSeqI    baseI const [virtual, inherited]
 

Get the index of the subspec which contains the specified base pair.

Parameters:
baseI The base pair index.
Returns:
The subspec index.

Definition at line 41 of file gnMultiSpec.cpp.

References gnBaseSpec::GetLength(), gnMultiSpec::GetSpec(), gnMultiSpec::GetSpecListLength(), gnSeqI, SeqIndexOutOfBounds(), Throw_gnEx, and uint32.

Referenced by CloneRange(), gnFragmentSpec::CloneRange(), gnSequence::contigIndexByBase(), GetSpecByBase(), gnFragmentSpec::GetSpecByBase(), and gnSequence::globalToSource().

uint32 gnMultiSpec::GetSpecIndexByName const string &    name const [virtual, inherited]
 

Get the index of the spec which has the given name.

Parameters:
name The name of the spec to find.
Returns:
The spec index.

Definition at line 52 of file gnMultiSpec.cpp.

References gnBaseSpec::GetName(), gnMultiSpec::GetSpec(), gnMultiSpec::GetSpecListLength(), SpecIndexOutOfBounds(), Throw_gnEx, and uint32.

Referenced by gnSequence::contigByName(), and gnSequence::contigIndexByName().

uint32 gnGenomeSpec::GetSpecListLength   const [inline, virtual]
 

Returns the number of subspecs this spec contains.

Returns:
The number of subspecs this spec contains.

Implements gnMultiSpec.

Definition at line 88 of file gnGenomeSpec.h.

References m_SpecList, and uint32.

Referenced by AddFeature(), CloneRange(), gnSequence::contigListLength(), gnSequence::contigListSize(), GetBrokenFeatures(), GetContainedFeatures(), gnDNXSource::GetContigID(), gnDNXSource::GetContigListLength(), gnDNXSource::GetContigName(), gnDNXSource::GetContigSeqLength(), GetFeature(), GetFeatureListLength(), GetIntersectingFeatures(), gnDNXSource::HasContig(), gnSequence::insert(), gnSEQSource::ParseStream(), gnGBKSource::ParseStream(), RemoveFeature(), RemoveSpec(), SetReverseComplement(), gnGBKSource::Write(), and gnDNXSource::Write().

gnSeqI gnMultiSpec::GetSpecStartBase const uint32    specI const [virtual, inherited]
 

Get the starting base pair, in this spec's sequence, of the given subspec.

Parameters:
specI The subspec index.
Returns:
The subspec's starting base pair.

Definition at line 61 of file gnMultiSpec.cpp.

References gnBaseSpec::GetLength(), gnMultiSpec::GetSpec(), gnMultiSpec::GetSpecListLength(), gnSeqI, SpecIndexOutOfBounds(), Throw_gnEx, and uint32.

Referenced by CloneRange(), gnFragmentSpec::CloneRange(), gnSequence::contigStart(), GetFeature(), and 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(), SetReverseComplement(), and gnFragmentSpec::SetReverseComplement().

void gnGenomeSpec::MergeFragments const uint32    startC,
const uint32    endC
[virtual]
 

Definition at line 112 of file gnGenomeSpec.cpp.

References gnFragmentSpec::AddSpec(), FragmentIndexOutOfBounds(), gnFragmentSpec::GetSpec(), gnFragmentSpec::GetSpecListLength(), m_SpecList, Throw_gnEx, and uint32.

Referenced by gnSequence::mergeContigs().

void gnGenomeSpec::RemoveFeature const uint32    i [virtual]
 

Remove a feature from this spec.

Parameters:
i The index of the feature to remove.
Returns:
True if successful

Implements gnMultiSpec.

Definition at line 234 of file gnGenomeSpec.cpp.

References FeatureIndexOutOfBounds(), gnFragmentSpec::GetFeatureListLength(), GetSpec(), GetSpecListLength(), gnFragmentSpec::RemoveFeature(), Throw_gnEx, and uint32.

Referenced by gnSequence::removeFeature().

void gnMultiSpec::RemoveHeader uint32    i [virtual, inherited]
 

Remove a header from this spec.

Throws a HeaderIndexOutOfBounds exception if a nonexistant header is referenced

Parameters:
i The index of the header to remove.

Definition at line 139 of file gnMultiSpec.cpp.

References HeaderIndexOutOfBounds(), gnMultiSpec::m_headerList, and Throw_gnEx.

Referenced by gnSequence::removeHeader().

void gnGenomeSpec::RemoveSpec uint32    i [inline, virtual]
 

Remove a subspec from this spec.

Parameters:
i The index of the subspec to remove.

Implements gnMultiSpec.

Definition at line 113 of file gnGenomeSpec.h.

References GetSpecListLength(), and m_SpecList.

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

boolean gnMultiSpec::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 147 of file gnMultiSpec.cpp.

References gnBaseSpec::GetLength(), gnMultiSpec::GetSpec(), gnMultiSpec::GetSpecListLength(), gnSeqI, SeqIndexOutOfBounds(), gnBaseSpec::SeqRead(), SpecIndexOutOfBounds(), Throw_gnEx, and uint32.

Referenced by gnSequence::GetSeqC(), gnDNXSource::SeqRead(), gnSequence::ToArray(), and gnSequence::ToString().

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 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 gnGenomeSpec::SetReverseComplement const boolean    value [virtual]
 

Sets the reverse complement bit for this spec.

Parameters:
value True for reverse complement, false otherwise.

Implements gnBaseSpec.

Definition at line 52 of file gnGenomeSpec.cpp.

References GetSpec(), GetSpecListLength(), gnBaseSpec::IsReverseComplement(), gnBaseSpec::m_reverseComplement, m_SpecList, gnFragmentSpec::SetReverseComplement(), and uint32.

Referenced by gnSequence::setReverseComplement().

void gnMultiSpec::SetSourceName const string &    sourceName [inline, virtual, inherited]
 

Definition at line 211 of file gnMultiSpec.h.

References gnMultiSpec::m_sourceName.

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


Member Data Documentation

boolean gnBaseSpec::m_circular [protected, inherited]
 

Definition at line 108 of file gnBaseSpec.h.

Referenced by gnBaseSpec::Clear(), gnStringSpec::CloneRange(), gnSourceSpec::CloneRange(), gnFragmentSpec::gnFragmentSpec(), gnGenomeSpec(), gnSourceSpec::gnSourceSpec(), gnStringSpec::gnStringSpec(), gnBaseSpec::IsCircular(), and gnBaseSpec::SetCircular().

vector<gnBaseHeader*> gnMultiSpec::m_headerList [protected, inherited]
 

Definition at line 186 of file gnMultiSpec.h.

Referenced by gnMultiSpec::AddHeader(), gnMultiSpec::Clear(), gnMultiSpec::GetHeader(), gnMultiSpec::GetHeaderListLength(), gnFragmentSpec::gnFragmentSpec(), gnGenomeSpec(), and gnMultiSpec::RemoveHeader().

string gnBaseSpec::m_name [protected, inherited]
 

Definition at line 110 of file gnBaseSpec.h.

Referenced by gnBaseSpec::Clear(), gnStringSpec::CloneRange(), gnSourceSpec::CloneRange(), gnBaseSpec::GetName(), gnFragmentSpec::gnFragmentSpec(), gnGenomeSpec(), gnSourceSpec::gnSourceSpec(), gnStringSpec::gnStringSpec(), and gnBaseSpec::SetName().

boolean gnBaseSpec::m_reverseComplement [protected, inherited]
 

Definition at line 107 of file gnBaseSpec.h.

Referenced by gnBaseSpec::Clear(), gnStringSpec::CloneRange(), gnSourceSpec::CloneRange(), gnContigSpec::CropStart(), gnFragmentSpec::gnFragmentSpec(), gnGenomeSpec(), gnSourceSpec::gnSourceSpec(), gnStringSpec::gnStringSpec(), gnBaseSpec::IsReverseComplement(), gnContigSpec::SeqRead(), SetReverseComplement(), gnFragmentSpec::SetReverseComplement(), and gnContigSpec::SetReverseComplement().

string gnMultiSpec::m_sourceName [protected, inherited]
 

Reimplemented from gnBaseSpec.

Definition at line 184 of file gnMultiSpec.h.

Referenced by gnMultiSpec::GetSourceName(), gnFragmentSpec::gnFragmentSpec(), gnGenomeSpec(), and gnMultiSpec::SetSourceName().

vector<gnFragmentSpec*> gnGenomeSpec::m_SpecList [protected]
 

Definition at line 78 of file gnGenomeSpec.h.

Referenced by AddSpec(), Clear(), CloneRange(), GetSpec(), GetSpecByBase(), GetSpecListLength(), gnGenomeSpec(), MergeFragments(), RemoveSpec(), and SetReverseComplement().


The documentation for this class was generated from the following files:
Generated on Mon Feb 3 02:34:49 2003 for libGenome by doxygen1.3-rc3