Hi everyone, I am running QIIME2 on macOS Catalina and have a question about workflow. I am using a biom table generated using QIIME 1 and would like to perform taxonomic comparisons. I successfully imported the table to create an feature-table artifact (frequency). From what I read in the tutorials, to do this I need a sequence table also, which I don’t have. Is there a workaround for this? Thanks
Hello Rajesh,
Cool! Qiime 1 tables will always contain a feature abundance table, but they can include a taxonomy table inside the same file. You might be good to go!
Cool!
If your Qiime 1 .biom table does have the taxonomy table build into it, we just need to figure out how to get it imported into Qiime 2.
If your Qiime 1 .biom table does not have taxonomy, then we will need to make a taxonomy table ourselves using a qiime 2 feature classifier...
... and the feature classifier needs a sequence table or sequence file (.fna or .fasta).
One easy way to figure out if your .biom table has taxonomy in it is to use the tail
command and look for taxonomy strings. Try that!
tail -c200 otus.biom
Colin
This only works if the file is for the old-style BIOM 1 format, which has been replaced with the 2.1.0 format in recent years.
You can import a taxonomy-annotated biom file as both FeatureTable[Frequency]
& FeatureData[Taxonomy]
:
qiime tools import \
--input-path my-file.biom \
--output-path my-taxonomy.qza \
--source-format BIOMV210Format \
--type "FeatureData[Taxonomy]"
Matthew, thanks for the comment and clarification. I’m unclear when to use FeatureData versus FeatureTable for the type argument. I tried the below command and received the subsequent error. I have a table that is BIOM format 100 and it does contain taxonomy data. I assume FeatureTable is the correct type, but when I try that the imported table/artifact does not contain taxonomy data. Thanks
qiime tools import --input-path RISK_all_samples.biom --type ‘FeatureData[Taxonomy]’ --input-format BIOMV100Format --output-path feature_table_v1.qza
Traceback (most recent call last):
File “/Users/rajeshshah/miniconda3/envs/qiime2.2019-7/lib/python3.6/site-packages/q2cli/builtin/tools.py”, line 154, in import_data
view_type=input_format)
File “/Users/rajeshshah/miniconda3/envs/qiime2.2019-7/lib/python3.6/site-packages/qiime2/sdk/result.py”, line 241, in import_data
validate_level=‘max’)
File “/Users/rajeshshah/miniconda3/envs/qiime2.2019-7/lib/python3.6/site-packages/qiime2/sdk/result.py”, line 266, in _from_view
recorder=recorder)
File “/Users/rajeshshah/miniconda3/envs/qiime2.2019-7/lib/python3.6/site-packages/qiime2/core/transform.py”, line 59, in make_transformation
(self._view_type, other._view_type))
Exception: No transformation from <class ‘q2_types.feature_table._format.BIOMV100Format’> to <class ‘qiime2.plugin.model.directory_format.TSVTaxonomyDirectoryFormat’>
An unexpected error has occurred:
No transformation from <class ‘q2_types.feature_table._format.BIOMV100Format’> to <class ‘qiime2.plugin.model.directory_format.TSVTaxonomyDirectoryFormat’>
See above for debug info.
You will need to convert your biom table to biom 2.10 format first:
biom convert -i RISK_all_samples.biom -o hdf5_table.biom --table-type="OTU table" --to-hdf5
qiime tools import --input-path hdf5_table.biom --type ‘FeatureData[Taxonomy]’ --input-format BIOMV210Format --output-path feature_table_v1.qza
Give that a shot and let us know how it goes!
Matthew,
Thanks again for your response. I ran the below commands, was able to import the biom table with taxonomy data within it, convert it to a relative abundance table and then filter it. Then I tried to convert back to a classic table (txt) to format it for MaasLin. When I do that conversion back and ask for taxonomy data as the last column, it again is blank. I’m not sure I understand why it appears to be in the table, but then gets dropped. When I import using FeatureTable, does this import a biom table containing frequency information and the taxonomy?
The basic process I am trying to perform, is take a biom version 100 table, convert it to a relative frequency table (for MaasLin), reformat the taxonomy data for Maaslin and then run it through the Galaxy web based interface.
Thanks again for your help.
#import new hdf5 biom table to create artifact
qiime tools import --input-path hdf5_table.biom --type ‘FeatureTable[Frequency]’ --input-format BIOMV210Format --output-path hdf5_all.qza
#convert frequency table to relative abundance table
qiime feature-table relative-frequency --i-table hdf5_all.qza --o-relative-frequency-table hdf5_all_rel_ab.qza
#filter tables for controls and patients with CD
qiime feature-table filter-samples --i-table hdf5_all_rel_ab.qza --m-metadata-file RISK_metadata_no_mixed.txt --p-where “[Diagnosis]=‘CD’” --o-filtered-table CD_hdf5_rel_ab.qza
qiime feature-table filter-samples --i-table hdf5_all_rel_ab.qza --m-metadata-file RISK_metadata_no_mixed.txt --p-where “[Diagnosis]=‘non-IBD’” --o-filtered-table Ctrls_hdf5_rel_ab.qza
#convert biom table back to txt format
biom convert -i CD_hdf5_rel_ab/data/feature-table.biom -o CD_hdf5_rel_ab.txt --to-tsv --header-key taxonomy
Before running this step, check out this tutorial:
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.