#include <gnFASSource.h>
Inheritance diagram for gnFASSource:
Public Member Functions | |
gnFASSource * | Clone () const |
Returns an exact copy of this class. | |
gnFileContig * | GetContig (const uint32 i) const |
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. | |
gnFASSource (const gnFASSource &s) | |
Clone Constructor copies the specified gnFASSource. | |
gnFASSource () | |
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. | |
~gnFASSource () | |
Destructor, frees memory. | |
Static Public Member Functions | |
boolean | Write (gnBaseSource *source, const string &filename) |
Deprecated - do not use. | |
void | Write (gnSequence &sequence, ostream &m_ostream, boolean write_coords=true, boolean enforce_unique_names=true) |
Write the given gnSequence to an ostream. | |
void | Write (gnSequence &sequence, const string &filename, boolean write_coords=true, boolean enforce_unique_names=true) |
Write the given gnSequence to a FastA file. | |
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 | |
vector< gnFileContig * > | m_contigList |
gnFASSource is used by gnSourceFactory to read files. Files can be written in the FastA file format by calling gnFASSource::Write( mySpec, "C:\\myFasFile.fas");
Definition at line 32 of file gnFASSource.h.
|
Empty Constructor, does nothing. Definition at line 20 of file gnFASSource.cpp. References DebugMsg(), and gnFilter::fullDNASeqFilter(). Referenced by Clone(). |
|
Clone Constructor copies the specified gnFASSource.
References m_contigList. |
|
Destructor, frees memory. Definition at line 36 of file gnFASSource.cpp. References m_contigList. |
|
Returns an exact copy of this class.
Implements gnFileSource. Definition at line 113 of file gnFASSource.h. References gnFASSource(). |
|
Definition at line 84 of file gnFASSource.cpp. References m_contigList, and uint32. Referenced by main(). |
|
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 56 of file gnFASSource.cpp. References m_contigList, and uint32. |
|
Get the number of sequence contigs in this source.
Implements gnBaseSource. Definition at line 119 of file gnFASSource.h. References m_contigList, and uint32. Referenced by main(). |
|
Get the name of the specified contig. Returns an empty string if the specified contig is out of range.
Implements gnBaseSource. Definition at line 65 of file gnFASSource.cpp. References m_contigList, and uint32. |
|
Get the total number of base pairs in the specified contig.
Implements gnBaseSource. Definition at line 72 of file gnFASSource.cpp. References gnSeqI, GNSEQI_ERROR, m_contigList, and uint32. |
|
Returns a pointer to the file contig corresponding to contigI or null if none exists.
Implements gnFileSource. Definition at line 381 of file gnFASSource.cpp. References m_contigList, and uint32. |
|
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 357 of file gnFASSource.cpp. References gnMultiSpec< SubSpec >::AddHeader(), gnMultiSpec< SubSpec >::AddSpec(), gnContigHeader, m_contigList, gnBaseSpec::SetName(), gnContigSpec::SetSourceName(), gnMultiSpec< SubSpec >::SetSourceName(), and uint32. |
|
Looks for a contig by name. Returns true if it finds the contig, otherwise false.
Implements gnBaseSource. Definition at line 47 of file gnFASSource.cpp. References m_contigList, and uint32. |
|
|
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 92 of file gnFASSource.cpp. References gnSeqC, gnSeqI, gnFilter::IsValid(), m_contigList, SeqSeek(), uint32, and uint64. Referenced by main(). |
|
Definition at line 178 of file gnFASSource.cpp. References gnSeqI, m_contigList, SeqStartPos(), uint32, and uint64. Referenced by SeqRead(). |
|
Definition at line 205 of file gnFASSource.cpp. References ErrorMsg(), gnFileContig::GetRepeatSeqGapSize(), gnFileContig::GetSectStartEnd(), gnContigSequence, gnSeqI, gnFileContig::HasRepeatSeqGap(), gnFilter::IsValid(), uint32, and uint64. Referenced by SeqSeek(). |
|
Deprecated - do not use. Write the given source to a FastA file.
References gnBaseSource::GetContigListLength(), gnBaseSource::GetContigName(), gnBaseSource::GetContigSeqLength(), gnSeqC, gnSeqI, gnBaseSource::SeqRead(), and uint32. |
|
Write the given gnSequence to an ostream.
References gnSequence::contigLength(), gnSequence::contigListLength(), gnSequence::contigName(), FAS_LINE_WIDTH, gnBaseHeader::GetHeader(), gnMultiSpec< SubSpec >::GetHeader(), gnMultiSpec< SubSpec >::GetSpec(), gnSequence::GetSpec(), gnSeqC, gnSeqI, gnSequence::ToArray(), uint32, and uintToString(). |
|
Write the given gnSequence to a FastA file.
References Throw_gnEx. Referenced by main(), and WriteData(). |
|
Definition at line 109 of file gnFASSource.h. Referenced by GetContig(), GetContigID(), GetContigListLength(), GetContigName(), GetContigSeqLength(), GetFileContig(), GetSpec(), gnFASSource(), HasContig(), ParseStream(), SeqRead(), SeqSeek(), and ~gnFASSource(). |