loadIndexedFst | R Documentation |
Functions to save or load and indexed fst
file
Saves a data.frame (or GRanges object) into an indexed FST file.
loadIndexedFst(file, nthreads = 1)
saveIndexedFst(
d,
index.by,
file.prefix,
nthreads = 1,
index.properties = NULL,
add.info = list(),
...
)
file |
Path to the fst file, it's index (.idx), or their prefix. |
nthreads |
Number of threads to use for reading (default 1). This does not affect the loading of the index itself, but will affect all downstream reading operations performed on the object. If NULL, will use 'fst::threads_fst()'. |
d |
A data.frame or |
index.by |
A column of 'd' by which it should be indexed. |
file.prefix |
Path and prefix of the output files. |
index.properties |
An optional data.frame of properties, with the levels of 'index.by' as row names. |
add.info |
An optional list of additional information to save. |
... |
Passed to 'write.fst' |
'loadIndexedFst' returns an object of class
IndexedFst-class
, and 'saveIndexedFst' returns nothing.
IndexedFst-class
IndexedFst-class
# we first create and save an indexed FST file
tmp <- tempdir()
f <- system.file(tmp, "test")
d <- data.frame( category=sample(LETTERS[1:4], 10000, replace=TRUE),
var2=sample(LETTERS, 10000, replace=TRUE),
var3=runif(10000) )
saveIndexedFst(d, "category", f)
# we then load the index, and can use category names for random access:
d <- loadIndexedFst(f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.