47 #include "../Sequence.h" 48 #include "../Container/SequenceContainer.h" 49 #include "../Container/VectorSequenceContainer.h" 50 #include <Bpp/Numeric/Range.h> 51 #include <Bpp/Utils/MapTools.h> 64 mutable std::map<std::string, std::string>
trees_;
81 const std::string&
getTree(
const std::string& name)
const throw (Exception) {
85 throw Exception(
"MaseHeader::getTree. No tree with name " + name);
88 const MultiRange<size_t>&
getSiteSelection(
const std::string& name)
const throw (Exception) {
92 throw Exception(
"MaseHeader::getSiteSelection. No site selection with name " + name);
99 throw Exception(
"MaseHeader::getSequenceSelection. No sequence selection with name " + name);
103 void setTree(
const std::string& name,
const std::string& tree) {
165 std::ifstream input(path.c_str(), std::ios::in);
216 std::ofstream output(path.c_str(), overwrite ? (std::ios::out) : (std::ios::out | std::ios::app));
232 return "Optional file comments (preceeded by ;;), sequence comments (preceeded by ;), sequence name, sequence";
VectorSequenceContainer * readMeta(std::string &path, const Alphabet *alpha, MaseHeader &header) const
void writeMeta(std::ostream &output, const SequenceContainer &sc, const MaseHeader &header) const
The SiteContainer interface.
This alphabet is used to deal NumericAlphabet.
Partial implementation of the IAlignment interface, dedicated to alignment readers.
The VectorSequenceContainer class.
void writeSequences(std::ostream &output, const SequenceContainer &sc) const =0
Write a container to a stream.
void writeSequences(std::ostream &output, const SequenceContainer &sc) const
Write a container to a stream.
The mase sequence file format.
void readHeader_(std::istream &input, MaseHeader &header) const
void appendAlignmentFromStream(std::istream &input, SiteContainer &sc) const
Append sequences to a container from a stream.
unsigned int charsByLine_
The maximum number of chars to be written on a line.
const std::string getFormatName() const
Mase(unsigned int charsByLine=100, bool checkSequenceNames=true)
Build a new Mase object.
const std::string getFormatDescription() const
void writeHeader_(std::ostream &output, const MaseHeader &header) const
void writeSequences(const std::string &path, const SequenceContainer &sc, bool overwrite=true) const
Write a container to a file.
Partial implementation of the OSequence and OAlignment interfaces.
void writeMeta(const std::string &path, const SequenceContainer &sc, const MaseHeader &header, bool overwrite=true) const
virtual void readSequences(std::istream &input, SequenceContainer &sc) const
Add sequences to a container from a stream.
Partial implementation of the ISequence interface.
VectorSequenceContainer * readMeta(std::istream &input, const Alphabet *alpha, MaseHeader &header) const
The SequenceContainer interface.
void appendSequencesFromStream(std::istream &input, SequenceContainer &sc) const
Append sequences to a container from a stream.
void checkNames(bool yn)
Tell whether the sequence names should be checked when reading from files.