Description Usage Arguments Details Value See Also
Sample (downsample) repertoires using different approches.
1 2 3 4 5 6 |
.data |
The data to be processed. Can be data.frame, data.table, or a list of these objects. Every object must have columns in the immunarch compatible format. immunarch_data_format Competent users may provide advanced data representations: DBI database connections, Apache Spark DataFrame from copy_to or a list of these objects. They are supported with the same limitations as basic objects. Note: each connection must represent a separate repertoire. |
.method |
Character. Name of a sampling method. See "Description" for more details. Default value is "downsample" that downsamples repertoires to the number of clones (i.e., reads / UMIs) that the smallest repertoire has, if user doesn't pass any value to the ".n" argument. |
.n |
Integer. Number of clones / clonotypes / reads / UMIs to choose, depending on the method. Pass NA to sample repertoires to the size of the smallest repertoire in the ".data". |
.prob |
Logical. If T then sample clonotypes with probability weights equal to their number of clones. Used only if ".method" is "sample". |
If .method
is "downsample" then repSample
chooses .n
clones (not clonotypes!) from the input repertoires without any probabilistic simulation,
but exactly computing each choosed clones. Such approach is is more consistent and biologically pleasant than
an output from the function if .method
is "resample".
If .method
is "resample" then repSample
uses multinomial distribution to compute the number of occurences for each cloneset.
then it removes zero-number clonotypes and return the resulting data frame. Probabilities for rmultinom
for each cloneset
is a percentage of this cloneset in the "Proportion" column. It's a some sort of simulation of how clonotypes are chosen from the organisms.
if .method
is "sample" then repSample
chooses .n
clonotypes (not clones!) randomly. Depending on the
.prob
argument, the function chooses clonotypes either according to their size (if .prob
is T, by default),
or each clonotype has an equal chance to be choosed (if .prob
is F). Note that sampling is done without replacing.
Subsampled data frame.
rmultinom, clonal_proportion
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.