phyloseq_to_MetaCommunity: Convert phyloseq data to entropart MetaCommunity object.

View source: R/phyloseq_to_MetaCommunity.R

phyloseq_to_MetaCommunityR Documentation

Convert phyloseq data to entropart MetaCommunity object.

Description

The phyloseq data is converted to the MetaCommunity object (entropart package), which can then be used for measurement and partitioning of diversity, including species-neutral, phylogenetic and functional diversity metrics.

Usage

phyloseq_to_MetaCommunity(physeq, wei = NULL)

Arguments

physeq

A phyloseq-class object

wei

A vector of positive numbers equal to community weights (could be NULL for equal weights)

Value

A MetaCommunity class object

See Also

MetaCommunity

Examples

# Load data
data("esophagus")

library(entropart)

# Convert phyloseq to MetaCommunity class
eso <- phyloseq_to_MetaCommunity(esophagus)
summary(eso)

# Estimate diversity (Shannon diversity, q=1)
ad <- AlphaDiversity(eso, q = 1, Correction = "None")
summary(ad)
plot(ad)

# Diversity partitioning into alpha and beta components
dp <- DivPart(q = 1, eso, Correction = "None")
summary(dp)
plot(dp)

# Diversity profile
dpr <- DivProfile(q.seq = seq(0, 2, 0.1), eso, Correction = "None")
summary(dpr)
plot(dpr)


vmikk/metagMisc documentation built on June 20, 2024, 7:20 a.m.