class

BigWig::Writer

Inherits Reference < Object

Streaming bigWig writer. Input must follow chromosome declaration order and have increasing, non-overlapping coordinates. close finalizes indexes and zoom levels; abort discards a path-backed temporary output.

Constructors

new(io : IO, chromosomes, *, options : WriteOptions = WriteOptions.new, sync_close : Bool = false, destination : String | Nil = nil)

For existing, empty, seekable IO. The IO remains open by default. destination is used by the path factory, not by normal IO callers.

Source

Instance methods

abort

Does not finalize. Existing caller-owned IO remains open and may contain incomplete bytes; a path-backed destination is not published.

Source
aborted?
Source
add(chrom : String, start : Int, stop : Int, value : Int | Float) : Nil

Add a bedGraph-style interval, using the file's float32 value precision.

Source
add(chrom : String, interval : Interval) : Nil
Source
add(chrom : String, intervals : Enumerable(Interval)) : Nil

Accepts a lazy Enumerable; it is never converted to an array.

Source
add_span(chrom : String, *, start : Int, span : Int, values, step : Int = span) : Nil

fixedStep encoding. Coordinates remain zero-based (unlike WIG text).

Source
add_spans(chrom : String, entries, *, span : Int) : Nil

variableStep encoding. entries lazily yields {start, value} tuples.

Source
close

Finalize and publish. Explicit close inside a block commits immediately; a later exception in that user block cannot undo an already committed file.

Source
closed?
Source
flush

Flush pending data. This does not finalize the file or publish a path.

Source