hanabi: hanabi

Description Usage Arguments Details Value See Also Examples

Description

Rarefy data at multiple sample sizes, in preparation for plotting.

Usage

1
hanabi(expr_data, npoints = 20, step = 0.75, from = NULL)

Arguments

expr_data

An expression table where columns are samples and rows are features such as genes, TSS, etc, or a vector of counts.

npoints

The maximum number of rarefactions per sample.

step

Subsample sizes are calculated by taking the largest sample and multiplying it by the step "npoints" times.

from

Add one sample size (typically "0") in order to extend the plot on the left-hand side.

Details

The computation can be long, so the steps of rarefaction and plotting are kept separate.

The input must be a data frame, or a vector or a matrix, which will be coerced into a matrix. The data must be counts (tag counts, molecule counts, ...).

Value

A list-based object of class "hanabi".

See Also

'[.hanabi', as.list.hanabi, and vegan::rarecurve.

Other Hanabi functions: hanabiPlot, plot.hanabi, points.hanabi

Examples

1
2
3
4
5
6
bedFiles <- system.file(package = "smallCAGEqc", "extdata") %>%
              list.files("*BED", full.names = TRUE)
bed <- loadBED12(bedFiles)
rar <- tapply(bed$score, bed$library, hanabi, from = 0) %>%
         structure(class = "hanabi")  # tapply discards the class !
hanabiPlot(rar, GROUP = levels(bed$library))

charles-plessy/smallCAGEqc documentation built on May 13, 2019, 3:31 p.m.