loneknightpy / idba

124 stars 53 forks source link

throw an error when loading fastq #29

Open jjkoehorst opened 7 years ago

jjkoehorst commented 7 years ago

Can you please implement that when loading a fastq file instead of fasta that idba will throw an error instead of loading it into memory and just sits there doing nothing? I just forgot about it and I was wondering why it was not doing anything....

tseemann commented 6 years ago

There seems to be some sort of FASTQ capability in the code:

**
 * @brief It is the reader class for Fastq file.
 */
class FastqReader: public SequenceReader
{
public:
    explicit FastqReader(std::istream &is, bool is_own = false)
        : SequenceReader(is, false) {}
    explicit FastqReader(const std::string &filename,
            std::ios_base::openmode mode = std::ios_base::in | std::ios_base::binary)
        : SequenceReader(*(new std::ifstream(filename.c_str(), mode)), true) {}

protected:
    virtual bool ReadRecord(Sequence &seq, std::string &comment, std::string &quality);

private:
    FastqReader(const FastqReader &);
    const FastqReader &operator =(const FastqReader &);
};