class

BigWig::Reader

Inherits Reference < Object

Reads local/remote bigWig and bigBed files. Prefer BigWig.open with a block. Each iterator has its own traversal and decode buffers. Advancing one iterator cannot invalidate values returned by another.

Constructors

new(path : String | Path, *, options : ReadOptions = ReadOptions.new, headers : HTTP::Headers = HTTP::Headers.new)
Source
new(io : IO, *, sync_close : Bool = false, options : ReadOptions = ReadOptions.new)
Source

Instance methods

bigbed?
Source
bigwig?
Source
chromosome_size(chrom : String) : Int64 | Nil
Source
chromosomes

A copy in chromosome-ID order, not a mutable view of internal metadata.

Source
close
Source
closed?
Source
coverage(chrom : String, start : Int = 0, stop : Int | Nil = nil, *, exact : Bool = false) : Float64
Source
coverage(chrom : String, range : Range(B, E), *, exact : Bool = false) : Float64 forall B, E
Source
each_entry(chrom : String, range : Range(B, E)) forall B, E
Source
each_entry(chrom : String, start : Int = 0, stop : Int | Nil = nil)
Source
each_entry(chrom : String, range : Range(B, E), &) forall B, E
Source
each_entry(chrom : String, start : Int = 0, stop : Int | Nil = nil, & : BedEntry -> ) : Nil
Source
each_interval(chrom : String, range : Range(B, E)) forall B, E
Source
each_interval(chrom : String, start : Int = 0, stop : Int | Nil = nil)

Lazily yields whole overlapping records. Empty ranges yield nothing.

Source
each_interval(chrom : String, range : Range(B, E), &) forall B, E
Source
each_interval(chrom : String, start : Int = 0, stop : Int | Nil = nil, & : Interval -> ) : Nil
Source
each_value(chrom : String, start : Int, stop : Int)
Source
each_value(chrom : String, start : Int, stop : Int, & : Float32 -> ) : Nil
Source
each_value(chrom : String, range : Range(B, E)) forall B, E
Source
each_value(chrom : String, range : Range(B, E), &) forall B, E
Source
entries(chrom : String, range : Range(B, E)) forall B, E
Source
entries(chrom : String, start : Int = 0, stop : Int | Nil = nil) : Array(BedEntry)
Source
file_type
Source
header
Source
intervals(chrom : String, range : Range(B, E)) forall B, E
Source
intervals(chrom : String, start : Int = 0, stop : Int | Nil = nil) : Array(Interval)
Source
max(chrom : String, start : Int = 0, stop : Int | Nil = nil, *, exact : Bool = false) : Float64
Source
max(chrom : String, range : Range(B, E), *, exact : Bool = false) : Float64 forall B, E
Source
mean(chrom : String, start : Int = 0, stop : Int | Nil = nil, *, exact : Bool = false) : Float64
Source
mean(chrom : String, range : Range(B, E), *, exact : Bool = false) : Float64 forall B, E
Source
min(chrom : String, start : Int = 0, stop : Int | Nil = nil, *, exact : Bool = false) : Float64
Source
min(chrom : String, range : Range(B, E), *, exact : Bool = false) : Float64 forall B, E
Source
read_values(chrom : String, start : Int, buffer : Slice(Float32)) : Int32

Fills every element, including NaN gaps. Returns buffer.size; never a short read. A range extending past the chromosome raises ArgumentError.

Source
sql

Unparsed AutoSQL, or nil when absent. Only available for bigBed.

Source
stats(chrom : String, start : Int = 0, stop : Int | Nil = nil, *, type : Symbol = :mean, bins : Int = 1, exact : Bool = false) : Array(Float64)

Always returns bins Float64s. Empty bins (including coverage and sum) are NaN. Mean excludes uncovered bases; coverage divides by bin width. std is the sample standard deviation (n-1), with one exact base => 0.

With exact: false, use the coarsest zoom not exceeding half a bin's width. Partly intersecting zoom records are weighted by overlap/width; minima/maxima may include data just outside the requested bin.

Source
stats(chrom : String, range : Range(B, E), **options) forall B, E
Source
std(chrom : String, start : Int = 0, stop : Int | Nil = nil, *, exact : Bool = false) : Float64
Source
std(chrom : String, range : Range(B, E), *, exact : Bool = false) : Float64 forall B, E
Source
sum(chrom : String, start : Int = 0, stop : Int | Nil = nil, *, exact : Bool = false) : Float64
Source
sum(chrom : String, range : Range(B, E), *, exact : Bool = false) : Float64 forall B, E
Source
value(chrom : String, position : Int) : Float32
Source
values(chrom : String, start : Int, stop : Int) : Array(Float32)

Dense values, with NaN for uncovered bases. Allocation is proportional to stop-start; use read_values/each_interval for unbounded regions.

Source
values(chrom : String, range : Range(B, E)) forall B, E
Source
zoom_levels

Reduction factors actually stored in the file, from fine to coarse.

Source