phy_transform: Transform microbiota counts

phy_transformR Documentation

Transform microbiota counts

Description

Same as transform(), but also adding further transformations, like hyperbolic arcsine, inverse-rank normal, binary transformation. Additionally it can calculate geometric mean of a sample, although this is not really the same thing

Usage

phy_transform(physeq, transform, binary_preval_thresh = 0)

Arguments

physeq

a phyloseq object

transform

character all options available in "transform()", extending it with the arcsinh ("asinh"), geometric mean("gm_mean"), Hellinger ("hellinger"), binary, and Rank Inverse Normal transf.("irn")

binary_preval_thresh

numeric, the prevalence below which you want to transform your taxa into binary traits. default is 0, which will not split the otu table

Value

A phyloseq object with sample-wise transformed data. also, it will create a phyloseq with Taxa in rows!

Examples


data(GlobalPatterns)
GP_Genus <- tax_glom(GlobalPatterns, "Genus")
tax <- "295395"
transf <- "clr"
transformed_GP <- transform_microbiota_ga(GP_Genus,transform = transf)


plot(density(abundances(GP_Genus)[tax,]), main = paste("taxon n°", tax), col = "blue")
lines(density(abundances(transformed_GP)[tax,]), col = "red")
legend("topright", legend = c("Untransformed", transf), col = c("blue", "red"), pch = 18)


g-antonello/gautils2 documentation built on Nov. 28, 2022, 9:39 a.m.