42 #ifndef _BPP_SEQ_IO_FASTA_H_ 43 #define _BPP_SEQ_IO_FASTA_H_ 48 #include "../Sequence.h" 49 #include "../Container/SequenceContainer.h" 50 #include "../Container/VectorSequenceContainer.h" 136 return "Sequence name (preceded by >) in one line, sequence content, no comments";
188 void build(
const std::string& path)
throw (Exception);
196 void read(
const std::string& path)
throw (Exception);
200 void write(
const std::string& path)
throw (Exception);
206 std::map<std::string, std::streampos>
index_;
213 #endif // _BPP_SEQ_IO_FASTA_H_ The OSequenceStream interface.
void build(const std::string &path)
Build the index given a path to the file.
The fasta sequence file format.
void getSequence(const std::string &seqid, Sequence &seq, const std::string &path) const
Get a sequence given its ID.
The SiteContainer interface.
This alphabet is used to deal NumericAlphabet.
std::streampos getSequencePosition(const std::string &id) const
Get the position of a Sequence given its ID.
Fasta(unsigned int charsByLine=100, bool checkSequenceNames=true, bool extended=false, bool strictSequenceNames=false)
Build a new Fasta object.
Partial implementation of the IAlignment interface, dedicated to alignment readers.
void writeSequences(const std::string &path, const SequenceContainer &sc, bool overwrite=true) const
Write a container to a file.
const std::string getFormatName() const
void writeSequences(std::ostream &output, const SequenceContainer &sc) const =0
Write a container to a stream.
void appendAlignmentFromStream(std::istream &input, SiteContainer &sc) const
Append sequences to a container from a stream.
void read(const std::string &path)
Read the index from a file.
void checkNames(bool yn)
Tell whether the sequence names should be checked when reading from files.
void strictNames(bool yn)
Tell wethed the sequence name should be restrected to the first non blank characters.
size_t getNumberOfSequences() const
Get the number of sequences.
Index to retrieve Sequence in a file.
std::map< std::string, std::streampos > index_
void write(const std::string &path)
Write the index to a file.
void writeSequence(std::ostream &output, const Sequence &seq) const
Read sequence from stream.
void writeSequences(std::ostream &output, const SequenceContainer &sc) const
Write a container to a stream.
The SequenceFileIndex class for Fasta format.
Partial implementation of the OSequence and OAlignment interfaces.
Partial implementation of the ISequence interface.
void appendSequencesFromStream(std::istream &input, SequenceContainer &sc) const
Append sequences to a container from a stream.
The SequenceContainer interface.
The ISequenceStream interface.
unsigned int charsByLine_
The maximum number of chars to be written on a line.
bool nextSequence(std::istream &input, Sequence &seq) const
Read sequence from stream.
const std::string getFormatDescription() const