# workflow when importing biom table without sequences

**URL:** https://forum.qiime2.org/t/workflow-when-importing-biom-table-without-sequences/12127
**Category:** User Support
**Created:** [October 22, 2019, 11:21pm UTC](https://forum.qiime2.org/t/workflow-when-importing-biom-table-without-sequences/12127 "2019-10-22T23:21:27Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![rajesh512](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/r/7feea3/32.png) [@rajesh512](https://forum.qiime2.org/u/rajesh512)
#### Post date: [October 22, 2019, 11:21pm UTC](https://forum.qiime2.org/t/workflow-when-importing-biom-table-without-sequences/12127/1 "2019-10-22T23:21:27Z")

</div>

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

---

<div class="post-metadata">

### Author: ![colinbrislawn](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinbrislawn/32/6221_2.png) [@colinbrislawn](https://forum.qiime2.org/u/colinbrislawn)
#### Post date: [October 23, 2019, 2:11pm UTC](https://forum.qiime2.org/t/workflow-when-importing-biom-table-without-sequences/12127/2 "2019-10-23T14:11:55Z")

</div>

Hello Rajesh,

> [@rajesh512](#):
>
> I am using a biom table generated using QIIME 1 and would like to perform taxonomic comparisons.

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!

> [@rajesh512](#):
>
> I successfully imported the table to create an feature-table artifact (frequency).

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

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [October 23, 2019, 2:38pm UTC](https://forum.qiime2.org/t/workflow-when-importing-biom-table-without-sequences/12127/3 "2019-10-23T14:38:57Z")

</div>

> [@colinbrislawn](#):
>
> 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`

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]`:

```bash
qiime tools import \
  --input-path my-file.biom \
  --output-path my-taxonomy.qza \
  --source-format BIOMV210Format \
  --type "FeatureData[Taxonomy]"

```

---

<div class="post-metadata">

### Author: ![rajesh512](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/r/7feea3/32.png) [@rajesh512](https://forum.qiime2.org/u/rajesh512)
#### Post date: [November 8, 2019, 8:26pm UTC](https://forum.qiime2.org/t/workflow-when-importing-biom-table-without-sequences/12127/4 "2019-11-08T20:26:34Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [November 13, 2019, 2:53pm UTC](https://forum.qiime2.org/t/workflow-when-importing-biom-table-without-sequences/12127/5 "2019-11-13T14:53:59Z")

</div>



---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [November 13, 2019, 3:07pm UTC](https://forum.qiime2.org/t/workflow-when-importing-biom-table-without-sequences/12127/6 "2019-11-13T15:07:14Z")

</div>

You will need to [convert](http://biom-format.org/documentation/biom_conversion.html) your biom table to biom 2.10 format first:

```bash
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! :qiime2: 🦖

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [November 13, 2019, 3:07pm UTC](https://forum.qiime2.org/t/workflow-when-importing-biom-table-without-sequences/12127/7 "2019-11-13T15:07:15Z")

</div>



---

<div class="post-metadata">

### Author: ![rajesh512](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/r/7feea3/32.png) [@rajesh512](https://forum.qiime2.org/u/rajesh512)
#### Post date: [November 13, 2019, 8:41pm UTC](https://forum.qiime2.org/t/workflow-when-importing-biom-table-without-sequences/12127/8 "2019-11-13T20:41:06Z")

</div>

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

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [November 18, 2019, 2:27pm UTC](https://forum.qiime2.org/t/workflow-when-importing-biom-table-without-sequences/12127/9 "2019-11-18T14:27:36Z")

</div>



---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [November 18, 2019, 11:49pm UTC](https://forum.qiime2.org/t/workflow-when-importing-biom-table-without-sequences/12127/10 "2019-11-18T23:49:22Z")

</div>

> [@rajesh512](#):
>
> #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:

> [@Exporting and modifying BIOM tables (e.g. adding taxonomy annotations)](https://forum.qiime2.org/t/exporting-and-modifying-biom-tables-e-g-adding-taxonomy-annotations/3630/):
>
> Creating a TSV BIOM table The following is based on [a post](https://forum.qiime2.org/t/how-to-add-taxonomy-to-feature-table-qza-and-get-otu-id-of-each-taxonomy-and-number-of-otus/3470/22) by @gregcaporaso. $ qiime tools export table.qza --output-dir ./ $ biom convert -i feature-table.biom -o feature-table.tsv --to-tsv $ biom head -i feature-table.tsv # Constructed from biom file #OTU ID L1S105 L1S140 L1S208 L1S257 L1S281 4b5eeb300368260019c1fbc7a3c718fc 2222.0 0.0 0.0 0.0 0.0 fe30ff0f71a38a39cf1717ec2be3a2fc 5.0 0.0 0.0 0.0 0.0 d29fe3c70564fc0f69f2c03e0d1e5561 0.0 0.0 0.0 0.0 0.0 868528ca947bc57b69ffdf83e6b73bae 0.0 2276…

🤞 :qiime2:

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [November 18, 2019, 11:49pm UTC](https://forum.qiime2.org/t/workflow-when-importing-biom-table-without-sequences/12127/11 "2019-11-18T23:49:23Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [December 20, 2019, 5:49am UTC](https://forum.qiime2.org/t/workflow-when-importing-biom-table-without-sequences/12127/12 "2019-12-20T05:49:24Z")

</div>

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
