Skip to contents

Generate a relative abundance table in tibble form, from QIIME2 artifacts.

Usage

rel_abund_qiime(
  asv_qiime,
  taxa_qiime = NULL,
  metadata_qiime = NULL,
  taxa_level = "Phylum",
  var = NULL
)

Arguments

asv_qiime

A count table in .qza format.

taxa_qiime

A taxonomy table in .qza format.

metadata_qiime

A metadata table in .tsv format. With second row as commented variable descriptions.

taxa_level

The level to set the taxa, from Domain:Species.

var

A variable to group by when computing relative abundance.

Value

A tibble.

Examples

asv_q <- system.file("extdata/qiime", "table-dada2.qza", package = "bubbler")
taxa_q <- system.file("extdata/qiime", "taxonomy.qza", package = "bubbler")
meta_q <- system.file("extdata/qiime", "sample-metadata.tsv", package = "bubbler")
rel_abund_qiime(asv_q, taxa_q, meta_q)
#> # A tibble: 26,180 × 13
#>    sample_id asv    level taxon rel_abund barcode_sequence body_site  year month
#>    <chr>     <chr>  <chr> <chr>     <dbl> <fct>            <fct>     <dbl> <dbl>
#>  1 L1S105    33e2c… Phyl… Firm…   0       AGTGCGATGCGT     gut        2009     3
#>  2 L1S105    5656d… Phyl… Firm…   0       AGTGCGATGCGT     gut        2009     3
#>  3 L1S105    7d893… Phyl… Firm…   0       AGTGCGATGCGT     gut        2009     3
#>  4 L1S105    ecf9e… Phyl… Prot…   0       AGTGCGATGCGT     gut        2009     3
#>  5 L1S105    acfe4… Phyl… Firm…   0       AGTGCGATGCGT     gut        2009     3
#>  6 L1S105    80b20… Phyl… Firm…   0       AGTGCGATGCGT     gut        2009     3
#>  7 L1S105    a1b97… Phyl… Firm…   0       AGTGCGATGCGT     gut        2009     3
#>  8 L1S105    d781f… Phyl… Firm…   0       AGTGCGATGCGT     gut        2009     3
#>  9 L1S105    bfbed… Phyl… Firm…   0.00193 AGTGCGATGCGT     gut        2009     3
#> 10 L1S105    90d32… Phyl… Firm…   0.00399 AGTGCGATGCGT     gut        2009     3
#> # ℹ 26,170 more rows
#> # ℹ 4 more variables: day <dbl>, subject <fct>,
#> #   reported_antibiotic_usage <fct>, days_since_experiment_start <dbl>