View source: R/polishDataset.R
polishDataset | R Documentation |
Prepare a SummarizedExperiment or SingleCellExperiment to be saved with saveDataset
.
This performs some minor changes to improve storage efficiency.
polishDataset(
x,
strip.inner.names = TRUE,
reformat.assay.by.density = 0.3,
attempt.integer.conversion = TRUE,
remove.altexp.coldata = TRUE,
forbid.nested.altexp = TRUE
)
x |
A SummarizedExperiment or one of its subclasses. |
strip.inner.names |
Logical scalar indicating whether to strip redundant names from internal objects, e.g., dimnames of the assays, row names of reduced dimensions, column names of alternative experiments. This saves some space in the on-disk representation. |
reformat.assay.by.density |
Numeric scalar indicating whether to optimize assay formats based on the density of non-zero values.
Assays with densities above this number are converted to ordinary dense arrays (if they are not already), while those with lower densities are converted to sparse matrices.
This can be disabled by setting it to |
attempt.integer.conversion |
Logical scalar indicating whether to convert double-precision assays containing integer values to actually have the integer type. This can improve efficiency of downstream applications by avoiding the need to operate in double precision. |
remove.altexp.coldata |
Logical scalar indicating whether column data for alternative experiments should be removed.
This defaults to |
forbid.nested.altexp |
Logical scalar indicating whether nested alternative experiments (i.e., alternative experiments of alternative experiments) should be forbidden.
This defaults to |
A modified copy of x
.
Aaron Lun
mat <- matrix(rpois(1000, lambda=0.2), 100, 10) * 1.0
rownames(mat) <- sprintf("GENE_%i", seq_len(nrow(mat)))
colnames(mat) <- head(LETTERS, 10)
library(SingleCellExperiment)
sce <- SingleCellExperiment(list(counts=mat))
str(assay(sce, withDimnames=FALSE))
polished <- polishDataset(sce)
str(assay(polished, withDimnames=FALSE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.