Converting QIIME 2 Output to VALENCIA Format (ASV Taxon and Read Count Table)

Hello again,

The input file required here is not the ASV table, but the CSV that outputs convert_qiime.py (or any other CSV file constructed either manually or with a custom script from your QIIME 2 files so it matches the required format).

It looks like the convert_qiime.py is not as QIIME-friendly as we thought... someone wrote an unanswered issue¹ two years ago facing the same problem.

It looks that the script is expecting a CSV with one column for taxonomic level. Currently, there is no way of achieving this within QIIME 2. The easiest approach, IMO, would be to reformat your taxonomy QZA file in R using qiime2R. Briefly, you would need to do the following (double-check with qiime2R tutorial since I extracted all the info from there):


if (!requireNamespace("devtools", quietly = TRUE)){install.packages("devtools")}
devtools::install_github("jbisanz/qiime2R")

library(qiime2R)

# Import taxonomy
taxonomy <- read_qza("taxonomy.qza")

# Parse taxonomy
taxonomy <- parse_taxonomy(taxonomy$data)

# Remove first column (I think convert_qiime.py is assuming
# your taxonomy and table files have the same ASV 
# order so we wouldn't need ASV ID, if this is not the
# case feel free to try again skipping this step).
taxonomy <- taxonomy[ , -1]

# Export
write.csv(taxonomy, "taxonomy.csv", row.names = FALSE)

Try convert_qiime.py with this new taxonomy CSV, and now it should work!

Best,

Sergio

--

¹ Remember: