rarefy_rrna: Rarefy and normalize based on 16S rRNA copy numbers

View source: R/rarefy_rrna.R

rarefy_rrnaR Documentation

Rarefy and normalize based on 16S rRNA copy numbers

Description

Rarefy an OTU-table with the probability of the inverse 16S rRNA copy numbers: The result is a normalized AND copy number corrected OTU-table.

Usage

rarefy_rrna(
  x,
  reads,
  copy.database = "v13.5",
  seed = NULL,
  trim = FALSE,
  replace = FALSE
)

rarefy_rrna.matrix(x, reads, copy.database, seed = NULL, trim, replace)

rarefy_rrna.phyloseq(x, reads, copy.database, seed = NULL, trim, replace)

Arguments

x

A phyloseq object OR an OTU-table with taxa as columns and OTU names as colnames. OTUs should be picked against the Greengenes v13.5 database, unless another copy number database is provided.

reads

Number of reads to sample.

copy.database

What Greengenes database version was used to find OTUs. Atm only "v13.5" is available. Alternatively, A dataframe with two variables: "ID" is the OTU id matched by names in x and "Copy" is the copy number.

seed

Random seed for sampling.

trim

Should samples with less than the set amount of reads be trimmed away?

replace

Should reads be sampled with replacement? Default FALSE. If FALSE, rRNA copy numbers will have small effect if the rarefied depth is close to the actual depth. If TRUE, some taxa can end up with more reads in the rarefied matrix that they had in the input.

Value

A rarefied otu-table


Russel88/MicEco documentation built on Nov. 24, 2022, 2:33 a.m.