Skip to contents

Save a fast_ranges_index object to disk for reuse across sessions.

Usage

fast_save_index(index, path, compress = TRUE)

Arguments

index

A fast_ranges_index object created by fast_build_index().

path

Output file path for the serialized index.

compress

Logical scalar. If TRUE, uses xz compression.

Value

Invisibly returns path.

Details

Saving an index is useful when index construction is expensive and the same subject set will be queried again in a later R session.

Examples

s <- IRanges::IRanges(start = c(3, 9, 18), width = c(4, 6, 5))
idx <- fast_build_index(s)
f <- tempfile(fileext = ".rds")
fast_save_index(idx, f)
unlink(f)