pub fn reader(filename: &str) -> Box<dyn BufRead + Send + 'static>
Expand description

Read normal or compressed files seamlessly Uses the presence of a .gz or .bgz extension to decide Examples with zipped and unzipped

use rustybam::myio::*;
use std::io::BufRead; // must import BufRead or you get an error at `lines()`
let n_paf = reader(".test/asm_small.paf").lines().count();
let n_paf_bgz = reader(".test/asm_small.paf.bgz").lines().count();
assert_eq!(n_paf, n_paf_bgz);
let n_paf_gz = reader(".test/asm_small.paf.gz").lines().count();
assert_eq!(n_paf, n_paf_gz);