Biom add metadata problem

(Manil) #1

Hi qiime community,

I know this problem was reported before here.

I have the same issu (can not find my taxonomy annotation) I did as explained before the following steps:

qiime tools export: ouptput (table.qza and taxonomy.qza) output (feature-table.biom, taxonomy.tsv)
biom add-metadata -i feature-table.biom -o table_with_taxonomy.biom --observation-metadata-fp taxonomy.tsv --sc-separated taxonomy

when I convert my table_with_taxa.biom to a tsv (just to check) I can not find the taxonomy annotation it keeps the ASVs ID (feature ID) see attached.

This problem was reported several times I don’t know what is really the problem;

Thanks,

Manil

0 Likes

(Manil) #2

It works guys the problem was the tab in the headers, when I modified feature ID to #OTUID and toxon to taxonomy my text editor changed the tab to a space although I was sur that I tab separate my headers.

Thank you

Manil

2 Likes

#3

I would appreciate if you share with other users how you resolved the issue, because it seems a common problem with many of the qiime2 users.

1 Like

(Matthew Ryan Dillon) #4

Hi @bsen2018 — I think @BiOMan indicated their solution in this post — their header line had spaces when there should’ve been tabs.

1 Like

#5

Hi @thermokarst, actually my group students are never successful in adding taxonomy data into a feature-table.biom. For example, this taxonomy.tsv (124.6 KB)
never gets added into the biom table by using the command biom add-metadata -i exported-table/feature-table.biom -o table-taxonomy.biom --observation-metadata-fp exported/taxonomy.tsv --sc-separated taxonomy.

0 Likes

(Manil) #6

hi @bsen2018

I did it. If you did not understand I can explain it again.

Manil

1 Like

#7

Hi @BiOMan, pls. explain us your solution!

0 Likes

(Manil) #8

okey, you followed the tutoriel here I guess!!

At some point your are asked to change the headers of your Biom-taxonomy.tsv from “Feature ID Taxon” to “#OUTID taxonomy” okeyy with keeping the separation between OUTID and taxonomy as a tab (not space or two spaces etcc). For me that was the problem when I modified the headers the text editor that I used did not save for me the tab separation.

Hope I was clear.

Manil

0 Likes

(Manil) #9

I forgot somthing to check a file you can run this command and it will tell you if the separation is a tab (\t) or something else so:

head taxonomy.tsv | od -c and the output should look like this (I kept only what is needed which is the headers):

0000000 # O T U I D \t t a x o n o m y \t
0000020 C o n f i d e n c e \n b 0 1 f 0
0000040 e 8 8 7 5 7 8 d 6 0 4 8 4 a c d

voilà.

0 Likes

#10

Hi @BiOMan, unfortunately tab separation never work for us. Not sure if there is some other issue that we are not able to figure out. Thanks for the piece of code to check a file for tab separated header.

0 Likes

(Manil) #11

Hi @bsen2018

If you dont mind can you share with us the files. i can check! and i agree maybe it is another issue .

Manil

0 Likes

#12

Hello @BiOMan,
Here are thetaxonomy.tsv (124.6 KB)
and the table-paired-end-dada2.qza (41.2 KB) files. Thanks for your time. Hope you will come up with some solution.

0 Likes

(Matthew Ryan Dillon) #13

@bsen2018 - can you please report the exact commands you ran, as well as the exact error you received? I just successfully annotated your biom table with your taxonomy following the steps @BiOMan linked to above — there were no issues.

1 Like

#14

Hi @thermokarst, here are the commands we used:
qiime tools export \--input-path table-paired-end-dada2.qza \--output-path exported-table
qiime tools export \--input-path taxonomy-paired-end.qza \--output-path exported
biom add-metadata -i exported-table/feature-table.biom -o table-taxonomy.biom --observation-metadata-fp exported/taxonomy.tsv --observation-header taxonomy --sc-separated taxonomy
biom convert -i table-taxonomy.biom -o table-taxonomy.tsv --to-tsv
biom head -i table-taxonomy.tsv

Error message: none (but taxonomy never gets added)

qiime2 version: 2018.11 and 2019.1
Machine/interface: Ubuntu/cli, WSL/cli, WSL/API (jupyter notebook).

0 Likes

(Manil) #15

It works for me too !!

1 Like

(Manil) #16

@bsen2018 are you sure about : exported/taxonomy.tsv --observation-header taxonomy --sc-separated taxonomy !!!

It is "biom add-metadata -i FILE.biom -o FILE.biom --observation-metadata-fp FILE.tsv --sc-separated taxonomy

also biom covert -i -o –to-tsv --header-key taxonomy

Can be this the problem ?? @thermokarst

1 Like

#17

@BiOMan, could you pl. share your commands? Let me check if those commands work for us.

0 Likes

(Manil) #18

I just followed this tutorial here.

0 Likes

#19

Hi, I have the same problem and I can’t add the taxonomy annotations to my biom table. I’ve also checked with tab spacing and everything seemed to be correct. Is it possible that someone help me out to figure out what the problem is? Thank you!

Here is are my commands:

qiime tools export deblur/table-deblur.qza \ --output-dir export
qiime tools export training-feature-classifiers/gg/taxonomy-paired.qza \ --output-dir export
cp export/taxonomy.tsv biom-taxonomy.tsv
head biom-taxonomy.tsv

This is how feature-table.biom looked like:

#Constructed from biom file
#OTU ID HC10-4 CH2-4 CH6-4 C2-5 HH10-1
f89343226e4d4a8166bb99f335d45d77 1672.0 85.0 697.0 987.0 511.0
6b96f56460b1b14bbb85035f0e0c3765 1482.0 7.0 3.0 0.0 0.0

And how biom-taxonomy.tsv looked like:

Feature ID Taxon Confidence
08b37fba93c15e5afc094ecbec3618c9 k__Bacteria 0.9997068523760535
d3a0509a959aca6a01f75ea020ca770d k__Bacteria; p__Proteobacteria; c__Deltaproteobacteria; o__; f__; g__; s__ 0.9271634287508872

Then I changed the first line of the biom-taxonomy.tsv to #OTUID taxonomy confidence, and it looked it:

#OTUID taxonomy confidence
08b37fba93c15e5afc094ecbec3618c9 k__Bacteria 0.9997068523760535
d3a0509a959aca6a01f75ea020ca770d k__Bacteria; p__Proteobacteria; c__Deltaproteobacteria; o__; f__; g__; s__ 0.9271634287508872

When I ran this command, head biom-taxonomy.tsv | od -c, to check for tabs, it looked like:

0000000 # O T U I D \t t a x o n o m y \t
0000020 c o n f i d e n c e \n 0 8 b 3 7
0000040 f b a 9 3 c 1 5 e 5 a f c 0 9 4

Then I added the taxonomy data to my biom file:

biom add-metadata -i export/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 table-with-taxonomy.tsv --to-tsv
biom head -i table-with-taxonomy.tsv

And table-with-taxonomy.tsv looked something like this (exactly like the feature-table.tsv with no taxonomy)

#Constructed from biom file
#OTU ID HC10-4 CH2-4 CH6-4 C2-5 HH10-1 CC6-2 CC10-1 CC2-4 HC6-3 C10-2 H6-3 f89343226e4d4a8166bb99f335d45d77 1672.0 85.0 697.0 987.0 511.0 2279.0 882.0 1251.0 531.0 1212.0 502.0

I really can’t figure what went wrong. It’l be great if someone could help. Thank you so much!

2 Likes

(Matthew Ryan Dillon) assigned thermokarst #20
0 Likes