Figuring out samples an OTU belongs to

I’m still pretty new to Qiime2.
I have my list of OTUs, is there a quick why I could search my table.qza file and see which samples have a specific OTU.
For example, say I’m looking at something with the OTU identifier ‘SH489138.07FU_JX136119_reps_singleton’. Could I search and see which samples this OTU is found in, and which it is not?

Hi @nricks,
I am not sure that there is an “quick” way to do this right now (on the command line) — the closest thing is feature-table summarize, which lists the number of samples that contain each feature but not the sample IDs themselves. Adding a list of sample IDs to this visualization might be possible, and I have added an issue to track this feature here.

What you are asking for is essentially a convenient way to peek at the contents of a feature table. This would be pretty simple if you are comfortable with working with the artifact API/jupyter notebooks, but there is not really a way to do this on the command line.

You may want to try feature-table heatmap, which could be used to easily explore which samples an OTU is observed in, unless of course if they are observed at very low abundance.

To get an explicit list of samples that a feature is observed in, the quickest work-around I can think of on the command line is to:

  1. filter your table to contain only the feature(s) listed in a metadata file (one feature ID per line)
  2. filter samples to remove samples with < 1 observation in the filtered table
  3. export your feature table to biom
  4. convert your biom table to tsv

and then the resulting tsv file (which can be opened in excel or a text reader) will contain the abundances of each feature of interest in each sample in which those features were detected.

Is that what you are looking for? Let me know if that helps!

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