View source: R/rebuildIndices.R
rebuildIndex | R Documentation |
Rebuild the index (or indices), typically after restarting the R session. This is because the indices are held in external memory and are not serialized correctly by R.
rebuildIndex(trained, num.threads = 1)
trained |
List containing the output of |
num.threads |
Integer specifying the number of threads to use for training. |
trained
is returned with valid indices.
If it already had valid indices, this function is a no-op.
Aaron Lun
# Making up the training set.
ref <- .mockRefData()
ref <- scuttle::logNormCounts(ref)
trained <- trainSingleR(ref, ref$label)
trained$built # a valid address
# Saving and reloading the index.
tmp <- tempfile(fileext=".rds")
saveRDS(trained, file=tmp)
reloaded <- readRDS(tmp)
reloaded$built # not valid anymore
rebuilt <- rebuildIndex(reloaded)
rebuilt$built # back to validity
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.