I checked the past issue “Is there any way to summarize taxa plot by category?” and I tried it and used the command recommended Biom add-metadata other times without problem. I need have the biom with taxonomy to use in R studio phyloseq. This time I did exactly the same but despite of i do not have error message the resultant biom was without taxonomy, the command did not add anything.
I cannot understand why this time do not anything in my biom when the columns are the same. Any idea?
My biom comes to export from QIIME2 and in QIIME 2 I did before: deblur, assign taxonomy, filter samples (for a small group), and rarefy. Then I exported the feature table to biom; the taxonomy to tsv; and modified the tsv with the right headers.
Yes, I saw it, and I followed those steps exactly. This is not my first time with this action but this time doesn’t work. Is it possible that the problem would be that I filtered the feature table? I mean, I have in my feature table two sample types and I filter the table just for working with one and the I used rarefied command to normalize my table. Then I tried to export to biom for using in R and was my problem.
In case this would be the problem, how can I solve? Because I cannot find any command to filter the taxonomy just for the OTUIDs that you have in your selected subsample data. Due to this, my taxonomy file has more entrances than my feature table.
Before do “biom add-metadata” order I changes the headers of taxonomy in the same way that it is explained in the mentioned tutorial in the forum.
When I did “biom add-metadata” I could not see any error, so I will convert my biom to json biom for using in R studio (what was my objective), and was in R when I saw the error “the biom is not compatible”. When I converted that biom to tsv in order to check the format I noticed that really I did not have the taxonomy in the biom, I just had the usual columns #OTUID, and each of my samples with the abundances of the OTUs, but not the taxonomy in anywhere.
I did these steps other times using files from QIIME2, but with any filter and I did not have problems. It I because I do not know if this time the problem is that I filtered my feature table but not the taxonomy.
This sounds like an error with the R biom package - we won’t be able to provide support for that here (sorry!). The only other thing that comes to mind to check before asking for help is to make sure that the filtered and rarefied feature table still has samples and features — it is possible you are filtering/rarefying it into an empty state? You can run feature-table summarize on the table before exporting to get the details on it. Let us know what you learn!
I have also problems with adding metadata into a biom file, so this thread could be the right one
I have a ready-made .biom file, in which I’d like to add some extra metadata. However, runnign the command:$ biom add-metadata -i original.biom -o original-with-additions.biom --sample-metadata-fp additions.txt results in error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 4668: invalid continuation byte
Any ideas how to go around this?
My goal is to have a biom-file, which could be then stripped out into compatible input-files to taxa barplot command.
It’s most likely that your file doesn’t actually contain utf-8 encoded data, but some other encoding. You could try saving your file in a text editor (e.g. TextWrangler) with UTF-8 encoding to see if that resolves your issue.
However, I should note that in Qiime2, the metadata is kept separate from the feature table for most applications including taxa barplot, so there’s no need to add the metadata to the biom table. See the example below.