rarefaction: Diversity evaluation using rarefaction.

Description Usage Arguments Details Value See Also Examples

Description

Sequentially resample the given data with growing sample size the given data and compute mean number of unique clones. For more details on the procedure see "Details".

Usage

1
2
3
4
5
6
7
8
rarefaction(
  .data,
  .step = NA,
  .quantile = c(0.025, 0.975),
  .extrapolation = 2e+05,
  .col = "Umi.count",
  .verbose = T
)

Arguments

.data

Data frame or a list with data frames.

.step

Step's size. By default - minimal repertoire size divided by 50.

.quantile

Numeric vector of length 2 with quantiles for confidence intervals.

.extrapolation

If N > 0 than perform extrapolation of all samples to the size of the max one +N reads or UMIs. By default - 200000.

.col

Column's name from which choose frequency of each clone.

.verbose

if T then print progress bar.

Details

This subroutine is designed for diversity evaluation of repertoires. On each step it computes a mean unique clones from sample of fixed size using bootstrapping. Unique clones for each sample from bootstrap computed as a number of non-zero elements in a vector from multinomial distribution with input vector of probabilities from the .col column using function rmultinom with parameters n = .n, size = i * .step, prob = .data[, .col] (i is an index of current iteration) and choosing for lower and upper bound quantile bounds of the computed distribution of unique clones.

Value

Data frame with first column for sizes, second columns for the first quantile, third column for the mean, fourth columns for the second quantile, fifth columns for the name of subject.

See Also

vis.rarefaction rmultinom

Examples

1
2
3
4
## Not run: 
rarefaction(immdata, .col = "Read.count")

## End(Not run)

tcR documentation built on July 2, 2020, 3:18 a.m.