#include <gnFileSource.h>
Inheritance diagram for gnFileSource:
Public Member Functions | |
gnFileSource () | |
gnFileSource (const gnFileSource &gnfs) | |
virtual | ~gnFileSource () |
virtual gnFileSource * | Clone () const=0 |
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. | |
virtual gnFileContig * | GetFileContig (const uint32 contigI) const=0 |
Returns a pointer to the file contig corresponding to contigI or null if none exists. | |
virtual uint32 | GetContigListLength () const=0 |
Get the number of sequence contigs in this source. | |
virtual boolean | HasContig (const string &name) const=0 |
Looks for a contig by name. | |
virtual uint32 | GetContigID (const string &name) const=0 |
Get a contig index by name. | |
virtual string | GetContigName (const uint32 i) const=0 |
Get the name of the specified contig. | |
virtual gnSeqI | GetContigSeqLength (const uint32 i) const=0 |
Get the total number of base pairs in the specified contig. | |
virtual boolean | SeqRead (const gnSeqI start, char *buf, uint32 &bufLen, const uint32 contigI=ALL_CONTIGS)=0 |
Gets sequence data from this source. | |
virtual gnGenomeSpec * | GetSpec () const=0 |
Get the annotated sequence data as a gnGenomeSpec. | |
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 | |
virtual boolean | ParseStream (istream &fin)=0 |
All file source classes are derived from this class.
Definition at line 27 of file gnFileSource.h.
|
Definition at line 30 of file gnFileSource.h. |
|
Definition at line 18 of file gnFileSource.cpp. References m_ifstream, m_newlineSize, m_newlineType, m_openString, and m_pFilter. |
|
Definition at line 32 of file gnFileSource.h. |
|
Implements gnBaseSource. Implemented in gnABISource, gnDNXSource, gnFASSource, gnGBKSource, gnRAWSource, and gnSEQSource. |
|
Closes the file or connection this source is reading from.
Implements gnBaseSource. Definition at line 56 of file gnFileSource.cpp. References IOStreamFailed(), m_ifstream, and Throw_gnEx. |
|
Definition at line 74 of file gnFileSource.cpp. References gnNewlineMac, gnNewlineUnix, gnNewlineWindows, m_ifstream, m_newlineSize, and 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.
Implemented in gnABISource, gnDataBaseSource, gnDNXSource, gnFASSource, gnGBKSource, gnRAWSource, and gnSEQSource. Referenced by gnDNXSource::ParseStream(). |
|
Get the number of sequence contigs in this source.
Implemented in gnABISource, gnDataBaseSource, gnDNXSource, gnFASSource, gnGBKSource, gnRAWSource, and gnSEQSource. Referenced by gnFASSource::Write(). |
|
Get the name of the specified contig. Returns an empty string if the specified contig is out of range.
Implemented in gnABISource, gnDataBaseSource, gnDNXSource, gnFASSource, gnGBKSource, gnRAWSource, and gnSEQSource. Referenced by gnFASSource::Write(). |
|
Get the total number of base pairs in the specified contig.
Implemented in gnABISource, gnDataBaseSource, gnDNXSource, gnFASSource, gnGBKSource, gnRAWSource, and gnSEQSource. Referenced by gnSourceSpec::GetSourceLength(), and gnFASSource::Write(). |
|
Returns a pointer to the file contig corresponding to contigI or null if none exists.
Implemented in gnABISource, gnDNXSource, gnFASSource, gnGBKSource, gnRAWSource, and gnSEQSource. |
|
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 m_pFilter. |
|
Get the location of the source that is being used.
Implements gnBaseSource. Definition at line 62 of file gnFileSource.h. References 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.
Implemented in gnABISource, gnDataBaseSource, gnDNXSource, gnFASSource, gnGBKSource, gnRAWSource, and gnSEQSource. Referenced by gnSequence::LoadSource(), gnSEQSource::Write(), gnRAWSource::Write(), gnGBKSource::Write(), and gnDNXSource::Write(). |
|
Looks for a contig by name. Returns true if it finds the contig, otherwise false.
Implemented in gnABISource, gnDataBaseSource, gnDNXSource, gnFASSource, gnGBKSource, gnRAWSource, and gnSEQSource. |
|
Opens this source for reading.
Implements gnBaseSource. Definition at line 48 of file gnFileSource.cpp. References FileNotOpened(), m_ifstream, 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(), m_ifstream, m_openString, ParseStream(), and Throw_gnEx. |
|
Implemented in gnABISource, gnDNXSource, gnFASSource, gnGBKSource, gnRAWSource, and gnSEQSource. Referenced by Open(). |
|
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 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.
Implemented in gnABISource, gnDataBaseSource, gnDNXSource, gnFASSource, gnGBKSource, gnRAWSource, and gnSEQSource. Referenced by gnSourceSpec::Read(), and gnFASSource::Write(). |
|
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 m_pFilter, NullPointer(), and Throw_gnEx. |
|
|
Definition at line 56 of file gnFileSource.h. Referenced by DetermineNewlineType(), gnFileSource(), gnGBKSource::ParseStream(), gnFASSource::ParseStream(), and gnGBKSource::SeqStartPos(). |
|
Definition at line 55 of file gnFileSource.h. Referenced by DetermineNewlineType(), and gnFileSource(). |
|
Definition at line 52 of file gnFileSource.h. Referenced by GetOpenString(), gnABISource::gnABISource(), gnFASSource::gnFASSource(), gnFileSource(), gnGBKSource::gnGBKSource(), gnRAWSource::gnRAWSource(), gnSEQSource::gnSEQSource(), and Open(). |
|