#include <gnFragmentSpec.h>
Inheritance diagram for gnFragmentSpec:
Public Member Functions | |
gnFragmentSpec () | |
virtual | ~gnFragmentSpec () |
Destructor, frees memory. | |
gnFragmentSpec (const gnFragmentSpec &s) | |
Copy constructor. | |
virtual gnFragmentSpec * | 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 gnContigSpec * | GetSpec (const uint32 i) const |
Get the spec at index i in the list of subspecs. | |
virtual gnContigSpec * | GetSpecByBase (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 | 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 uint32 | AddFeature (gnBaseFeature *feat) |
Add a feature to this spec. | |
virtual uint32 | GetFeatureListLength () const |
Returns the number of features this spec contains. | |
virtual gnBaseFeature * | GetFeature (const uint32 i) const |
Get the feature at index i in the list of features. | |
virtual void | GetContainedFeatures (const gnLocation <, 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 <, 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 <, 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 gnFragmentSpec * | CloneRange (const gnSeqI startI, const gnSeqI len) const |
Copies a specified range of bases and returns a pointer to the resulting gnFragmentSpec. | |
virtual gnSeqI | GetLength () const |
Get the length of all the sequence data covered by this spec. | |
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 gnBaseHeader * | GetHeader (const uint32 i) const |
Get the headers at index i in the list of headers. | |
virtual gnBaseHeader * | GetHeader (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 gnBaseSpec * | CloneRange (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< gnContigSpec * > | m_SpecList |
vector< gnBaseFeature * > | m_featureList |
string | m_sourceName |
vector< gnBaseHeader * > | m_headerList |
boolean | m_reverseComplement |
boolean | m_circular |
string | m_name |
It also contains a list of features which relate to the sequence fragment. Finally it contains a list of sequence related header data. This class is usually created and filled by a file reader class like gnGBKSource.
Definition at line 34 of file gnFragmentSpec.h.
|
Definition at line 16 of file gnFragmentSpec.cpp. References gnBaseSpec::Clear(). Referenced by Clone(), and CloneRange(). |
|
Destructor, frees memory.
Definition at line 44 of file gnFragmentSpec.cpp. References Clear(). |
|
Copy constructor.
Definition at line 21 of file gnFragmentSpec.cpp. References gnBaseSpec::m_circular, m_featureList, gnMultiSpec::m_headerList, gnBaseSpec::m_name, gnBaseSpec::m_reverseComplement, gnMultiSpec::m_sourceName, m_SpecList, and uint32. |
|
Add a feature to this spec.
Reimplemented from gnMultiSpec. Definition at line 125 of file gnFragmentSpec.h. References m_featureList, gnBaseFeature::SetSpec(), and uint32. Referenced by gnGenomeSpec::AddFeature(), gnSEQSource::ParseStream(), and gnGBKSource::ParseStream(). |
|
Add a header to this spec, adds to the end of the header list by default.
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(). |
|
Add a subspec to this spec. Throws an exception if the insertion index i is out of range
Implements gnMultiSpec. Definition at line 109 of file gnFragmentSpec.h. References m_SpecList, uint32, and UINT32_MAX. Referenced by CloneRange(), gnFASSource::GetSpec(), gnSequence::gnSequence(), gnGenomeSpec::MergeFragments(), gnSEQSource::ParseStream(), gnRAWSource::ParseStream(), gnGBKSource::ParseStream(), and gnDNXSource::ParseStream(). |
|
Clears all data from this spec.
Reimplemented from gnMultiSpec. Definition at line 49 of file gnFragmentSpec.cpp. References gnMultiSpec::Clear(), m_featureList, m_SpecList, and uint32. Referenced by ~gnFragmentSpec(). |
|
Implements gnMultiSpec. Definition at line 87 of file gnFragmentSpec.h. References gnFragmentSpec(). Referenced by CloneRange(), GetBrokenFeatures(), GetContainedFeatures(), GetIntersectingFeatures(), gnSequence::gnSequence(), and gnSequence::insert(). |
|
Implemented in gnContigSpec. |
|
Copies a specified range of bases and returns a pointer to the resulting gnFragmentSpec. You must delete the copy when you are finished with it.
Definition at line 101 of file gnFragmentSpec.cpp. References AddSpec(), Clone(), gnContigSpec::CloneRange(), GetIntersectingFeatures(), gnContigSpec::GetLength(), gnMultiSpec::GetLength(), GetSpec(), gnMultiSpec::GetSpecIndexByBase(), GetSpecListLength(), gnMultiSpec::GetSpecStartBase(), gnFragmentSpec(), gnSeqI, GNSEQI_END, m_featureList, m_SpecList, gnLocation::SetEnd(), gnLocation::SetStart(), and uint32. Referenced by gnGenomeSpec::CloneRange(). |
|
Crop the last cropLen bases from the sequence. CropEnd will delete features and headers associated with the cropped bases.
Reimplemented from gnMultiSpec. Definition at line 93 of file gnFragmentSpec.cpp. References gnMultiSpec::CropEnd(), m_featureList, and uint32. |
|
Crop the first cropLen bases from the sequence. CropStart will delete features and headers associated with the cropped bases.
Reimplemented from gnMultiSpec. Definition at line 85 of file gnFragmentSpec.cpp. References gnMultiSpec::CropStart(), m_featureList, and uint32. |
|
Creates a list of features which may have been broken by an edit.
Implements gnMultiSpec. Definition at line 78 of file gnFragmentSpec.cpp. References Clone(), m_featureList, and uint32. Referenced by gnGenomeSpec::GetBrokenFeatures(). |
|
Creates a list of all features which are contained by coordinates specified.
Implements gnMultiSpec. Definition at line 62 of file gnFragmentSpec.cpp. References Clone(), m_featureList, and uint32. Referenced by gnGenomeSpec::GetContainedFeatures(). |
|
Get the feature at index i in the list of features.
Implements gnMultiSpec. Definition at line 137 of file gnFragmentSpec.h. References m_featureList. Referenced by gnGenomeSpec::GetFeature(), and gnGBKSource::Write(). |
|
Returns the number of features this spec contains.
Implements gnMultiSpec. Definition at line 132 of file gnFragmentSpec.h. References m_featureList, and uint32. Referenced by gnGenomeSpec::AddFeature(), gnGenomeSpec::GetBrokenFeatures(), gnGenomeSpec::GetContainedFeatures(), gnGenomeSpec::GetFeature(), gnGenomeSpec::GetFeatureListLength(), gnGenomeSpec::GetIntersectingFeatures(), gnSEQSource::ParseStream(), gnGBKSource::ParseStream(), gnGenomeSpec::RemoveFeature(), and gnGBKSource::Write(). |
|
Find the first header with the specified name, starting at index i.
Definition at line 131 of file gnMultiSpec.cpp. References HeaderIndexOutOfBounds(), gnMultiSpec::m_headerList, and Throw_gnEx. |
|
Get the headers at index i in the list of headers. Throws a HeaderIndexOutOfBounds exception if a nonexistant header is referenced
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(). |
|
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(). |
|
Creates a list of all features which intersect the coordinates specified.
Implements gnMultiSpec. Definition at line 70 of file gnFragmentSpec.cpp. References Clone(), m_featureList, and uint32. Referenced by CloneRange(), and gnGenomeSpec::GetIntersectingFeatures(). |
|
Get the length of all the sequence data covered by this spec.
Implements gnBaseSpec. Definition at line 32 of file gnMultiSpec.cpp. References gnBaseSpec::GetLength(), gnMultiSpec::GetSpec(), gnMultiSpec::GetSpecListLength(), gnSeqI, and uint32. Referenced by gnGenomeSpec::AddFeature(), gnGenomeSpec::CloneRange(), CloneRange(), gnSequence::contigLength(), gnMultiSpec::CropEnd(), gnSequence::erase(), gnGenomeSpec::GetBrokenFeatures(), gnGenomeSpec::GetContainedFeatures(), gnSEQSource::GetContigSeqLength(), gnGBKSource::GetContigSeqLength(), gnDNXSource::GetContigSeqLength(), gnGenomeSpec::GetIntersectingFeatures(), gnSequence::insert(), gnSequence::length(), gnSequence::size(), and gnGBKSource::Write(). |
|
Get the name of the contig associated with this spec.
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(). |
|
Definition at line 206 of file gnMultiSpec.h. References gnMultiSpec::m_sourceName. Referenced by gnDNXSource::Write(). |
|
Get the spec at index i in the list of subspecs.
Implements gnMultiSpec. Definition at line 97 of file gnFragmentSpec.h. References ContigIndexOutOfBounds(), m_SpecList, and Throw_gnEx. Referenced by CloneRange(), gnSequence::globalToSource(), gnGenomeSpec::MergeFragments(), SetReverseComplement(), and gnDNXSource::Write(). |
|
Get the spec from the list of subspecs which contains the specified base pair.
Implements gnMultiSpec. Definition at line 104 of file gnFragmentSpec.h. References gnMultiSpec::GetSpecIndexByBase(), and m_SpecList. |
|
Get the ending base pair, in this spec's sequence, of the given subspec.
Definition at line 73 of file gnMultiSpec.cpp. References gnBaseSpec::GetLength(), gnMultiSpec::GetSpec(), gnMultiSpec::GetSpecListLength(), gnSeqI, SpecIndexOutOfBounds(), Throw_gnEx, and uint32. |
|
Get the index of the subspec which contains the specified base pair.
Definition at line 41 of file gnMultiSpec.cpp. References gnBaseSpec::GetLength(), gnMultiSpec::GetSpec(), gnMultiSpec::GetSpecListLength(), gnSeqI, SeqIndexOutOfBounds(), Throw_gnEx, and uint32. Referenced by gnGenomeSpec::CloneRange(), CloneRange(), gnSequence::contigIndexByBase(), gnGenomeSpec::GetSpecByBase(), GetSpecByBase(), and gnSequence::globalToSource(). |
|
Get the index of the spec which has the given name.
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(). |
|
Returns the number of subspecs this spec contains.
Implements gnMultiSpec. Definition at line 92 of file gnFragmentSpec.h. References m_SpecList, and uint32. Referenced by CloneRange(), gnGenomeSpec::MergeFragments(), gnDNXSource::ParseStream(), RemoveSpec(), SetReverseComplement(), and gnDNXSource::Write(). |
|
Get the starting base pair, in this spec's sequence, of the given subspec.
Definition at line 61 of file gnMultiSpec.cpp. References gnBaseSpec::GetLength(), gnMultiSpec::GetSpec(), gnMultiSpec::GetSpecListLength(), gnSeqI, SpecIndexOutOfBounds(), Throw_gnEx, and uint32. Referenced by gnGenomeSpec::CloneRange(), CloneRange(), gnSequence::contigStart(), gnGenomeSpec::GetFeature(), and gnSequence::globalToSource(). |
|
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(). |
|
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 SetReverseComplement(). |
|
Remove a feature from this spec.
Implements gnMultiSpec. Definition at line 142 of file gnFragmentSpec.h. References FeatureIndexOutOfBounds(), m_featureList, and Throw_gnEx. Referenced by gnGenomeSpec::RemoveFeature(). |
|
Remove a header from this spec. Throws a HeaderIndexOutOfBounds exception if a nonexistant header is referenced
Definition at line 139 of file gnMultiSpec.cpp. References HeaderIndexOutOfBounds(), gnMultiSpec::m_headerList, and Throw_gnEx. Referenced by gnSequence::removeHeader(). |
|
Remove a subspec from this spec.
Implements gnMultiSpec. Definition at line 117 of file gnFragmentSpec.h. References ContigIndexOutOfBounds(), GetSpecListLength(), m_SpecList, and Throw_gnEx. |
|
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.
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(). |
|
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.
Definition at line 132 of file gnBaseSpec.h. References gnBaseSpec::m_circular. Referenced by gnSEQSource::ParseStream(), gnGBKSource::ParseStream(), and gnSequence::setCircular(). |
|
Sets the name for this contig.
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(). |
|
Sets the reverse complement bit for this spec.
Implements gnBaseSpec. Definition at line 153 of file gnFragmentSpec.cpp. References GetSpec(), GetSpecListLength(), gnBaseSpec::IsReverseComplement(), gnBaseSpec::m_reverseComplement, m_SpecList, gnContigSpec::SetReverseComplement(), and uint32. Referenced by gnSequence::setReverseComplement(), and gnGenomeSpec::SetReverseComplement(). |
|
Definition at line 211 of file gnMultiSpec.h. References gnMultiSpec::m_sourceName. Referenced by gnFASSource::GetSpec(), and gnDNXSource::ParseStream(). |
|
Definition at line 108 of file gnBaseSpec.h. Referenced by gnBaseSpec::Clear(), gnStringSpec::CloneRange(), gnSourceSpec::CloneRange(), gnFragmentSpec(), gnGenomeSpec::gnGenomeSpec(), gnSourceSpec::gnSourceSpec(), gnStringSpec::gnStringSpec(), gnBaseSpec::IsCircular(), and gnBaseSpec::SetCircular(). |
|
Definition at line 82 of file gnFragmentSpec.h. Referenced by AddFeature(), Clear(), CloneRange(), CropEnd(), CropStart(), GetBrokenFeatures(), GetContainedFeatures(), GetFeature(), GetFeatureListLength(), GetIntersectingFeatures(), gnFragmentSpec(), and RemoveFeature(). |
|
Definition at line 186 of file gnMultiSpec.h. Referenced by gnMultiSpec::AddHeader(), gnMultiSpec::Clear(), gnMultiSpec::GetHeader(), gnMultiSpec::GetHeaderListLength(), gnFragmentSpec(), gnGenomeSpec::gnGenomeSpec(), and gnMultiSpec::RemoveHeader(). |
|
Definition at line 110 of file gnBaseSpec.h. Referenced by gnBaseSpec::Clear(), gnStringSpec::CloneRange(), gnSourceSpec::CloneRange(), gnBaseSpec::GetName(), gnFragmentSpec(), gnGenomeSpec::gnGenomeSpec(), gnSourceSpec::gnSourceSpec(), gnStringSpec::gnStringSpec(), and gnBaseSpec::SetName(). |
|
|
Reimplemented from gnBaseSpec. Definition at line 184 of file gnMultiSpec.h. Referenced by gnMultiSpec::GetSourceName(), gnFragmentSpec(), gnGenomeSpec::gnGenomeSpec(), and gnMultiSpec::SetSourceName(). |
|
Definition at line 80 of file gnFragmentSpec.h. Referenced by AddSpec(), Clear(), CloneRange(), GetSpec(), GetSpecByBase(), GetSpecListLength(), gnFragmentSpec(), RemoveSpec(), and SetReverseComplement(). |