Generic utilities

meltAbundance(x, ...)

transposeAbundance(x, transform = "identity")

Arguments

x

phyloseq object

...

Arguments other than 'cols' to pass to tidyr pivot_longer function

transform

If transformation is required `transposeAbundance`

Value

long data format.

Details

Generic utilities that are simple wrappers for doing common tasks.

meltAbundance convert abundance data to long format.

transposeAbundance transpose OTU for use with vegan pkg.

References

Shetty SA (2020). Utilities for microbiome analytics. https://github.com/RIVM-IIV-Microbiome/biomeUtils

Author

Sudarshan A. Shetty

Examples


library(biomeUtils)
data("FuentesIliGutData")
melt.abund <- meltAbundance(FuentesIliGutData,
                            names_to = "SampleID",
                            values_to="Abundance")
melt.abund
#> # A tibble: 533,045 × 3
#>    FeatureID SampleID  Abundance
#>    <chr>     <chr>         <int>
#>  1 ASV302    sample_1          8
#>  2 ASV302    sample_2          0
#>  3 ASV302    sample_3         36
#>  4 ASV302    sample_4         43
#>  5 ASV302    sample_5         15
#>  6 ASV302    sample_6         64
#>  7 ASV302    sample_7          0
#>  8 ASV302    sample_8         10
#>  9 ASV302    sample_9          7
#> 10 ASV302    sample_10         1
#> # … with 533,035 more rows

t.otu <- transposeAbundance(FuentesIliGutData)
dim(t.otu)
#> [1] 589 905