tsv to qza and run qiime taxa barplot

Hello qiime fourm,

I modify the taxonomy table.tsv to contain just the species name
as following ... now need to convert it to qza to run qiime taxa barplot

How can I do that?

Hi @Mohamed_S.AboHoussie,

Welcome back!

First I will just say, the code for importing and exporting is on the qiime2 website so definitely check that out if you haven't.

This code should work:

# Convert TSV table back to biom
biom convert \
    -i table.tsv \
    -o table.biom \
    --table-type="OTU table" \
    --to-hdf5

#import into qiime2

    qiime tools import \
      --input-path table.biom \
      --output-path table.qza \
      --type 'FeatureTable[Frequency]'

Then you can run taxonomy again. Just make sure all your rows are unique. You may run into issues there. Is there a reason you wanted to rename the taxonomy? You actually don't have to do this step a lot of the time because qiime taxa bar plot automatically adds taxonomy for you if you give it a taxonomy file.

1 Like

thank you.
But those commands do not work actually.
I renamed the taxonomy based on the species only because qiime provided the full taxonomy, as you know ... also to remove any incomplete taxonomic rank such as this one (d__Bacteria;p__Bacillota_A_368345;c__Clostridia_258483;;;;)

here is a screenshot of the error

try saving it as a tsv file and then using the command. TSV files are usually safer bets with qiime2.

I know you can also collapse a qiime table to the species level and then make a taxa bar plot and download the tsv file from that as well if you want

No, it's the same; neither TSV nor CSV worked.

Also, if I collapsed the taxonomy to level 7, I would still have an incomplete taxon

Can I send the file to you?

Hi @Mohamed_S.AboHoussie,

Is it the same error when you use TSV? could you provide your code for that and the error your recieved?

If its the same error, I would hypothesize that your edits some how minorly viotated expections of the biom format.

send over your file and we can take a look and see if anything stands out.

I mostly wanted to chime :qiime2_square: in to give alittle bit of my unsoliciated advice. Sorry @Sam_Degregori for stealing your post!

You are kinda scrubbing some useful information from your taxonomy by removing info about the "incomplete" taxon.

Incomplete taxon could mean different things! For example, a taxon string that looks like this: k__Bacteria; p__Bacteroidetes; c__Bacteroidia; o__Bacteroidales; f__; g__; s__ means that your classifier had a decent amount of confidence that this ASV matched a feature in the database but that feature in the database was only annotated to the order level.

While this taxon string, which I think you would consider complete: k__Bacteria; p__Proteobacteria; c__Betaproteobacteria means that your classifier only had confidence to label to the class level.

I personally differientate these when I am talking about them and say something like an unknown species in the Bacteroidales order when I am talking about the first one because I think its a cool and semi-important distinction!

thanks a bunch, @cherman2

But I don't consider any taxonomic level except level 7, which contains all taxonomic rank (s__+ name) Anything else, I removed because I need the bar plot to have only the species name

Also, I failed to make a Krona pie chart using a collapsed taxonomy for level 7 after I removed the header and separated the taxonomy into 7 columns.

here is the command that I used
biom convert -i level-7-cleaned.csv -o table.biom --table-type="OTU table" --to-hdf5

please take a look and i'm waiting for your kind response

Hi @Mohamed_S.AboHoussie,

This is pretty confusing to me, this seems like the .csv file again?

Is this 16S data or metagenome data? If this is 16S you are losing a lot of information, because genus and species level annotation are not fully robust with 16S. I am just trying to make you aware of the limitations of species level annotations when using 16S.

Another Mod, chiimed in and suggested that you checkout rescript edit-taxonomy which can do what you are interested in investigating without having to leave and re-enter the QIIME 2 sphere.

No need to do that because I used green genes, not Silva. I know that genus and species level annotation are not fully robust with 16S but still need to visualize only the level 7, you know ... my supervisor wants me to do it

so there is my level 7 extracted from qiime


NOTE FROM @ebolyen
STOP UPLOADING IDENTIFIABLE INFORMATION.
THANK YOU.


Any idea about how you can plot it using only the species name?

thank you in advance

Hi @Mohamed_S.AboHoussie

What I shared is using Silva as an example but the method I linked can edit any taxonomy. Please review the action rescript edit-taxonomy. I believe it is what you are looking for and I believe it works for greengenes taxonomies as well.

1 Like