After Filtering out FeatureData[Sequence] from DADA2 based on length, how to match FeatureTable[Frequency] with FeatureData[Sequence]

I filtered out asv’s below a certain length using the elegant solution posted here by @thermokarst,Trying to filter asv's based on length.
rep-seqs.qza is FeatureData[Sequence], how to filter the FeatureTable[Frequency]?
Namely how to match the (Feature table)`FeatureTable[Frequency] with (300-seqs.qza ) then FeatureData[Sequence]

qiime feature-table filter-seqs
--i-data rep-seqs.qza
--m-metadata-file rep-seqs.qza
--p-where 'length(sequence) > 300’
--o-filtered-data 300-seqs.qza

Have you looked at filter-features, @RitaHou2018 ?

There are a couple ways to do this. The filtering tutorial discusses approaches like the one you used with filter-seqs, but you might be able to filter more simply by taking advantage of your already-filtered FeatureData[Sequences] and the property described in the last sentence here:

  --p-where TEXT       SQLite WHERE clause specifying feature metadata
                       criteria that must be met to be included in the
                       filtered feature table. If not provided, all features
                       in `metadata` that are also in the feature table will
                       be retained.

Good luck!
CK

In case my response wasn't clear enough, @RitaHou2018, what I'm suggesting looks like this:

  • Filter FeatureData[Sequence] based on length (using --p-where param) (you did this already!)
  • Filter FeatureTable[Frequency] using the filtered file from step one. No --p-where param required - simply provide the filtered FeatureData[Sequence] as input and an ID-based filter is applied by default.

Brilliant!
Thank you so much @ChrisKeefe .
It works!

qiime feature-table filter-features
--i-table table-dada0.qza
--m-metadata-file 300-seqs.qza
--o-filtered-table table-dada0-filter300.qza

1 Like