hanabi: Calcultate richness in preparation for plotting

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Rarefy data at multiple sample sizes using the vegan package and return a ‘hanabi’ object that can be passed to plot functions.

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
hanabi(x, n = 20, step = 0.75, from = NULL, useMulticore = FALSE,
  nrCores = NULL)

## S4 method for signature 'Rle'
hanabi(x, n = 20, step = 0.75, from = NULL,
  useMulticore = FALSE, nrCores = NULL)

## S4 method for signature 'numeric'
hanabi(x, n = 20, step = 0.75, from = NULL,
  useMulticore = FALSE, nrCores = NULL)

## S4 method for signature 'integer'
hanabi(x, n = 20, step = 0.75, from = NULL,
  useMulticore = FALSE, nrCores = NULL)

## S4 method for signature 'GRanges'
hanabi(x, n = 20, step = 0.75, from = NULL,
  useMulticore = FALSE, nrCores = NULL)

## S4 method for signature 'List'
hanabi(x, n = 20, step = 0.75, from = NULL,
  useMulticore = FALSE, nrCores = NULL)

## S4 method for signature 'list'
hanabi(x, n = 20, step = 0.75, from = NULL,
  useMulticore = FALSE, nrCores = NULL)

## S4 method for signature 'matrix'
hanabi(x, n = 20, step = 0.75, from = NULL,
  useMulticore = FALSE, nrCores = NULL)

Arguments

x

An object contained expression counts on which richness scores can be calculated. For example an expression table in DataFrame or data.frame format where columns are samples and rows are featuressuch as genes, TSS, etc, or a vector of counts (tag counts, molecule counts, ...), or GRanges or GRangesList objects, etc.

n

The maximum number of rarefactions per sample.

step

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

from

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

useMulticore

Logical, should multicore be used. useMulticore = TRUE has no effect on non-Unix-like platforms. At the moment, it also has only effects on lists and list-derived classes (data frames but not matrices).

nrCores

Number of cores to use when useMulticore = TRUE (set to NULL to use all detected cores).

Details

This function does not take directly CAGEr objects as input, because hanabi plots can be made from CTSS, clustered or gene-level data, therefore it is not possible to guess which one to use.

Value

A list-based object of class "hanabi".

Author(s)

Charles Plessy

See Also

vegan::rarecurve.

Other CAGEr richness functions: hanabiPlot, plot.hanabi

Examples

1
2
3
4

CAGEr documentation built on Jan. 17, 2021, 2 a.m.