Skip to content

Commit

Permalink
ignore fasta comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kloetzl committed Aug 17, 2017
1 parent bb0a7f9 commit a0cc19d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Sequence.cpp
Expand Up @@ -39,8 +39,16 @@ std::vector<Sequence> Sequence::read(std::string fileName)
while (!infile.eof())
{
std::getline(infile, header);

// extract name from header
auto pos = header.find_first_of(" \t\r\n");
if (pos == std::string::npos) {
pos = header.size();
}

auto name = std::string(header, 0, pos);
std::getline(infile, line, '>');
sequences.push_back(Sequence(header, line));
sequences.push_back(Sequence(name, line));
}
return sequences;
}
Expand Down

0 comments on commit a0cc19d

Please sign in to comment.