Counts, for each span, the GDS records whose position lies in [start, end] on chr, from a build_variant_index index. This is the record count before any filter, the quantity the large-gene segmentation of GLOWpipeline::build_scan_regions thresholds on, because it depends only on the file and costs two binary searches per span.

count_index_records(variant_index, chr, start, end)

Arguments

variant_index

A glow_variant_index.

chr

Chromosome value(s), recycled to the length of start.

start, end

Integer vectors of span bounds (inclusive), same length.

Value

An integer vector of counts, one per span. A chromosome absent from the index gives 0.

Examples

if (FALSE) { # \dontrun{
idx <- build_variant_index("chr22.gds")
genes <- define_regions_gene(chr = 22)
n_rec <- count_index_records(idx, genes$chr, genes$start, genes$end)
} # }