47 #include <Bpp/Text/KeyvalTools.h> 57 unparsedArguments_.clear();
59 KeyvalTools::parseProcedure(description, format, unparsedArguments_);
60 unsigned int ncol = ApplicationTools::getParameter<unsigned int>(
"length", unparsedArguments_, 100,
"",
true, warningLevel_);
61 auto_ptr<OAlignment> oAln;
62 if (format ==
"Fasta")
64 oAln.reset(
new Fasta(ncol));
66 else if (format ==
"Mase")
68 oAln.reset(
new Mase(ncol));
70 else if (format ==
"Clustal")
74 else if (format ==
"Phylip")
76 bool sequential =
true, extended =
true;
78 string order = ApplicationTools::getStringParameter(
"order", unparsedArguments_,
"sequential",
"",
true, warningLevel_);
79 if (order ==
"sequential")
81 else if (order ==
"interleaved")
84 throw Exception(
"BppOAlignmentWriterFormat::read. Invalid argument 'order' for phylip format: " + order);
86 string type = ApplicationTools::getStringParameter(
"type", unparsedArguments_,
"extended",
"",
true, warningLevel_);
87 if (type ==
"extended")
90 split = ApplicationTools::getStringParameter(
"split", unparsedArguments_,
"spaces",
"",
true, warningLevel_);
91 if (split ==
"spaces")
93 else if (split ==
"tab")
96 throw Exception(
"BppOAlignmentWriterFormat::read. Invalid argument 'split' for phylip format: " + split);
98 else if (type ==
"classic")
101 throw Exception(
"BppOAlignmentWriterFormat::read. Invalid argument 'type' for phylip format: " + type);
103 oAln.reset(
new Phylip(extended, sequential, ncol,
true, split));
105 else if (format ==
"Stockholm")
111 throw Exception(
"Sequence format '" + format +
"' unknown.");
114 return oAln.release();
The OAlignment interface.
The fasta sequence file format.
This alphabet is used to deal NumericAlphabet.
The Stockholm alignment file format.
The clustal sequence file format.
The mase sequence file format.