#include <gnRAWSource.h>
Inheritance diagram for gnRAWSource:
Public Member Functions | |
gnRAWSource * | Clone () const |
Returns an exact copy of this class. | |
uint32 | GetContigID (const string &name) const |
Get a contig index by name. | |
uint32 | GetContigListLength () const |
Get the number of sequence contigs in this source. | |
string | GetContigName (const uint32 i) const |
Get the name of the specified contig. | |
gnSeqI | GetContigSeqLength (const uint32 i) const |
Get the total number of base pairs in the specified contig. | |
gnFileContig * | GetFileContig (const uint32 contigI) const |
Returns a pointer to the file contig corresponding to contigI or null if none exists. | |
gnGenomeSpec * | GetSpec () const |
Get the annotated sequence data as a gnGenomeSpec. | |
gnRAWSource (const gnRAWSource &s) | |
Clone Constructor copies the specified gnRAWSource. | |
gnRAWSource () | |
Empty Constructor, does nothing. | |
boolean | HasContig (const string &name) const |
Looks for a contig by name. | |
boolean | SeqRead (const gnSeqI start, char *buf, gnSeqI &bufLen, const uint32 contigI=ALL_CONTIGS) |
Gets sequence data from this source. | |
~gnRAWSource () | |
Destructor, frees memory. | |
Static Public Member Functions | |
boolean | CheckRawData (boolean set=false, boolean check=false) |
boolean | Write (gnBaseSource *source, const string &filename) |
Writes the specified source to a raw file named "filename". | |
boolean | Write (gnSequence &sequence, const string &filename) |
Writes the specified gnSequence to a raw file named "filename". | |
Private Member Functions | |
boolean | ParseStream (istream &fin) |
boolean | SeqSeek (const gnSeqI start, const uint32 &contigI, uint64 &startPos, uint64 &readableBytes) |
boolean | SeqStartPos (const gnSeqI start, gnFileContig &contig, uint64 &startPos, uint64 &readableBytes) |
Private Attributes | |
gnFileContig * | m_contig |
gnGenomeSpec * | m_spec |
This class reads and writes raw sequence to and from files. A raw sequence does not contain any newlines, fragment delimiters, or other type of annotation. gnRAWSource is used by gnSourceFactory to read files and should only be used directly.when writing out raw files by calling gnRAWSource::Write( mySpec, "C:\\myFile.txt");
Definition at line 35 of file gnRAWSource.h.
|
Empty Constructor, does nothing. Definition at line 20 of file gnRAWSource.cpp. References m_contig. Referenced by Clone(). |
|
Clone Constructor copies the specified gnRAWSource.
References gnFileContig::Clone(), and m_contig. |
|
Destructor, frees memory. Definition at line 34 of file gnRAWSource.cpp. References m_contig. |
|
Definition at line 109 of file gnRAWSource.h. Referenced by ParseStream(). |
|
Returns an exact copy of this class.
Implements gnFileSource. Definition at line 92 of file gnRAWSource.h. References gnRAWSource(). |
|
Get a contig index by name. If the source does not contain a contig by the specified name GetContigID returns UINT32_MAX.
Implements gnBaseSource. Definition at line 47 of file gnRAWSource.cpp. References uint32. |
|
Get the number of sequence contigs in this source.
Implements gnBaseSource. Definition at line 98 of file gnRAWSource.h. |
|
Get the name of the specified contig. Returns an empty string if the specified contig is out of range.
Implements gnBaseSource. Definition at line 52 of file gnRAWSource.cpp. References uint32. |
|
Get the total number of base pairs in the specified contig.
Implements gnBaseSource. Definition at line 57 of file gnRAWSource.cpp. References gnFileContig::GetSeqLength(), gnSeqI, GNSEQI_ERROR, m_contig, and uint32. |
|
Returns a pointer to the file contig corresponding to contigI or null if none exists.
Implements gnFileSource. Definition at line 94 of file gnRAWSource.cpp. |
|
Get the annotated sequence data as a gnGenomeSpec. GetSpec returns a gnGenomeSpec which contains the sequence, header, and feature data contained by this source.
Implements gnBaseSource. Definition at line 68 of file gnRAWSource.cpp. References gnGenomeSpec::Clone(), and m_spec. |
|
Looks for a contig by name. Returns true if it finds the contig, otherwise false.
Implements gnBaseSource. Definition at line 40 of file gnRAWSource.cpp. |
|
Implements gnFileSource. Definition at line 101 of file gnRAWSource.cpp. References gnMultiSpec< SubSpec >::AddSpec(), CheckRawData(), gnContigSequence, gnSeqI, gnFilter::IsValid(), m_contig, m_spec, gnFileContig::SetName(), gnFileContig::SetRepeatSeqGap(), gnFileContig::SetSectEnd(), gnFileContig::SetSectStart(), gnFileContig::SetSeqLength(), gnContigSpec::SetSourceName(), uint32, and uint64. |
|
Gets sequence data from this source. 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 gnBaseSource. Definition at line 64 of file gnRAWSource.cpp. References gnSeqI, gnFileSource::Read(), and uint32. |
|
|
|
|
|
Writes the specified source to a raw file named "filename".
References gnBaseSource::GetSpec(), and Write(). |
|
Writes the specified gnSequence to a raw file named "filename".
References gnSeqC, gnSeqI, gnSequence::length(), and gnSequence::ToArray(). Referenced by Write(). |
|
Definition at line 87 of file gnRAWSource.h. Referenced by GetContigListLength(), GetContigSeqLength(), GetFileContig(), gnRAWSource(), ParseStream(), and ~gnRAWSource(). |
|
Definition at line 88 of file gnRAWSource.h. Referenced by GetSpec(), and ParseStream(). |