Skip to main content

open_text

Function open_text 

Source
pub fn open_text(path: impl AsRef<Path>) -> Result<(TextInput, u64)>
Expand description

Open a path for sequential reading, inflating when it is gzipped.

This is what the converters read their bedGraph / WIG / BED through, and the only place in the crate that reads sequentially rather than by offset.

The magic decides, not the name: a .bedgraph holding gzip is read, and a .gz holding text is too. Returns the reader and the file’s size on disk, which is what the converters report progress against — the compressed size, since that is what “how far through the file are we” means to a caller watching it.