Skip to contents

Generate a relative abundance table in tibble format from a phyloseq object.

Usage

rel_abund_phy(
  phy,
  taxa_data = TRUE,
  meta_data = FALSE,
  taxa_level = "Phylum",
  var = NULL
)

Arguments

phy

A phyloseq object containing an otu_table and tax_table.

taxa_data

Logical. Whether to include taxonomic information.

meta_data

A logical value specifying if metadata should be included from phy.

taxa_level

A character value specifying the taxa level from Domain to species.

var

A character value of a variable to sum by.

Value

A tibble.

Examples

rel_abund_phy(phy = physeq, taxa_level = "Phylum", var = NULL , meta_data = FALSE)
#> # A tibble: 1,000 × 5
#>    sample_id asv   level  taxon           rel_abund
#>    <chr>     <chr> <chr>  <chr>               <dbl>
#>  1 Smp1      ASV1  Phylum Pseudomonadota 0.00000212
#>  2 Smp1      ASV2  Phylum Spirochaetota  0.00000635
#>  3 Smp1      ASV3  Phylum Pseudomonadota 0.00168   
#>  4 Smp1      ASV4  Phylum Pseudomonadota 0.0000191 
#>  5 Smp1      ASV5  Phylum Actinomycetota 0.0000212 
#>  6 Smp1      ASV6  Phylum Actinomycetota 0.00268   
#>  7 Smp1      ASV7  Phylum Pseudomonadota 0.0000614 
#>  8 Smp1      ASV8  Phylum Bacillota      0         
#>  9 Smp1      ASV9  Phylum Pseudomonadota 0         
#> 10 Smp1      ASV10 Phylum Bacteroidota   0.00000212
#> # ℹ 990 more rows