5 #ifndef BPP_SEQ_IO_PHYLIP_H
6 #define BPP_SEQ_IO_PHYLIP_H
9 #include "../Container/AlignedSequenceContainer.h"
10 #include "../Container/SequenceContainer.h"
11 #include "../Container/VectorSequenceContainer.h"
12 #include "../Sequence.h"
58 Phylip(
bool extended =
true,
bool sequential =
true,
unsigned int charsByLine = 100,
const std::string& split =
" ") :
80 virtual std::unique_ptr<SequenceContainerInterface>
readSequences(std::istream& input, std::shared_ptr<const Alphabet> alpha)
const override
84 virtual std::unique_ptr<SequenceContainerInterface>
readSequences(
const std::string& path, std::shared_ptr<const Alphabet> alpha)
const override
136 std::vector<std::string>
getSizedNames(
const std::vector<std::string>& names)
const;
Partial implementation of the IAlignment and ISequence interface, dedicated to alignment readers.
virtual void readAlignment(std::istream &input, SequenceContainerInterface &sc) const override
Add sequences to a container from a stream.
Partial implementation of the OAlignment interface.
void writeAlignment(std::ostream &output, const SiteContainerInterface &sc) const override=0
Write a container to a stream.
void writeSequential(std::ostream &out, const SiteContainerInterface &sc) const
const std::string getFormatDescription() const override
virtual std::unique_ptr< SequenceContainerInterface > readSequences(const std::string &path, std::shared_ptr< const Alphabet > alpha) const override
Create a new container from a file.
void readSequential(std::istream &in, SequenceContainerInterface &asc) const
void writeInterleaved(std::ostream &out, const SiteContainerInterface &sc) const
const std::string & getSplit() const
virtual std::unique_ptr< SequenceContainerInterface > readSequences(std::istream &input, std::shared_ptr< const Alphabet > alpha) const override
Create a new container from a stream.
unsigned int getNumberOfSequences(const std::string &path) const
void writeAlignment(std::ostream &output, const SiteContainerInterface &sc) const override
Write a container to a stream.
const std::string getFormatName() const override
void writeAlignment(const std::string &path, const SiteContainerInterface &sc, bool overwrite) const override
Write a container to a file.
std::vector< std::string > getSizedNames(const std::vector< std::string > &names) const
unsigned int charsByLine_
The maximum number of chars to be written on a line.
const std::vector< std::string > splitNameAndSequence(const std::string &s) const
Phylip(bool extended=true, bool sequential=true, unsigned int charsByLine=100, const std::string &split=" ")
Build a new Phylip file reader.
void readInterleaved(std::istream &in, SequenceContainerInterface &asc) const
void appendAlignmentFromStream(std::istream &input, SequenceContainerInterface &sc) const override
Append sequences to a container from a stream.
void setSplit(const std::string &split)
The SequenceContainer interface.
std::vector< std::string > split(const std::string &s, std::size_t n)
This alphabet is used to deal NumericAlphabet.