How to remove taxonomy in biom files, and save it as qza (python) ?

We want to remove 100 OTU ids from a 10000 OTU table. Could you kindly suggest how to directly manipulate and delete OTUs from a biom file, then save it as qza (python).
Thank you for your help!
Code example:
def read_filter(val, id_, md):
print(id_)
return id_ in toBeFiltered_idx
table2 = table.copy().filter(read_filter, axis='observation')

Hi!
You can import your biom to qiime first:

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

And then remove undesired OTUs using this plugin.

Another option is to convert your biom into tsv file, manipulate it, and convert back to a biom file and then import it to qiime:

convert .biom to .tsv

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

All commands above can be executed in the terminal or in the Jupyter (put "!" before terminal command)

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