How to convert otu_table.tsv (with # OTU in the 1st column and taxonomy in the last column) to otu_table.qza

Hi experts,

I received the otu_table.tsv from my colleage. I am intending to use this otu_table for qiime. I would like to know how I can convert otu_table.tsv (with # OTU in the 1st column and taxonomy in the last column) to otu_table.qza without losing the last column of taxonomy,
Previously, I used the biom command to convert from tsv to biom format:
biom convert -i path_to_input.tsv -o path_to_output.biom --to-hdf5 --header-key taxonomy

After that I use qiime import to convert biom format to qza format:
qiime tools import \
--input-path feature-table-v210.biom \
--type ‘FeatureTable[Frequency]’ \
--input-format BIOMV210Format \
--output-path feature-table-2.qza

However, the output file lost the content in the taxonomy column.

Please find otu_table.tsv from this link for your reference: taxonomy_closed_reference.tsv - Google Drive

Thank you very much for your kind instructions and advice,
Kind regards,
Le Phuong.

Hello!
That will not be difficult. In qiime2, taxonomy stored not in the biom, but in the separate file. So all you need to do is to create a second tsv table, in which you will only have OTU IDs as a first column and a second column Taxon with taxonomy. I guess you already imported count table so you already have a feature table. Import your second table as taxonomy:

qiime tools import
  --type FeatureData[Taxonomy] \
  --input-path taxonomy.tsv \
  --output-path taxonomy.qza

Hi Timur,

Thank you very much for your kind instructions. I still have another concern. After I did the relative_otu.qza. I intended to convert back relative_otu.qza to relative_otu.biom and then to relative_otu.tsv. The relative_otu.tsv does not contain the taxonomy. I'd like to know to make the relative_otu.tsv with the taxonomy column.
Similarly, I used the rarefy function to make the rarefied_otus.qza. After that I converted about the conversion back from rarefied_otus.qza to rarefied_otus.biom and then to rarefied_otus.tsv. This rarefied_otus.tsv does not contain the taxonomy column.
Is there any function in qiime could help to match the taxonomy.qza and rarefied_otu.qza/relative_otu.qza together for converting to relative_otu_with_taxonomy.tsv/rarefied_otu_with_taxonomy.tsv?

Thank you very much,
Kind regards,
Le Phuong.

In that case I think the best option will be to add taxonomy at the very end of yoour operations, when you have ready tsv tables. I would use R or Python to do the job rather than adding it manually.

Hi Timur,

I understood, which you suggest the command line to do in R,
Thank you very much,

Kind regards,
Le Phuong Nguyen.

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