esteinig / nanoq

Minimal but speedy quality control for nanopore reads in Rust :bear:
MIT License
109 stars 9 forks source link

Buffer size limit in IO #1

Closed esteinig closed 4 years ago

esteinig commented 4 years ago

Draft is working, but fails on 'long' reads - i.e. on a single smallish read of 4098 bp. I think this is due to the BUFSIZE limit in the crate fastq::Reader implementation:

#[cfg(fuzzing)]
const BUFSIZE: usize = 64;
#[cfg(not(fuzzing))]
const BUFSIZE: usize = 68 * 1024;

and later returns the error message linked to:


let buffer = vec![0u8; BUFSIZE].into_boxed_slice();
    let buffer = self.parser.buffer.replace_buffer(buffer);
    if self.parser.buffer.n_free() == 0 {
        return Some(Err(Error::new(ErrorKind::InvalidData,
             "Fastq record is too long.")))
    }
esteinig commented 4 years ago

Try to replace with bio::io::fastq