hello, guys, I am working on alpha-diversities and I need 5 diffietent diversities. I use command line to import OTU table to import a .qza file.
> biom convert -i otu_table.txt -o table.from_txt_json.biom --table-type="OTU table" --to-json
> qiime tools import
> --input-path table.from_txt_json.biom
> --type 'FeatureTable[Frequency]'
> --input-format BIOMV100Format
> --output-path feature-table-1.qza
after that, i run a python script to generate diffierent alpha diversities:
from qiime2.plugins.diversity.methods import alpha
from qiime2 import Artifact
import os
feature_table = Artifact.load('feature-table-1.qza')
to_be_cal = ['goods_coverage', 'shannon', 'simpson', 'pielou_e', 'chao1']
for a in to_be_cal:
al = alpha(table=feature_table, metric=a).alpha_diversity
al.export_data("alpha")
os.rename("./alpha/alpha-diversity.tsv", "./alpha/%s.tsv"%a)
Problem is that I want to merge different diversities to ONE file and not to operate with the generated files,. In other words, I want to show the alpha diversity directly on my terminal not in the file.
QIIME 2 has a built-in feature for invoking data transformations on QIIME 2 results - this can be super handy for cases like this. I modified your example above to demonstrate transforming the alpha div results to QIIME 2 Metadata, which let's you see everything in one table: