9 #include "../Container/SequenceContainer.h"
10 #include "../Container/VectorSequenceContainer.h"
11 #include "../Sequence.h"
23 throw IOException (
"DCSE::read : fail to open file");
28 string line, name, sequence =
"";
45 string::size_type endOfSeq = line.find(
" ");
46 if (endOfSeq == line.npos)
48 sequence = string(line.begin(), line.begin() +
static_cast<ptrdiff_t
>(endOfSeq));
57 name = string(line.begin() +
static_cast<ptrdiff_t
>(endOfSeq + 1), line.end()),
59 if (name.find(
"Helix numbering") == name.npos
60 && name.find(
"mask") == name.npos)
62 auto seqPtr = make_unique<Sequence>(name, sequence, alphaPtr);
void appendAlignmentFromStream(std::istream &input, SequenceContainerInterface &sc) const override
Append sequences to a container from a stream.
const std::string getFormatName() const override
const std::string getFormatDescription() const override
The SequenceContainer interface.
virtual void addSequence(const HashType &sequenceKey, std::unique_ptr< SequenceType > &sequencePtr)=0
Add a sequence to the container.
virtual std::shared_ptr< const Alphabet > getAlphabet() const =0
Get a pointer toward the container's alphabet.
std::string removeWhiteSpaces(const std::string &s)
std::string removeChar(const std::string &s, char c)
std::string removeFirstWhiteSpaces(const std::string &s)
This alphabet is used to deal NumericAlphabet.