Hi!
I'm working on a dataset of 200 samples of 16S rRNA gene sequences from insect gut, divided into 6 groups according to the species. I'd like to perform some diversity analysis only with core features. I've got the core features using qiime feature-table core-features for each group. I now need a single feature table containing only the core features per sample, per group (= species), to use as input for further diversity analysis.
Any idea of how to get such a feature table?
Thanks a lot!
SP
Hello Sofia,
Welcome to the forums! 
This is a great question! As you discovered, the output of qiime feature-table core-features
gives you lists of features core to each group, not a filtered table ready for diversity analysis.
Here's how I would try to build that table:
First, take the lists of core features you generated for each of your 6 groups. Combine them into a single, unique list of all feature IDs that are core in at least one group. Let's call this file
all-core-feature-ids.tsv
, and inside is a single-column with the header FeatureID
Second, use this combined list of feature IDs with qiime feature-table filter-features
on your original, unfiltered feature table. Like this:
qiime feature-table filter-features \
--i-table your-original-table.qza \
--m-metadata-file all-core-feature-ids.tsv \
--o-filtered-table core-in-at-least-one-group-table.qza
# --p-no-exclude-ids # This is default, keeps features IN the list
Third, use this resulting core-in-at-least-one-group-table.qza
for your downstream diversity analyses, like qiime diversity core-metrics-phylogenetic
. When you analyze results per group using your metadata file with species information, you'll effectively be looking at the core members relevant to that group, because features non-core to a specific group likely wouldn't be present or abundant in those samples anyway.
3 Likes
Thank you very much for your help!
1 Like