Sleipnir
|
Encapsulates a standard FASTA file or a modified ENCODE-style wiggle (WIG) file. More...
#include <fasta.h>
Public Member Functions | |
bool | Open (const char *szFile, const std::set< std::string > &setstrTypes) |
Opens a FASTA or WIG file and indexes the file without explicitly loading its contents. | |
void | Save (std::ostream &ostm, size_t iWrap=80) const |
Saves a copy of the FASTA file to the given output stream. | |
bool | Get (size_t iGene, std::vector< SFASTASequence > &vecsSequences) const |
Retrieves all sequences (of any type) associated with the given gene index. | |
bool | Get (size_t iGene, std::vector< SFASTAWiggle > &vecsValues) const |
Retrieves all values (of any type) associated with the given gene index. | |
bool | Open (const char *szFile) |
Opens a FASTA or WIG file and indexes the file without explicitly loading its contents. | |
size_t | GetGenes () const |
Returns the total number of genes associated with this FASTA/WIG. | |
const std::string & | GetGene (size_t iGene) const |
Returns the gene ID associated with the given index. | |
size_t | GetGene (const std::string &strGene) const |
Returns the index of the given gene ID. | |
const std::string | GetHeader (size_t iGene, const std::string &strType) const |
Returns the header line associated with the given gene index and sequence type. | |
const std::set< std::string > & | GetTypes () const |
Returns the set of sequence types indexed by this FASTA/WIG. |
Encapsulates a standard FASTA file or a modified ENCODE-style wiggle (WIG) file.
CFASTA performs efficient, disk-based indexing of large FASTA files; it also provides several Sleipnir-specific extensions:
> GENE gene sequence here > GENE 5 upstream flank here > GENE 3 downstream flank here
> GENE AACCGGTTacgtTTGGCCAA
> GENE 0.9 0.1 0.25 ...
bool Sleipnir::CFASTA::Get | ( | size_t | iGene, |
std::vector< SFASTASequence > & | vecsSequences | ||
) | const [inline] |
Retrieves all sequences (of any type) associated with the given gene index.
iGene | Index of gene for which sequences are retrieved. |
vecsSequences | Zero or more output sequences associated with the given gene index. |
bool Sleipnir::CFASTA::Get | ( | size_t | iGene, |
std::vector< SFASTAWiggle > & | vecsValues | ||
) | const [inline] |
Retrieves all values (of any type) associated with the given gene index.
iGene | Index of gene for which values are retrieved. |
vecsValues | Zero or more output values associated with the given gene index. |
Definition at line 123 of file fasta.h.
References Get().
const std::string& Sleipnir::CFASTA::GetGene | ( | size_t | iGene | ) | const [inline] |
Returns the gene ID associated with the given index.
iGene | Gene index for which ID is returned. |
Reimplemented from Sleipnir::CFASTAImpl.
Definition at line 171 of file fasta.h.
Referenced by Save().
size_t Sleipnir::CFASTA::GetGene | ( | const std::string & | strGene | ) | const [inline] |
size_t Sleipnir::CFASTA::GetGenes | ( | ) | const [inline] |
const std::string Sleipnir::CFASTA::GetHeader | ( | size_t | iGene, |
const std::string & | strType | ||
) | const [inline] |
Returns the header line associated with the given gene index and sequence type.
iGene | Gene index for which header is retrieved. |
strType | Sequence type for which header is retrieved. |
Definition at line 207 of file fasta.h.
Referenced by Save().
const std::set<std::string>& Sleipnir::CFASTA::GetTypes | ( | ) | const [inline] |
bool Sleipnir::CFASTA::Open | ( | const char * | szFile, |
const std::set< std::string > & | setstrTypes | ||
) |
Opens a FASTA or WIG file and indexes the file without explicitly loading its contents.
szFile | Path to FASTA/WIG file to open. |
setstrTypes | If nonempty, set of sequence types to be loaded; types not in the set are ignored. |
Definition at line 62 of file fasta.cpp.
References Sleipnir::CMeta::Tokenize().
Referenced by Open().
bool Sleipnir::CFASTA::Open | ( | const char * | szFile | ) | [inline] |
Opens a FASTA or WIG file and indexes the file without explicitly loading its contents.
szFile | Path to FASTA/WIG file to open. |
Definition at line 145 of file fasta.h.
References Open().
void Sleipnir::CFASTA::Save | ( | std::ostream & | ostm, |
size_t | iWrap = 80 |
||
) | const |
Saves a copy of the FASTA file to the given output stream.
ostm | Output stream to which FASTA file is saved. |
iWrap | If given, column at which output FASTA is linewrapped. |
Definition at line 135 of file fasta.cpp.
References Get(), GetGene(), GetGenes(), GetHeader(), Sleipnir::SFASTASequence::m_fIntronFirst, Sleipnir::SFASTABase::m_strType, and Sleipnir::SFASTASequence::m_vecstrSequences.