5 #ifndef BPP_SEQ_IO_ABSTRACTIALIGNMENT_H
6 #define BPP_SEQ_IO_ABSTRACTIALIGNMENT_H
9 #include "../Alphabet/Alphabet.h"
10 #include "../Container/AlignedSequenceContainer.h"
11 #include "../Container/VectorSiteContainer.h"
62 std::unique_ptr<SiteContainerInterface>
readAlignment(
const std::string& path, std::shared_ptr<const Alphabet> alpha)
const override
67 std::unique_ptr<SiteContainerInterface>
readAlignment(std::istream& input, std::shared_ptr<const Alphabet> alpha)
const override
95 std::ifstream input(path.c_str(), std::ios::in);
97 throw IOException(
"AbstractIAlignment::appendAlignmentFromFile: can't read file " + path);
110 virtual std::unique_ptr<SiteContainerInterface>
readAlignmentFromStream(std::istream& input, std::shared_ptr<const Alphabet> alpha)
const
125 virtual std::unique_ptr<SiteContainerInterface>
readAlignmentFromFile(
const std::string& path, std::shared_ptr<const Alphabet> alpha)
const
167 std::unique_ptr<SequenceContainerInterface>
readSequences(std::istream& input, std::shared_ptr<const Alphabet> alpha)
const override
170 std::unique_ptr<SequenceContainerInterface> sec = std::move(sic);
174 std::unique_ptr<SequenceContainerInterface>
readSequences(
const std::string& path, std::shared_ptr<const Alphabet> alpha)
const override
177 std::unique_ptr<SequenceContainerInterface> sec = std::move(sic);
220 std::unique_ptr<ProbabilisticSiteContainerInterface>
readAlignment(
const std::string& path, std::shared_ptr<const Alphabet> alpha)
const override
225 std::unique_ptr<ProbabilisticSiteContainerInterface>
readAlignment(std::istream& input, std::shared_ptr<const Alphabet> alpha)
const override
252 std::ifstream input(path.c_str(), std::ios::in);
254 throw IOException(
"AbstractIProbabilisticAlignment::appendAlignmentFromFile: can't read file " + path);
266 virtual std::unique_ptr<ProbabilisticSiteContainerInterface>
readAlignmentFromStream(std::istream& input, std::shared_ptr<const Alphabet>& alpha)
const
280 virtual std::unique_ptr<ProbabilisticSiteContainerInterface>
readAlignmentFromFile(
const std::string& path, std::shared_ptr<const Alphabet>& alpha)
const
317 std::unique_ptr<ProbabilisticSequenceContainerInterface>
readSequences(std::istream& input, std::shared_ptr<const Alphabet> alpha)
const override
320 std::unique_ptr<ProbabilisticSequenceContainerInterface> sec = std::move(sic);
324 std::unique_ptr<ProbabilisticSequenceContainerInterface>
readSequences(
const std::string& path, std::shared_ptr<const Alphabet> alpha)
const override
327 std::unique_ptr<ProbabilisticSequenceContainerInterface> sec = std::move(sic);
Partial implementation of the IAlignment and ISequence interface, dedicated to alignment readers.
std::unique_ptr< SequenceContainerInterface > readSequences(std::istream &input, std::shared_ptr< const Alphabet > alpha) const override
Create a new container from a stream.
virtual ~AbstractIAlignment2()
void readSequences(const std::string &path, SequenceContainerInterface &sc) const override
Create a new container from a file.
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 readSequences(std::istream &input, SequenceContainerInterface &sc) const override
Create a new container from a stream.
Partial implementation of the IAlignment interface, dedicated to alignment readers.
virtual ~AbstractIAlignment()
virtual std::unique_ptr< SiteContainerInterface > readAlignmentFromFile(const std::string &path, std::shared_ptr< const Alphabet > alpha) const
Read sequences from a file.
virtual void appendAlignmentFromStream(std::istream &input, SequenceContainerInterface &sc) const =0
Append sequences to a container from a stream.
virtual void readAlignment(std::istream &input, SequenceContainerInterface &sc) const override
Add sequences to a container from a stream.
std::unique_ptr< SiteContainerInterface > readAlignment(const std::string &path, std::shared_ptr< const Alphabet > alpha) const override
Create a new container from a file.
virtual std::unique_ptr< SiteContainerInterface > readAlignmentFromStream(std::istream &input, std::shared_ptr< const Alphabet > alpha) const
Read sequences from a stream.
std::unique_ptr< SiteContainerInterface > readAlignment(std::istream &input, std::shared_ptr< const Alphabet > alpha) const override
Create a new container from a stream.
virtual void appendAlignmentFromFile(const std::string &path, SequenceContainerInterface &sc) const
Append sequences to a container from a file.
virtual void readAlignment(const std::string &path, SequenceContainerInterface &sc) const override
Add sequences to a container from a file.
void readSequences(std::istream &input, ProbabilisticSequenceContainerInterface &sc) const override
Create a new container from a stream.
std::unique_ptr< ProbabilisticSequenceContainerInterface > readSequences(const std::string &path, std::shared_ptr< const Alphabet > alpha) const override
Create a new container from a file.
AbstractIProbabilisticAlignment2()
virtual ~AbstractIProbabilisticAlignment2()
std::unique_ptr< ProbabilisticSequenceContainerInterface > readSequences(std::istream &input, std::shared_ptr< const Alphabet > alpha) const override
Create a new container from a stream.
void readSequences(const std::string &path, ProbabilisticSequenceContainerInterface &sc) const override
Create a new container from a file.
AbstractIProbabilisticAlignment()
void readAlignment(const std::string &path, ProbabilisticSequenceContainerInterface &sc) const override
Add sequences to a container from a file.
virtual void appendAlignmentFromFile(const std::string &path, ProbabilisticSequenceContainerInterface &sc) const
Append sequences to a container from a file.
virtual void appendAlignmentFromStream(std::istream &input, ProbabilisticSequenceContainerInterface &sc) const =0
Append sequences to a container from a stream.
void readAlignment(std::istream &input, ProbabilisticSequenceContainerInterface &sc) const override
Add sequences to a container from a stream.
std::unique_ptr< ProbabilisticSiteContainerInterface > readAlignment(std::istream &input, std::shared_ptr< const Alphabet > alpha) const override
Create a new container from a stream.
virtual std::unique_ptr< ProbabilisticSiteContainerInterface > readAlignmentFromStream(std::istream &input, std::shared_ptr< const Alphabet > &alpha) const
Read sequences from a stream.
virtual ~AbstractIProbabilisticAlignment()
virtual std::unique_ptr< ProbabilisticSiteContainerInterface > readAlignmentFromFile(const std::string &path, std::shared_ptr< const Alphabet > &alpha) const
Read sequences from a file.
std::unique_ptr< ProbabilisticSiteContainerInterface > readAlignment(const std::string &path, std::shared_ptr< const Alphabet > alpha) const override
Create a new container from a file.
The IAlignment interface.
The IProbabilisticSequence interface.
The IProbabilisticSequence interface.
The SequenceContainer interface.
This alphabet is used to deal NumericAlphabet.
TemplateAlignedSequenceContainer< Sequence, Site > AlignedSequenceContainer
TemplateVectorSiteContainer< ProbabilisticSite, ProbabilisticSequence > ProbabilisticVectorSiteContainer