Learn R Programming

tcR (version 2.2.4)

rarefaction: Diversity evaluation using rarefaction.

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

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.

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.

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.

See Also

vis.rarefaction rmultinom

Examples

Run this code
# NOT RUN {
rarefaction(immdata, .col = "Read.count")
# }

Run the code above in your browser using DataLab