#include <gnDNXSource.h>
Inheritance diagram for gnDNXSource:
Public Member Functions | |
gnDNXSource () | |
Empty Constructor, does nothing. | |
gnDNXSource (const gnDNXSource &s) | |
The copy constructor copies the given gnDNXSource. | |
~gnDNXSource () | |
Destructor, frees memory. | |
gnDNXSource * | Clone () const |
uint32 | GetContigListLength () const |
Get the number of sequence contigs in this source. | |
boolean | HasContig (const string &name) const |
Looks for a contig by name. | |
uint32 | GetContigID (const string &name) const |
Get a contig index by name. | |
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. | |
boolean | SeqRead (const gnSeqI start, char *buf, uint32 &bufLen, const uint32 contigI=ALL_CONTIGS) |
Gets sequence data from this source. | |
gnGenomeSpec * | GetSpec () const |
Get the annotated sequence data as a gnGenomeSpec. | |
gnFileContig * | GetFileContig (const uint32 contigI) const |
Returns a pointer to the file contig corresponding to contigI or null if none exists. | |
virtual void | Open (string openString) |
Opens the source given in "openString" for reading. | |
virtual void | Open () |
Opens this source for reading. | |
virtual void | Close () |
Closes the file or connection this source is reading from. | |
virtual string | GetOpenString () const |
Get the location of the source that is being used. | |
virtual const gnFilter * | GetFilter () const |
Get the filter currently being used to filter unwanted characters out of read sequences. | |
virtual void | SetFilter (gnFilter *filter) |
Set the filter that will be used to filter unwanted characters out of the sequence data. | |
virtual boolean | Read (const uint64 pos, char *buf, uint32 &bufLen) |
Gets raw input from this source. | |
Static Public Member Functions | |
boolean | Write (gnSequence &sequence, const string &filename) |
Writes the given gnSequence to a DNX file named "filename". | |
boolean | Write (gnBaseSource *source, const string &filename) |
This method is deprecated. | |
boolean | Write (gnGenomeSpec *spec, const string &filename) |
Writes the given gnGenomeSpec to a DNX file named "filename". | |
Protected Member Functions | |
void | DetermineNewlineType () |
Protected Attributes | |
string | m_openString |
ifstream | m_ifstream |
const gnFilter * | m_pFilter |
gnNewlineType | m_newlineType |
uint32 | m_newlineSize |
Private Member Functions | |
boolean | ParseStream (istream &fin) |
Static Private Member Functions | |
void | ValidateName (string &name) |
Private Attributes | |
gnGenomeSpec * | m_DNXSpec |
This class reads and writes the Blattner Lab DNX file format. DNX files may be written by calling: gnDNXSource::Write( mySpec, "C:\myFile.dnx");
Definition at line 35 of file gnDNXSource.h.
|
Empty Constructor, does nothing.
Definition at line 24 of file gnDNXSource.cpp. References DebugMsg(), gnFilter::fullDNASeqFilter(), m_DNXSpec, and gnFileSource::m_pFilter. Referenced by Clone(). |
|
The copy constructor copies the given gnDNXSource.
Definition at line 33 of file gnDNXSource.cpp. References gnGenomeSpec::Clone(), and m_DNXSpec. |
|
Destructor, frees memory.
Definition at line 39 of file gnDNXSource.cpp. References m_DNXSpec, and gnFileSource::m_ifstream. |
|
Implements gnFileSource. Definition at line 101 of file gnDNXSource.h. References gnDNXSource(). |
|
Closes the file or connection this source is reading from.
Implements gnBaseSource. Definition at line 56 of file gnFileSource.cpp. References IOStreamFailed(), gnFileSource::m_ifstream, and Throw_gnEx. |
|
Definition at line 74 of file gnFileSource.cpp. References gnNewlineMac, gnNewlineUnix, gnNewlineWindows, gnFileSource::m_ifstream, gnFileSource::m_newlineSize, and gnFileSource::m_newlineType. Referenced by gnGBKSource::ParseStream(), and gnFASSource::ParseStream(). |
|
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 52 of file gnDNXSource.cpp. References gnBaseSpec::GetName(), gnGenomeSpec::GetSpec(), gnGenomeSpec::GetSpecListLength(), m_DNXSpec, and uint32. |
|
Get the number of sequence contigs in this source.
Implements gnBaseSource. Definition at line 107 of file gnDNXSource.h. References gnGenomeSpec::GetSpecListLength(), m_DNXSpec, and uint32. |
|
Get the name of the specified contig. Returns an empty string if the specified contig is out of range.
Implements gnBaseSource. Definition at line 60 of file gnDNXSource.cpp. References gnBaseSpec::GetName(), gnGenomeSpec::GetSpec(), gnGenomeSpec::GetSpecListLength(), and m_DNXSpec. |
|
Get the total number of base pairs in the specified contig.
Implements gnBaseSource. Definition at line 68 of file gnDNXSource.cpp. References gnBaseSpec::GetLength(), gnMultiSpec::GetLength(), gnGenomeSpec::GetSpec(), gnGenomeSpec::GetSpecListLength(), gnSeqI, and m_DNXSpec. |
|
Returns a pointer to the file contig corresponding to contigI or null if none exists.
Implements gnFileSource. Definition at line 136 of file gnDNXSource.cpp. |
|
Get the filter currently being used to filter unwanted characters out of read sequences.
Implements gnBaseSource. Definition at line 68 of file gnFileSource.h. References gnFileSource::m_pFilter. |
|
Get the location of the source that is being used.
Implements gnBaseSource. Definition at line 62 of file gnFileSource.h. References gnFileSource::m_openString. |
|
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 127 of file gnDNXSource.h. References gnGenomeSpec::Clone(), and m_DNXSpec. |
|
Looks for a contig by name. Returns true if it finds the contig, otherwise false.
Implements gnBaseSource. Definition at line 44 of file gnDNXSource.cpp. References gnBaseSpec::GetName(), gnGenomeSpec::GetSpec(), gnGenomeSpec::GetSpecListLength(), m_DNXSpec, and uint32. |
|
Opens this source for reading.
Implements gnBaseSource. Definition at line 48 of file gnFileSource.cpp. References FileNotOpened(), gnFileSource::m_ifstream, gnFileSource::m_openString, and Throw_gnEx. |
|
Opens the source given in "openString" for reading.
Implements gnBaseSource. Definition at line 29 of file gnFileSource.cpp. References FileNotOpened(), gnFileSource::m_ifstream, gnFileSource::m_openString, gnFileSource::ParseStream(), and Throw_gnEx. |
|
|
Gets raw input from this source. Read will attempt to read "bufLen" bytes starting at "pos" directly from the source. It stores the data in "buf", and returns the actual number of bytes read in bufLen. Read will return false if a serious error occurs.
Implements gnBaseSource. Definition at line 63 of file gnFileSource.cpp. References gnFileSource::m_ifstream. Referenced by gnRAWSource::SeqRead(). |
|
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 113 of file gnDNXSource.h. References m_DNXSpec, and gnMultiSpec::SeqRead(). |
|
Set the filter that will be used to filter unwanted characters out of the sequence data.
Implements gnBaseSource. Definition at line 74 of file gnFileSource.h. References gnFileSource::m_pFilter, NullPointer(), and Throw_gnEx. |
|
Definition at line 80 of file gnDNXSource.cpp. Referenced by Write(). |
|
Writes the given gnGenomeSpec to a DNX file named "filename". Actual sequence and annotation data will be written to GenBank files. The DNX file will then reference any created GenBank files.
Definition at line 89 of file gnDNXSource.cpp. References gnBaseHeader::GetHeader(), gnMultiSpec::GetHeader(), gnBaseSpec::GetName(), gnSourceFactory::GetSourceFactory(), gnMultiSpec::GetSourceName(), gnFragmentSpec::GetSpec(), gnGenomeSpec::GetSpec(), gnFragmentSpec::GetSpecListLength(), gnGenomeSpec::GetSpecListLength(), gnSourceFactory::HasSource(), uint32, ValidateName(), and gnGBKSource::Write(). |
|
This method is deprecated. Writes the given gnBaseSource to a DNX file named "filename". Actual sequence and annotation data will be written to GenBank files. The DNX file will then reference any created GenBank files.
Definition at line 123 of file gnDNXSource.h. References gnBaseSource::GetSpec(), and Write(). |
|
Writes the given gnSequence to a DNX file named "filename". Actual sequence and annotation data will be written to GenBank files. The DNX file will then reference any created GenBank files.
Definition at line 119 of file gnDNXSource.h. References gnSequence::GetSpec(). Referenced by Write(). |
|
Definition at line 97 of file gnDNXSource.h. Referenced by GetContigID(), GetContigListLength(), GetContigName(), GetContigSeqLength(), GetSpec(), gnDNXSource(), HasContig(), ParseStream(), SeqRead(), and ~gnDNXSource(). |
|
|
Definition at line 56 of file gnFileSource.h. Referenced by gnFileSource::DetermineNewlineType(), gnFileSource::gnFileSource(), gnGBKSource::ParseStream(), gnFASSource::ParseStream(), and gnGBKSource::SeqStartPos(). |
|
Definition at line 55 of file gnFileSource.h. Referenced by gnFileSource::DetermineNewlineType(), and gnFileSource::gnFileSource(). |
|
Definition at line 52 of file gnFileSource.h. Referenced by gnFileSource::GetOpenString(), gnABISource::gnABISource(), gnFASSource::gnFASSource(), gnFileSource::gnFileSource(), gnGBKSource::gnGBKSource(), gnRAWSource::gnRAWSource(), gnSEQSource::gnSEQSource(), and gnFileSource::Open(). |
|