#include <gnSequence.h>
Inheritance diagram for gnSequence::
Public Methods | |
gnSequence () | |
Empty Constructor, creates an empty gnSequence. More... | |
gnSequence (const gnSeqC *seq) | |
Creates a gnSequence with a single fragment containing the bases in "seq". More... | |
gnSequence (const string &str) | |
Creates a gnSequence with a single fragment containing the bases in "str". More... | |
gnSequence (const gnGenomeSpec &gngs) | |
Creates a gnSequence with the genome stored in the gnGenomeSpec "gngs". More... | |
gnSequence (const gnFragmentSpec &gnfs) | |
Creates a gnSequence with the sequence fragment stored in the gnFragmentSpec "gnfs". More... | |
gnSequence (const gnContigSpec &gncs) | |
Creates a gnSequence with the contig stored in the gnContigSpec "gncs". More... | |
gnSequence (gnSeqC *bases, const gnSeqI length) | |
Creates a gnSequence with a single fragment containing the bases in "bases". More... | |
gnSequence (const gnSequence &seq) | |
Copies the gnSequence "seq". More... | |
~gnSequence () | |
Destructor, frees the memory used by this sequence. More... | |
gnSequence& | operator= (const gnSequence &seq) |
Copies the gnSequence. More... | |
gnSequence* | Clone () const |
gnSeqI | contigListSize () const |
Returns the number of sequence fragments in this sequence. More... | |
gnSeqI | contigListLength () const |
Returns the number of sequence fragments in this sequence. More... | |
uint32 | contigIndexByBase (const gnSeqI baseI) const |
Returns the index of the contig which contains the specified base. More... | |
gnSequence | contig (const uint32 contigI) const |
Returns a gnSequence containing the specified fragment. More... | |
gnSequence | contigByBase (const gnSeqI baseI) const |
Returns a gnSequence containing only the fragment which contains the specified base. More... | |
virtual gnSeqI | contigStart (const uint32 contigI) const |
Returns the index of the base pair where the specified contig starts in this sequence. More... | |
virtual gnSeqI | contigLength (const uint32 contigI) const |
Returns the length in base pairs of the specified contig in this sequence. More... | |
virtual uint32 | contigIndexByName (string &contigName) const |
Returns the index of the contig with the given name. More... | |
virtual string | contigName (const uint32 contigI) const |
Returns the name of the specified contig. More... | |
virtual gnSequence | contigByName (string &contigName) const |
Returns a gnSequence containing only the named contig. More... | |
virtual void | merge (const gnSeqI startI, const gnSeqI endI) |
Merges the bases starting at base index "startI" and ending at "endI" into one contig, splitting existing contigs. More... | |
virtual void | mergeContigs (const uint32 startC, const uint32 endC) |
Merges the contigs starting at the contig index "startC" and ending at "endC" into one contig. More... | |
virtual void | splitContig (const gnSeqI splitI, const uint32 contigI=ALL_CONTIGS) |
Splits the specified contig after splitI. More... | |
virtual void | setContigName (const uint32 contigI, const string &contig_name) |
virtual uint32 | getFeatureListLength () const |
Returns the size of the feature list for the specified contig. More... | |
virtual gnBaseFeature* | getFeature (const uint32 featureI) const |
Returns the feature specified by featureI. More... | |
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. More... | |
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. More... | |
virtual uint32 | addFeature (gnBaseFeature *feature) |
Adds the specified feature to the feature list. More... | |
virtual void | removeFeature (const uint32 featureI) |
Removes the specified feature. More... | |
virtual void | getBrokenFeatures (const gnLocation <, vector< gnBaseFeature *> &feature_vector) const |
Creates a list of features which may have been broken by an edit. More... | |
virtual uint32 | getHeaderListLength (const uint32 contigI) const |
Returns the size of the header list for the specified contig. More... | |
virtual gnBaseHeader* | getHeader (const uint32 contigI, const uint32 headerI) const |
Returns the feature specified by featureI. More... | |
virtual void | addHeader (const uint32 contigI, gnBaseHeader *header, const uint32 headerI) |
Adds header information to a specified contig. More... | |
virtual void | removeHeader (const uint32 contigI, const uint32 headerI) |
Removes header information from a specified contig. More... | |
virtual void | setReverseComplement (const boolean revComp, const uint32 contigI=ALL_CONTIGS) |
Reverse complements a specified contig, or the entire sequence if ALL_CONTIGS is specified. More... | |
virtual boolean | isReverseComplement (const uint32 contigI=ALL_CONTIGS) |
Returns true if a specified contig, or the entire sequence is reverse complement. More... | |
virtual boolean | isCircular () const |
Returns true if this sequence is circular. More... | |
virtual void | setCircular (const boolean value) |
Sets whether this sequence should be read circular. More... | |
virtual void | globalToLocal (uint32 &contigI, gnSeqI &baseI) const |
Converts the global sequence coordinate baseI to a contig local coordinate. More... | |
virtual void | localToGlobal (const uint32 contigI, gnSeqI &baseI) const |
Converts the local contig coordinate baseI to a global sequence coordinate. More... | |
virtual void | globalToSource (uint32 &contigI, gnSeqI &baseI) const |
Converts the global sequence coordinate baseI to a local coordinate in the original data source. More... | |
virtual void | localToSource (uint32 &contigI, gnSeqI &baseI) const |
Converts the contig local sequence coordinate baseI in contig contigI to a local coordinate in the original data source. More... | |
virtual bool | LoadSource (const string sourcename) |
Loads the sequence located at the URL in "sourcename". More... | |
virtual void | setFilter (const gnBaseFilter *filt) |
Assigns a filter which all sequence data must pass through when read from the object. More... | |
virtual void | setFilterList (list< const gnBaseFilter *> &filt_list) |
Assigns a list of filters which all sequence data passes through in order when read from the object. More... | |
virtual list<const gnBaseFilter*> | getFilterList () const |
Returns the list of filters currently being used. More... | |
virtual void | assign (gnSequence &seq) |
Assigns the sequence "seq" to this sequence. More... | |
void | operator= (gnSequence &seq) |
Assigns the sequence "seq" to this sequence. More... | |
boolean | operator== (const gnSequence &seq) const |
boolean | operator!= (const gnSequence &seq) const |
boolean | operator< (const gnSequence &seq) const |
boolean | operator<= (const gnSequence &seq) const |
boolean | operator> (const gnSequence &seq) const |
boolean | operator>= (const gnSequence &seq) const |
gnSequence& | operator+= (const gnSequence &seq) |
Appends the bases in "seq" to this sequence. More... | |
virtual int | compare (const gnSequence &seq) const |
Compares the bases in "seq" to this sequence. More... | |
virtual int | compare (const string &str) const |
virtual void | append (const gnSequence &seq) |
Appends the bases in "seq" to this sequence. More... | |
virtual void | insert (const gnSeqI offset, const gnSeqC *bases, const gnSeqI length) |
Inserts the first "len" bases in "bases" into this sequence.at "offset". More... | |
virtual void | insert (const gnSeqI offset, const gnSequence &seq) |
Inserts the annotated sequence in "seq" into this sequence.at "offset". More... | |
virtual void | insert (const gnSeqI offset, const gnGenomeSpec &gnbs) |
Inserts the annotated sequence in "gnbs" into this sequence.at "offset". More... | |
gnSequence const | operator+ (const gnSequence &seq) const |
Concatenates this sequence with the annotated sequence in "seq". More... | |
gnSequence | subseq (const gnSeqI offset, const gnSeqI length) const |
Creates a sequence containing the "length" bases starting at "offset". More... | |
virtual void | erase (const gnSeqI offset=0, const gnSeqI length=GNSEQI_END) |
Deletes the "len" bases starting at "offset". More... | |
virtual gnSeqI | length () const |
Returns the length of this sequence. More... | |
virtual gnSeqI | size () const |
Returns the length of this sequence. More... | |
virtual string | ToString (const gnSeqI length=GNSEQI_END, const gnSeqI offset=1) const |
Returns the "length" bases starting at "offset" as a string. More... | |
virtual boolean | ToString (string &str, const gnSeqI length=GNSEQI_END, const gnSeqI offset=1) const |
Converts the "length" bases starting at "offset" into the string "str". More... | |
virtual boolean | ToArray (gnSeqC *pSeqC, gnSeqI length, const gnSeqI offset=1) const |
Converts the "length" bases starting at "offset" into the character array "pSeqC".. More... | |
virtual gnSeqC | GetSeqC (const gnSeqI offset) const |
Returns the base at "offset". More... | |
gnSeqC | operator[] (const gnSeqI offset) const |
Returns the base at the specified index. More... | |
virtual gnGenomeSpec* | GetSpec () const |
Get the spec (annotated sequence) which this sequence represents. More... | |
virtual void | SetSpec (gnGenomeSpec *s) |
Set the spec (annotated sequence) which this sequence represents. More... | |
virtual gnSeqI | find (const gnSequence &search, const gnSeqI offset=0) const |
Find looks for the search sequence within this gnSequence and returns the position of the first match if any exists. More... | |
Private Attributes | |
gnGenomeSpec* | spec |
list<const gnBaseFilter*> | filter_list |
const gnCompare* | comparator |
Friends | |
std::istream& | operator>> (std::istream &is, gnSequence &gns) |
Reads bases from the specified input stream (e.g. More... | |
std::ostream& | operator<< (std::ostream &os, const gnSequence &gns) |
Writes the bases in this sequence to the specified output stream (e.g. More... |
It provides a simple and general way to manipulate genetic sequences, regardless of what kind of database, web site, or file they are stored in. Sequence data can be manipulated like a c++ string by using subseq() and erase(). gnSequence updates annotated sequences with each change, breaking features if necessary.
Definition at line 36 of file gnSequence.h.
|
Empty Constructor, creates an empty gnSequence.
Definition at line 23 of file gnSequence.cpp. Referenced by Clone(), contig(), contigByBase(), contigByName(), and subseq().
|
|
Creates a gnSequence with a single fragment containing the bases in "seq".
Definition at line 28 of file gnSequence.cpp. |
|
Creates a gnSequence with a single fragment containing the bases in "str".
Definition at line 37 of file gnSequence.cpp. |
|
Creates a gnSequence with the genome stored in the gnGenomeSpec "gngs".
Definition at line 46 of file gnSequence.cpp. |
|
Creates a gnSequence with the sequence fragment stored in the gnFragmentSpec "gnfs".
Definition at line 50 of file gnSequence.cpp. |
|
Creates a gnSequence with the contig stored in the gnContigSpec "gncs". Usually gncs will be a gnStringSpec or a gnSourceSpec.
Definition at line 55 of file gnSequence.cpp. |
|
Creates a gnSequence with a single fragment containing the bases in "bases".
Definition at line 61 of file gnSequence.cpp. |
|
Copies the gnSequence "seq".
Definition at line 70 of file gnSequence.cpp. |
|
Destructor, frees the memory used by this sequence.
Definition at line 77 of file gnSequence.cpp. |
|
Reimplemented from gnClone. Definition at line 90 of file gnSequence.cpp. Referenced by gnSequence(), and operator=().
|
|
Returns the base at "offset".
Definition at line 300 of file gnSequence.cpp. Referenced by operator[]().
|
|
Get the spec (annotated sequence) which this sequence represents.
Definition at line 612 of file gnSequence.h. Referenced by gnSEQSource::Write(), gnGBKSource::Write(), gnFASSource::Write(), gnDNXSource::Write(), and main().
|
|
Loads the sequence located at the URL in "sourcename". Possible URLs currently include only "file:///" URLs. If no URL prefix is found then LoadSource assumes that "sourcename" contains the name of a local file.
Definition at line 515 of file gnSequence.cpp. Referenced by main().
|
|
Set the spec (annotated sequence) which this sequence represents.
Definition at line 616 of file gnSequence.h. |
|
Converts the "length" bases starting at "offset" into the character array "pSeqC".. After converting, "length" will be set to the actual length of the sequence. Be sure to null terminate the character array if you are going to print it!
Definition at line 278 of file gnSequence.cpp. Referenced by gnRAWSource::Write(), gnGBKSource::Write(), gnFASSource::Write(), and main().
|
|
Converts the "length" bases starting at "offset" into the string "str".
Definition at line 256 of file gnSequence.cpp. |
|
Returns the "length" bases starting at "offset" as a string.
Definition at line 248 of file gnSequence.cpp. Referenced by WriteData(), compare(), find(), main(), and operator<<().
|
|
Adds the specified feature to the feature list.
Definition at line 568 of file gnSequence.h. |
|
Adds header information to a specified contig.
Definition at line 485 of file gnSequence.cpp. |
|
Appends the bases in "seq" to this sequence.
Definition at line 555 of file gnSequence.h. Referenced by main(), and operator>>().
|
|
Assigns the sequence "seq" to this sequence.
Definition at line 521 of file gnSequence.h. |
|
Definition at line 95 of file gnSequence.cpp. |
|
Compares the bases in "seq" to this sequence.
Definition at line 121 of file gnSequence.cpp. Referenced by operator!=(), operator<(), operator<=(), operator==(), operator>(), and operator>=().
|
|
Returns a gnSequence containing the specified fragment.
Definition at line 343 of file gnSequence.cpp. Referenced by main().
|
|
Returns a gnSequence containing only the fragment which contains the specified base.
Definition at line 351 of file gnSequence.cpp. |
|
Returns a gnSequence containing only the named contig. If two contigs have the same name, contigByName() will return the first.
Definition at line 429 of file gnSequence.cpp. |
|
Returns the index of the contig which contains the specified base.
Definition at line 338 of file gnSequence.cpp. Referenced by globalToLocal().
|
|
Returns the index of the contig with the given name. If two contigs have the same name, contigIndexByName() will return the first.
Definition at line 356 of file gnSequence.cpp. |
|
Returns the length in base pairs of the specified contig in this sequence.
Definition at line 370 of file gnSequence.cpp. Referenced by gnGBKSource::Write(), gnFASSource::Write(), localToGlobal(), and main().
|
|
Returns the number of sequence fragments in this sequence.
Definition at line 331 of file gnSequence.cpp. Referenced by gnFASSource::Write(), and main().
|
|
Returns the number of sequence fragments in this sequence.
Definition at line 326 of file gnSequence.cpp. Referenced by main().
|
|
Returns the name of the specified contig.
Definition at line 376 of file gnSequence.cpp. Referenced by gnFASSource::Write(), and main().
|
|
Returns the index of the base pair where the specified contig starts in this sequence.
Definition at line 362 of file gnSequence.cpp. Referenced by gnGBKSource::Write(), globalToLocal(), and localToGlobal().
|
|
Deletes the "len" bases starting at "offset".
Definition at line 199 of file gnSequence.cpp. |
|
Find looks for the search sequence within this gnSequence and returns the position of the first match if any exists.
Definition at line 530 of file gnSequence.cpp. |
|
Creates a list of features which may have been broken by an edit.
Definition at line 584 of file gnSequence.h. |
|
Creates a list of all features which are contained by coordinates specified.
Definition at line 576 of file gnSequence.h. |
|
Returns the feature specified by featureI.
Definition at line 564 of file gnSequence.h. Referenced by main().
|
|
Returns the size of the feature list for the specified contig.
Definition at line 560 of file gnSequence.h. Referenced by main().
|
|
Returns the list of filters currently being used.
Definition at line 633 of file gnSequence.h. |
|
Returns the feature specified by featureI.
Definition at line 475 of file gnSequence.cpp. |
|
Returns the size of the header list for the specified contig.
Definition at line 465 of file gnSequence.cpp. |
|
Creates a list of all features which intersect the coordinates specified.
Definition at line 580 of file gnSequence.h. Referenced by main().
|
|
Converts the global sequence coordinate baseI to a contig local coordinate.
Definition at line 382 of file gnSequence.cpp. |
|
Converts the global sequence coordinate baseI to a local coordinate in the original data source. globalToSource() will overwrite any values passed to it!
Definition at line 397 of file gnSequence.cpp. Referenced by localToSource().
|
|
Inserts the annotated sequence in "gnbs" into this sequence.at "offset". insert() will update the locations of all affected features.
Definition at line 156 of file gnSequence.cpp. |
|
Inserts the annotated sequence in "seq" into this sequence.at "offset". insert() will update the locations of all affected features.
Definition at line 598 of file gnSequence.h. |
|
Inserts the first "len" bases in "bases" into this sequence.at "offset". insert() will update the locations of all affected features.
Definition at line 147 of file gnSequence.cpp. Referenced by append(), erase(), insert(), operator+=(), and splitContig().
|
|
Returns true if this sequence is circular.
Definition at line 589 of file gnSequence.h. |
|
Returns true if a specified contig, or the entire sequence is reverse complement.
Definition at line 456 of file gnSequence.cpp. |
|
Returns the length of this sequence.
Definition at line 604 of file gnSequence.h. Referenced by ToString(), gnRAWSource::Write(), compare(), erase(), main(), and splitContig().
|
|
Converts the local contig coordinate baseI to a global sequence coordinate.
Definition at line 389 of file gnSequence.cpp. Referenced by localToSource(), and splitContig().
|
|
Converts the contig local sequence coordinate baseI in contig contigI to a local coordinate in the original data source. localToSource() will overwrite any values passed to it!
Definition at line 422 of file gnSequence.cpp. |
|
Merges the bases starting at base index "startI" and ending at "endI" into one contig, splitting existing contigs.
Definition at line 504 of file gnSequence.cpp. |
|
Merges the contigs starting at the contig index "startC" and ending at "endC" into one contig.
Definition at line 509 of file gnSequence.cpp. |
|
Definition at line 529 of file gnSequence.h. |
|
Concatenates this sequence with the annotated sequence in "seq".
Definition at line 180 of file gnSequence.cpp. |
|
Appends the bases in "seq" to this sequence.
Definition at line 550 of file gnSequence.h. |
|
Definition at line 533 of file gnSequence.h. |
|
Definition at line 537 of file gnSequence.h. |
|
Assigns the sequence "seq" to this sequence.
Definition at line 517 of file gnSequence.h. |
|
Copies the gnSequence.
Definition at line 82 of file gnSequence.cpp. |
|
Definition at line 525 of file gnSequence.h. |
|
Definition at line 541 of file gnSequence.h. |
|
Definition at line 545 of file gnSequence.h. |
|
Returns the base at the specified index.
Definition at line 319 of file gnSequence.cpp. |
|
Removes the specified feature.
Definition at line 572 of file gnSequence.h. |
|
Removes header information from a specified contig.
Definition at line 495 of file gnSequence.cpp. |
|
Sets whether this sequence should be read circular. If circular is set, reads beyond the end of the sequence will pick up at the beginning.
Definition at line 594 of file gnSequence.h. |
|
Definition at line 436 of file gnSequence.cpp. |
|
Assigns a filter which all sequence data must pass through when read from the object.
Definition at line 623 of file gnSequence.h. Referenced by main(), and runTests().
|
|
Assigns a list of filters which all sequence data passes through in order when read from the object. There may not be any NULL pointers in the list.
Definition at line 629 of file gnSequence.h. Referenced by runTests().
|
|
Reverse complements a specified contig, or the entire sequence if ALL_CONTIGS is specified.
Definition at line 445 of file gnSequence.cpp. Referenced by runTests().
|
|
Returns the length of this sequence.
Definition at line 608 of file gnSequence.h. |
|
Splits the specified contig after splitI.
Definition at line 218 of file gnSequence.cpp. |
|
Creates a sequence containing the "length" bases starting at "offset".
Definition at line 188 of file gnSequence.cpp. Referenced by main().
|
|
Writes the bases in this sequence to the specified output stream (e.g. cout). Definition at line 244 of file gnSequence.cpp. |
|
Reads bases from the specified input stream (e.g. cin). Definition at line 238 of file gnSequence.cpp. |
|
Reimplemented in gnDNASequence, gnProteinSequence, and gnRNASequence. Definition at line 506 of file gnSequence.h. |
|
Reimplemented in gnDNASequence, gnProteinSequence, and gnRNASequence. Definition at line 505 of file gnSequence.h. |
|
Reimplemented in gnDNASequence, gnProteinSequence, and gnRNASequence. Definition at line 504 of file gnSequence.h. |