19 throw IOException (
"GenBank::read: fail to open file");
22 string temp, name, sequence =
"";
28 getline(input, temp,
'\n');
30 if (temp.size() >= 9 && temp.substr(0, 9) ==
"ACCESSION")
37 if (temp.size() >= 6 && temp.substr(0, 6) ==
"ORIGIN")
40 getline(input, temp,
'\n');
41 while (!input.eof() && temp.size() > 2 && temp.substr(0, 2) !=
"//")
44 getline(input, temp,
'\n');
47 throw Exception(
"GenBank::read(). Sequence with no ACCESSION number!");
48 auto seq = make_unique<Sequence>(name, sequence, alphaPtr);
void appendSequencesFromStream(std::istream &input, SequenceContainerInterface &sc) const
Append sequences to a container from a stream.
const std::string & nextToken()
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 removeSurroundingWhiteSpaces(const std::string &s)
This alphabet is used to deal NumericAlphabet.