Hi, I have to different functions I want to call depending on the fact if a input file is fasta or fastq format. My approach to this is: > RecordReader<std::ifstream, SinglePass<> > reader(inFile); > if (checkStreamFormat(reader, Fasta())) > { > std::cerr << "Input file format is fasta." << std::endl; > [call function for fasta] > } > else if (checkStreamFormat(reader, Fastq())) > { > std::cerr << "Input file format is fastq." << std::endl; > [call function for fastq] > } > else > { > std::cerr << "ERORR: Input file format is not fasta or fastq." << std::endl; > return -1; > } This works fine for fasta. However my fastq file is not recognized. I looked into the code for checkStreamFormat a bit and the file is not recognized because the iterator in the readRecord function reaches atEnd before the quality meta data for the 35th record is finished (l. 392). This happens with two different fastq files. So my theory is the following: In the checkStreamFormat function LimitRecordReaderInScope is used. The documentation states that this prevents the stream from "rebuffering". This probably prevents the reader from finishing to read the complete record and the recognition of the file fails. I hope I could make myself clear. I can also provide my code and a sample fastq file if it would be helpful. Cheers, felix