bpp-seq  2.2.0
bpp::Fasta::FileIndex Class Reference

The SequenceFileIndex class for Fasta format. More...

#include <Bpp/Seq/Io/Fasta.h>

+ Inheritance diagram for bpp::Fasta::FileIndex:
+ Collaboration diagram for bpp::Fasta::FileIndex:

Public Member Functions

 FileIndex ()
 
 ~FileIndex ()
 
void build (const std::string &path) throw (Exception)
 Build the index given a path to the file. More...
 
std::streampos getSequencePosition (const std::string &id) const throw (Exception)
 Get the position of a Sequence given its ID. More...
 
size_t getNumberOfSequences () const throw (Exception)
 Get the number of sequences. More...
 
void read (const std::string &path) throw (Exception)
 Read the index from a file. More...
 
void write (const std::string &path) throw (Exception)
 Write the index to a file. More...
 
void getSequence (const std::string &seqid, Sequence &seq, const std::string &path) const
 Get a sequence given its ID. More...
 

Private Attributes

std::map< std::string, std::streampos > index_
 
std::streampos fileSize_
 

Detailed Description

The SequenceFileIndex class for Fasta format.

Author
Sylvain Gaillard

Definition at line 184 of file Fasta.h.

Constructor & Destructor Documentation

◆ FileIndex()

bpp::Fasta::FileIndex::FileIndex ( )
inline

Definition at line 186 of file Fasta.h.

◆ ~FileIndex()

bpp::Fasta::FileIndex::~FileIndex ( )
inline

Definition at line 187 of file Fasta.h.

Member Function Documentation

◆ build()

void Fasta::FileIndex::build ( const std::string &  path)
throw (Exception
)
virtual

Build the index given a path to the file.

Implements bpp::SequenceFileIndex.

Definition at line 231 of file Fasta.cpp.

◆ getNumberOfSequences()

size_t bpp::Fasta::FileIndex::getNumberOfSequences ( ) const
throw (Exception
)
inlinevirtual

Get the number of sequences.

Implements bpp::SequenceFileIndex.

Definition at line 190 of file Fasta.h.

References index_.

◆ getSequence()

void Fasta::FileIndex::getSequence ( const std::string &  seqid,
Sequence seq,
const std::string &  path 
) const

Get a sequence given its ID.

Definition at line 282 of file Fasta.cpp.

References bpp::Fasta::nextSequence().

◆ getSequencePosition()

streampos Fasta::FileIndex::getSequencePosition ( const std::string &  id) const
throw (Exception
)
virtual

Get the position of a Sequence given its ID.

Implements bpp::SequenceFileIndex.

Definition at line 252 of file Fasta.cpp.

◆ read()

void Fasta::FileIndex::read ( const std::string &  path)
throw (Exception
)

Read the index from a file.

Definition at line 260 of file Fasta.cpp.

◆ write()

void Fasta::FileIndex::write ( const std::string &  path)
throw (Exception
)

Write the index to a file.

Definition at line 274 of file Fasta.cpp.

Member Data Documentation

◆ fileSize_

std::streampos bpp::Fasta::FileIndex::fileSize_
private

Definition at line 207 of file Fasta.h.

◆ index_

std::map<std::string, std::streampos> bpp::Fasta::FileIndex::index_
private

Definition at line 206 of file Fasta.h.

Referenced by getNumberOfSequences().


The documentation for this class was generated from the following files: