44 #include "../StringSequenceTools.h" 45 #include <Bpp/Text/TextTools.h> 46 #include <Bpp/Text/StringTokenizer.h> 47 #include <Bpp/Io/FileTools.h> 57 throw IOException(
"Stockholm::writeAlignment: can't write to ostream output");
59 output <<
"# STOCKHOLM 1.0" << endl;
61 for (
size_t i = 0; i < sc.getGeneralComments().size(); ++i)
63 output <<
"#=GF CC " << sc.getGeneralComments()[i] << endl;
67 vector<string> names = sc.getSequencesNames();
69 for(
unsigned int i = 0; i < names.size(); ++i)
71 names[i] = TextTools::removeWhiteSpaces(names[i]);
72 if (names[i].size() > maxSize) maxSize = names[i].size();
74 if (maxSize > 255) maxSize = 255;
75 for (
size_t i = 0; i < sc.getNumberOfSequences(); ++i)
77 output << TextTools::resizeRight(names[i], maxSize) <<
" " << sc.getSequence(i).toString() << endl;
79 output <<
"//" << endl;
The SiteContainer interface.
This alphabet is used to deal NumericAlphabet.
void writeAlignment(std::ostream &output, const SiteContainer &sc) const
Write a container to a stream.