pub fn write_bigwig_streaming<P>(
path: &Path,
chrom_sizes: Vec<(String, u32)>,
queue_depth: usize,
produce: P,
) -> Result<(), Box<dyn Error>>Expand description
Write a bigWig, pulling scores from produce as they are needed.
bigtools takes an iterator, but the scoring loop pushes, so the producer runs on its own thread and feeds a bounded channel. The bound is what makes this streaming rather than merely deferred: when the writer falls behind, the producer blocks instead of queueing the genome up in memory.