tcR (version 1.1)

get.n.barcodes: Resample data frame using values from the column with number of clonesets.

Description

Resample data frame using values from the column with number of clonesets. Number of clonestes (i.e., rows of a MiTCR data frame) are reads (usually the "Read.count" column) or UMIs (i.e., barcodes, usually the "Barcode.count" column).

Usage

get.n.barcodes(.data, .n = -1, .col = "Barcode.count")

Arguments

.data
Data frame with the column .col or list of such data frames.
.n
Number of values / reads / UMIs to choose.
.col
Which column choose to compute probabilities of getting a row. See "Details".

Value

  • Data frame with sum(.data[, .col]) == .n.

Details

Using multinomial distribution, compute the number of occurences for each cloneset, than remove zero-number clonotypes and return resulting data frame. Probabilities for rmultinom for each cloneset is a percentage of this cloneset in the .col column.

See Also

rmultinom

Examples

Run this code
# Get 100K reads (not clones!).
immdata.1.100k <- get.n.barcodes(immdata[[1]], 100000, .col = "Read.count")

Run the code above in your browser using DataLab