Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Compound Members File Members
gnMultiSpec Class Reference This class defines an interface for specs which have multiple subspecs containing sequence data.
More...
#include <gnMultiSpec.h >
Inheritance diagram for gnMultiSpec::
List of all members.
Public Methods
gnMultiSpec ()
virtual ~gnMultiSpec ()
Destructor, frees memory. More...
virtual gnMultiSpec* Clone () const=0
virtual gnSeqI GetLength () const
Get the length of all the sequence data covered by this spec. More...
virtual void CropStart (gnSeqI cropLen)
Crop the first cropLen bases from the sequence. More...
virtual void CropEnd (gnSeqI cropLen)
Crop the last cropLen bases from the sequence. More...
virtual string GetSourceName () const
virtual void SetSourceName (const string &sourceName)
virtual void Clear ()
Clears all data from this spec. More...
virtual boolean SeqRead (const gnSeqI start, gnSeqC *buf, uint32 &bufLen, const uint32 contigI) const
Reads sequence data from this spec. More...
virtual uint32 GetSpecListLength () const=0
Returns the number of subspecs this spec contains. More...
virtual gnBaseSpec * GetSpec (const uint32 i) const=0
Get the spec at index i in the list of subspecs. More...
virtual gnBaseSpec * GetSpecByBase (const gnSeqI baseI) const=0
Get the spec from the list of subspecs which contains the specified base pair. More...
virtual uint32 GetSpecIndexByBase (const gnSeqI baseI) const
Get the index of the subspec which contains the specified base pair. More...
virtual uint32 GetSpecIndexByName (const string &name) const
Get the index of the spec which has the given name. More...
virtual gnSeqI GetSpecStartBase (const uint32 specI) const
Get the starting base pair, in this spec's sequence, of the given subspec. More...
virtual gnSeqI GetSpecEndBase (const uint32 specI) const
Get the ending base pair, in this spec's sequence, of the given subspec. More...
virtual void AddSpec (gnBaseSpec *spec, const uint32 i=UINT32_MAX)=0
Add a subspec to this spec. More...
virtual void RemoveSpec (uint32 i)=0
Remove a subspec from this spec. More...
virtual uint32 GetHeaderListLength () const
Returns the number of headers this spec contains. More...
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. More...
virtual gnBaseHeader * GetHeader (const uint32 i) const
Get the headers at index i in the list of headers. More...
virtual gnBaseHeader * GetHeader (const string &name, uint32 &i) const
Find the first header with the specified name, starting at index i. More...
virtual void RemoveHeader (uint32 i)
Remove a header from this spec. More...
uint32 AddFeature (gnBaseFeature *feat)
Add a feature to this spec. More...
virtual uint32 GetFeatureListLength () const=0
Returns the number of features this spec contains. More...
virtual gnBaseFeature * GetFeature (const uint32 i) const=0
Get the feature at index i in the list of features. More...
virtual void GetContainedFeatures (const gnLocation <, vector< gnBaseFeature *> &feature_vector, vector< uint32 > &index_vector) const=0
Creates a list of all features which are contained by coordinates specified. More...
virtual void GetIntersectingFeatures (const gnLocation <, vector< gnBaseFeature *> &feature_vector, vector< uint32 > &index_vector) const=0
Creates a list of all features which intersect the coordinates specified. More...
virtual void GetBrokenFeatures (const gnLocation <, vector< gnBaseFeature *> &feature_vector) const=0
Creates a list of features which may have been broken by an edit. More...
virtual void RemoveFeature (const uint32 i)=0
Remove a feature from this spec. More...
Protected Attributes
string m_sourceName
vector<gnBaseHeader *> m_headerList
Detailed Description
This class defines an interface for specs which have multiple subspecs containing sequence data.
Definition at line 30 of file gnMultiSpec.h .
Constructor & Destructor Documentation
gnMultiSpec::gnMultiSpec (
) [inline]
gnMultiSpec::~gnMultiSpec (
) [inline, virtual]
Member Function Documentation
Add a feature to this spec.
Parameters:
feat
The feature to add.
i
The feature to insert before
Returns:
True if successful
Reimplemented in gnFragmentSpec , and gnGenomeSpec .
void gnMultiSpec::AddHeader (
gnBaseHeader * head ,
const uint32 i = UINT32_MAX ) [virtual]
void gnMultiSpec::AddSpec (
gnBaseSpec * spec ,
const uint32 i = UINT32_MAX ) [pure 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
Reimplemented in gnFragmentSpec , and gnGenomeSpec .
void gnMultiSpec::Clear (
) [virtual]
gnMultiSpec * gnMultiSpec::Clone (
) const [pure virtual]
void gnMultiSpec::CropEnd (
gnSeqI cropLen ) [virtual]
void gnMultiSpec::CropStart (
gnSeqI cropLen ) [virtual]
void gnMultiSpec::GetBrokenFeatures (
const gnLocation & lt ,
vector< gnBaseFeature *> & feature_vector ) const [pure 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.
Reimplemented in gnFragmentSpec , and gnGenomeSpec .
void gnMultiSpec::GetContainedFeatures (
const gnLocation & lt ,
vector< gnBaseFeature *> & feature_vector ,
vector< uint32 > & index_vector ) const [pure 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.
Reimplemented in gnFragmentSpec , and gnGenomeSpec .
Get the feature at index i in the list of features.
Parameters:
i
The index of the feature
Returns:
The feature.
Reimplemented in gnFragmentSpec , and gnGenomeSpec .
uint32 gnMultiSpec::GetFeatureListLength (
) const [pure virtual]
Returns the number of features this spec contains.
Returns:
The number of features this spec contains.
Reimplemented in gnFragmentSpec , and gnGenomeSpec .
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 132 of file gnMultiSpec.cpp .
uint32 gnMultiSpec::GetHeaderListLength (
) const [inline, virtual]
void gnMultiSpec::GetIntersectingFeatures (
const gnLocation & lt ,
vector< gnBaseFeature *> & feature_vector ,
vector< uint32 > & index_vector ) const [pure 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.
Reimplemented in gnFragmentSpec , and gnGenomeSpec .
gnSeqI gnMultiSpec::GetLength (
) const [virtual]
Get the length of all the sequence data covered by this spec.
Returns:
This spec's length in base pairs.
Reimplemented from gnBaseSpec .
Definition at line 33 of file gnMultiSpec.cpp .
Referenced by gnGenomeSpec::AddFeature (), gnGenomeSpec::CloneRange (), gnFragmentSpec::CloneRange (), CropEnd (), gnGenomeSpec::GetBrokenFeatures (), gnGenomeSpec::GetContainedFeatures (), gnSEQSource::GetContigSeqLength (), gnGBKSource::GetContigSeqLength (), gnDNXSource::GetContigSeqLength (), gnGenomeSpec::GetIntersectingFeatures (), gnGBKSource::Write (), gnSequence::contigLength (), gnSequence::erase (), gnSequence::insert (), gnSequence::length (), and gnSequence::size ().
string gnMultiSpec::GetSourceName (
) const [inline, virtual]
gnBaseSpec * gnMultiSpec::GetSpecByBase (
const gnSeqI baseI ) const [pure virtual]
Get the spec from the list of subspecs which contains the specified base pair.
Parameters:
baseI
The base pair index.
Returns:
The spec.
Reimplemented in gnFragmentSpec , and gnGenomeSpec .
gnSeqI gnMultiSpec::GetSpecEndBase (
const uint32 specI ) const [virtual]
Get the ending base pair, in this spec's sequence, of the given subspec.
Parameters:
Returns:
The subspec's ending base pair.
Definition at line 74 of file gnMultiSpec.cpp .
uint32 gnMultiSpec::GetSpecIndexByBase (
const gnSeqI baseI ) const [virtual]
uint32 gnMultiSpec::GetSpecIndexByName (
const string & name ) const [virtual]
uint32 gnMultiSpec::GetSpecListLength (
) const [pure virtual]
Returns the number of subspecs this spec contains.
Returns:
The number of subspecs this spec contains.
Reimplemented in gnFragmentSpec , and gnGenomeSpec .
Referenced by CropEnd (), CropStart (), GetLength (), GetSpecEndBase (), GetSpecIndexByBase (), GetSpecIndexByName (), GetSpecStartBase (), gnGenomeSpec::RemoveSpec (), gnFragmentSpec::RemoveSpec (), and SeqRead ().
gnSeqI gnMultiSpec::GetSpecStartBase (
const uint32 specI ) const [virtual]
void gnMultiSpec::RemoveFeature (
const uint32 i ) [pure virtual]
Remove a feature from this spec.
Parameters:
i
The index of the feature to remove.
Returns:
True if successful
Reimplemented in gnFragmentSpec , and gnGenomeSpec .
void gnMultiSpec::RemoveHeader (
uint32 i ) [virtual]
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 140 of file gnMultiSpec.cpp .
Referenced by gnSequence::removeHeader ().
void gnMultiSpec::RemoveSpec (
uint32 i ) [pure 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.
Reimplemented from gnBaseSpec .
Definition at line 148 of file gnMultiSpec.cpp .
Referenced by gnSequence::GetSeqC (), gnDNXSource::SeqRead (), gnSequence::ToArray (), and gnSequence::ToString ().
void gnMultiSpec::SetSourceName (
const string & sourceName ) [inline, virtual]
Member Data Documentation
string gnMultiSpec::m_sourceName [protected]
The documentation for this class was generated from the following files:
Generated at Fri Nov 30 15:36:55 2001 for libGenome by
1.2.8.1 written by Dimitri van Heesch ,
© 1997-2001