# Problem with filter-seqs: Filter features from sequences

**URL:** <https://forum.qiime2.org/t/problem-with-filter-seqs-filter-features-from-sequences/28463>\
**Category:** User Support\
**Tags:** filter-features\
**Created:** [November 30, 2023, 11:06am UTC](https://forum.qiime2.org/t/problem-with-filter-seqs-filter-features-from-sequences/28463 "2023-11-30T11:06:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Linda\_Abenaim](https://forum.qiime2.org/user_avatar/forum.qiime2.org/linda_abenaim/32/17111_2.png) [@Linda\_Abenaim](https://forum.qiime2.org/u/Linda_Abenaim)\
**Post date:** [November 30, 2023, 11:06am UTC](https://forum.qiime2.org/t/problem-with-filter-seqs-filter-features-from-sequences/28463/1 "2023-11-30T11:06:26Z")

</div>

Hi 😀

I receive this error from filter feature from sequences:  
Plugin error from feature-table:  
All features were filtered out of the data.  
Debug info has been saved to /tmpscratch/labenaim/6227276/qiime2-q2cli-err-y8sytyku.log

I want to filter rep-seqs-dada2 with metadata to obtain rep-seqs only for some samples.  
Maybe I'm making some mistakes!

qiime feature-table filter-seqs   
--i-data rep-seqs-dada2-new.qza   
--m-metadata-file sample-metadata.txt   
--"[subject]='subject-1'"   
--p-where p-no-exclude-ids   
--o-filtered-data rep-seqs-bsf-new.qza

thank you in advance

---

<div class="post-metadata">

**Author:** ![colinbrislawn](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinbrislawn/32/6221_2.png) [@colinbrislawn](https://forum.qiime2.org/u/colinbrislawn)\
**Post date:** [November 30, 2023, 4:21pm UTC](https://forum.qiime2.org/t/problem-with-filter-seqs-filter-features-from-sequences/28463/2 "2023-11-30T16:21:57Z")

</div>

Hello Linda 👋

> [@Linda\_Abenaim](#):
>
> I want to filter rep-seqs-dada2 with metadata to obtain rep-seqs only for some samples.  
> Maybe I'm making some mistakes!

The rep-seqs file includes the sequences for all features.  
The command `qiime feature-table filter-seqs` will remove sequences, but it sounds like you want to remove samples.

(I'm glad you tested it out to see what would happen!)

Here are all the ways to filter a table:  
[https://docs.qiime2.org/2023.9/plugins/available/feature-table/](https://docs.qiime2.org/2023.9/plugins/available/feature-table/)

I would first select only the samples you want using `qiime feature-table filter-samples` and use the `--p-filter-empty-features` setting. There are more examples on this page:  
[https://docs.qiime2.org/2023.9/plugins/available/feature-table/filter-samples/](https://docs.qiime2.org/2023.9/plugins/available/feature-table/filter-samples/)

---

<div class="post-metadata">

**Author:** ![Linda\_Abenaim](https://forum.qiime2.org/user_avatar/forum.qiime2.org/linda_abenaim/32/17111_2.png) [@Linda\_Abenaim](https://forum.qiime2.org/u/Linda_Abenaim)\
**Post date:** [November 30, 2023, 4:36pm UTC](https://forum.qiime2.org/t/problem-with-filter-seqs-filter-features-from-sequences/28463/3 "2023-11-30T16:36:59Z")

</div>

Hi @colinbrislawn,

thank you so much for you answer!

I made this command:

qiime feature-table filter-samples   
--i-table table-dada2.qza   
--m-metadata-file sample-metadata.txt   
--p-where "[subject]='subject-1'"   
--o-filtered-table subject-1-filtered-table.qza

and then

qiime feature-table filter-seqs   
--i-data tua-rep-seqs-dada2.qza   
--i-table subject-1-filtered-table.qza   
--o-filtered-data rep-seqs-filtered.qza

I think that is good, right?

I upload all my sequence but after denoising I wanted to separate only one subject (the subject are 3) to firstly analyse.  
Befor the qiime phylogeny align-to-tree-mafft-fasttree i wanted to filtrate to be sure to start my analysis only on these samples.

---

<div class="post-metadata">

**Author:** ![colinbrislawn](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinbrislawn/32/6221_2.png) [@colinbrislawn](https://forum.qiime2.org/u/colinbrislawn)\
**Post date:** [November 30, 2023, 5:06pm UTC](https://forum.qiime2.org/t/problem-with-filter-seqs-filter-features-from-sequences/28463/4 "2023-11-30T17:06:39Z")

</div>

> [@Linda\_Abenaim](#):
>
> I think that is good, right?

Try it and let me know!

I usually have to adjust my filtering settings a few times to make sure I'm selecting exactly what I want. Guess-and-check is my favorite strategy.

> [@Linda\_Abenaim](#):
>
> I upload all my sequence but after denoising I wanted to separate only one subject (the subject are 3) to firstly analyse.  
> Befor the qiime phylogeny align-to-tree-mafft-fasttree i wanted to filtrate to be sure to start my analysis only on these samples.

That makes sense to me because mafft I think will make different results depending on the sequences you add.  
Other methods may be consistent with any data and for those, filtering is not needed.

---

<div class="post-metadata">

**Author:** ![Linda\_Abenaim](https://forum.qiime2.org/user_avatar/forum.qiime2.org/linda_abenaim/32/17111_2.png) [@Linda\_Abenaim](https://forum.qiime2.org/u/Linda_Abenaim)\
**Post date:** [November 30, 2023, 5:23pm UTC](https://forum.qiime2.org/t/problem-with-filter-seqs-filter-features-from-sequences/28463/5 "2023-11-30T17:23:51Z")

</div>

yessss, it works!

thanks

---

<div class="post-metadata">

**Author:** ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)\
**Post date:** [December 31, 2023, 11:24pm UTC](https://forum.qiime2.org/t/problem-with-filter-seqs-filter-features-from-sequences/28463/6 "2023-12-31T23:24:08Z")

</div>

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