downsampling | R Documentation |
Downsamples cells from each group for IDER-based similarity calculation.
downsampling(
metadata,
n.size = 35,
seed = NULL,
include = FALSE,
replace = FALSE,
lower.cutoff = 3
)
metadata |
A data frame containing at least two columns: one for group labels and one for batch information. Each row corresponds to a single cell. Required. |
n.size |
Numeric value specifying the number of cells to use in each group.
Default is |
seed |
Numeric value to set the random seed for sampling. Default is |
include |
Logical value indicating whether to include groups that have fewer cells than |
replace |
Logical value specifying whether to sample with replacement if a group
is smaller than |
lower.cutoff |
Numeric value indicating the minimum group size required for inclusion.
Default is |
A list of numeric indices (or cell names) for cells to be kept for downstream computation.
# 'meta' is a data frame with columns 'label' and 'batch'
meta <- data.frame(
label = c(rep("A", 40), rep("A", 35), rep("B", 20)),
batch = c(rep("X", 40), rep("Y", 35), rep("X", 20))
)
keep_cells <- downsampling(meta, n.size = 35, seed = 12345)
# Display the selected indices
print(keep_cells)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.