ctrl_samples_stats: Generate taxa/OTU statistics to compare control samples with...

Description Usage Arguments Details Value Examples

View source: R/simple_stats.R

Description

Generate taxa/OTU statistics to compare control samples with the remaining dataset

Usage

1
ctrl_samples_stats(physeq, physeq_ctrl)

Arguments

physeq

otu_table-class, or phyloseq-class

physeq_ctrl

otu_table-class, or phyloseq-class of control sample. It can be the output of subset_samples_no_zero for example.

Details

The taxa/OTU prevalence is defined as the number of samples in which it occurs. The prevalence is corrected by substracting the number of samples in the physeq_ctrl object (usually 1).

Value

A data.frame with the following components

RA_In_Ctrl

Taxa/OTU relative abundance in Control sample

RA_In_All

Same Taxa/OTU relative abundance in all samples but Control samples

Ratio

Ratio of RA_In_Ctrl/RA_In_All

Prevalence

Taxa/OTU Prevalence in all samples but Control samples. Range from 0 to the number of samples in physeq object (obtained by ntaxa)

Examples

1
2
3
4
5
6
7
require(phyloseq)
data(soilrep)
# Subset a sample
soilrep.6CC<-subset_samples_no_zero(soilrep, Sample=="6CC")
# Check
ctrl_df<-ctrl_samples_stats(soilrep,soilrep.6CC)
head(ctrl_df)

cpauvert/psadd documentation built on Nov. 22, 2020, 9:19 a.m.