View source: R/operations_downsample.R
| downsample_immundata | R Documentation |
Downsamples an ImmunData object by selecting barcodes within each repertoire.
If repertoire schema is not defined, the entire dataset is treated as one repertoire.
The function uses a single parameter n:
If 0 < n < 1, n is treated as a proportion of repertoire size.
If n > 1, n is treated as an absolute target count.
If n == 1, an error is raised.
Downsampling is barcode-based. For count-based inputs (e.g. bulk),
per-barcode counts (imd_n_chains) are trimmed when needed to reach the target.
downsample_immundata(idata, n, seed = NULL)
idata |
An |
n |
Numeric scalar controlling downsampling amount. See details for interpretation. |
seed |
Optional integer scalar for reproducible sampling. |
A new ImmunData object with downsampled annotations.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.