Skip to contents

Build a sorted subject index that can be reused across repeated overlap queries.

Usage

fast_build_index(subject)

Arguments

subject

An IRanges or GRanges object.

Value

A fast_ranges_index object.

Details

The index stores a sorted representation of subject that is optimized for repeated overlap queries.

Build the index once, then pass it as subject to fast_find_overlaps(), fast_count_overlaps(), or other overlap-summary functions.

Use the raw subject object, not the index, when you need subject metadata in the output table, for example with overlap joins.

Examples

s <- IRanges::IRanges(start = c(3, 9, 18), width = c(4, 6, 5))
idx <- fast_build_index(s)
idx
#> <fast_ranges_index>
#>   subject class: IRanges 
#>   subject ranges: 3 
#>   partitions: 1