Hi!
I rarefied my feature table after assigning taxonomy to features, thus, now I have the two separate files (rarefied feature table and taxonomy for all the original features). I am having trouble merging these two using feature ID as the factor for the merge. Thishttps://forum.qiime2.org/t/exporting-and-modifying-biom-tables-e-g-adding-taxonomy-annotations/3630 forum discussion recommends the following code for adding taxonomy to your biom file but for some reason it is not working. I did change the column headers but still taxonomy is not being added to my biom file.
biom add-metadata -i exported/feature-table.biom -o table-with-taxonomy.biom --observation-metadata-fp biom-taxonomy.tsv --sc-separated taxonomy
I am using the following code
qiime tools export --input-path rarefied-3065-table.qza --output-path exported
qiime tools export --input-path taxonomy-merged-paired-end.qza --output-path exported
cp exported/taxonomy.tsv biom-taxonomy.tsv
biom add-metadata -i exported/feature-table.biom -o table-with-taxonomy.biom --observation-metadata-fp biom-taxonomy.tsv --sc-separated taxonomy
This is how my taxonomy table looks like and the output I get from the last code:
I know I can do it using
qiime taxa collapse \
but I am interested in keeping ASVs separately.
llenzi
(Luca)
August 5, 2020, 7:01pm
3
Hi @JeanRodrig ,
The following thread may be very useful to debug your problem, there are lots of suggestions you can try:
Thanks, when you check your biom file by converting to text don’t forget the –header-key taxonomy command as someone specified above or otherwise when you unwrap the biom file it won’t include the taxonomy in the last column.
At first glance I would ask you which command you used to convert the 'table-with-taxonomy.biom' to txt file, did you add the '-header-key taxonomy' to that? Without it your taxonomy data would not be exported in the file you are trying to import in OpenOffice!
Cheers
1 Like
Thank you, @llenzi ! The tab separation should indeed be the problem. I used this code
biom add-metadata -i exported/feature-table.biom -o table-with-taxonomy.biom --observation-metadata-fp biom-taxonomy.tsv --sc-separated taxonomy
I guess what I am not 100% is how to make sure I keep a tab separation. When I open my biom-taxonomy.tsv, it opens in LibreOffice. I just highlight and change the headers.
I did not add the
–header-key taxonomy
Where exactly should I add it within the
biom add-metadata -i exported/feature-table.biom -o table-with-taxonomy.biom --observation-metadata-fp biom-taxonomy.tsv --sc-separated taxonomy
llenzi
(Luca)
August 5, 2020, 7:39pm
6
Hi @JeanRodrig ,
You are trying to open the file ‘OTU-table.tsv’ in OpenOffice, so you should have use a command looking something like:
biom convert -i table-with-taxonomy.biom -o OTU-table.tsv --to-tsv --header-key taxonomy
What I meant was if you added the ‘–header-key’ option in this last one!
Hope make sense!
Hi @llenzi
So, to confirm, I have to add two things.
based on the thread you sent me, I have to add
--observation-header taxonomy
into this part of the code
biom add-metadata -i exported/feature-table.biom -o table-with-taxonomy.biom --observation-metadata-fp biom-taxonomy.tsv --sc-separated taxonomy
and also,
–header-key taxonomy
into, as your last reply
biom convert -i table-with-taxonomy.biom -o OTU-table.tsv --to-tsv
Does this make sense?
llenzi
(Luca)
August 5, 2020, 8:12pm
8
Hi @JeanRodrig ,
nope sorry! (Apology if I am not very clear, is evening here and I had a long day )
I think the command you used worked as expected, but the taxonomy column is not exported into the file you are loading in OpenOffice.
To test this, you need to change only the final ‘biom convert’ command, by adding the ‘–header-key taxonomy’ option.
Cheers
Thanks @llenzi !
It worked by just having it in the last code
gaolei
(gaolei)
August 15, 2020, 3:08pm
10
hello, can you share the code with me? I got the same problem. thanks!!!
qiime tools export --input-path rarefied-3065-table.qza --output-path exported
qiime tools export --input-path taxonomy-merged-paired-end.qza --output-path exported
cp exported/taxonomy.tsv biom-taxonomy.tsv
biom add-metadata -i exported/feature-table.biom -o table- with -taxonomy.biom –observation-metadata-fp biom-taxonomy.tsv --sc-separated taxonomy
biom convert -i table-with-taxonomy.biom -o OTU-table.tsv --to-tsv --header-key taxonomy
system
(system)
Closed
September 29, 2020, 3:16am
12
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.