Cannot import name "ProteinIterator"

I am trying to use

qiime tools import --type 'FeatureData[Composition]' --input-path taxonomy.tsv --output-path taxonomy.qza

to convert my .tsv file to a qza file. I have also attached the tsv file.

taxonomy.tsv (703.1 KB)

I am not sure whether I am using the right type (FeatureData[Composition]), but I also got an error:

"An unexpected error has occurred:

cannot import name 'ProteinIterator'"

What does this error mean and how can I fix it? I am trying to eventually convert my tsv file to a biom file and the only way I could figure out how to do it is to go via a qza file.

Hello @hharder,

You don't have to go through qiime for this. See this.

Thanks.

I tried to do this but didn't understand where I should be running this code. It's Python right? I don't know how to do that. I tried to do it in RStudio but it asked me to install Miniconda and I was afraid to mess up my Conda environments to run Qiime.

@hharder,

No, this is a command line tool, which you can run in your terminal--where you ran $qiime tools import (...).

Hi @hharder,

To extend @colinvwood comments, you can run the following within your :qiime2: environment:

convert to biom format

I am not sure why your QIIME 1 otu-table is called taxonomy.tsv. :man_shrugging: So, I'll name the output as table.biom to keep things clear. :slight_smile:

biom convert -i taxonomy.tsv -o table.biom --table-type="OTU table" --to-hdf5

Import table and taxonomy

In :qiime2:, the table and the taxonomy are stored as separate files. We'll first import the table portion like so:

qiime tools import \
    --input-path table.biom \
    --type 'FeatureTable[Frequency]' \
    --input-format BIOMV210Format \
    --output-path table.qza 

and then the taxonomy portion of the data like this:

qiime tools import \
    --input-path table.biom \
    --type 'FeatureData[Taxonomy]' \
    --input-format BIOMV210Format
    --output-path taxonomy.qza

Visualize

Table

qiime feature-table summarize \
    --i-table table.qza \
    --o-visualization table.qzv

Taxonomy:

qiime metadata tabulate \
    --m-input-file taxonomy.qza \
    --o-visualization taxonomy.qzv

Now you should be ready to proceed with any downstream processing in :qiime2:!

-Cheers!

Thank you very much! I didn't do most of the preprocessing, so this was very helpful to understand. I see now the difference between the table and taxonomy files. Thank you!!

1 Like

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