# Trying to filter asv's based on length

**URL:** https://forum.qiime2.org/t/trying-to-filter-asvs-based-on-length/10690
**Category:** User Support
**Created:** [July 15, 2019, 7:13pm UTC](https://forum.qiime2.org/t/trying-to-filter-asvs-based-on-length/10690 "2019-07-15T19:13:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![shira](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/s/aeb1de/32.png) [@shira](https://forum.qiime2.org/u/shira)
#### Post date: [July 15, 2019, 7:13pm UTC](https://forum.qiime2.org/t/trying-to-filter-asvs-based-on-length/10690/1 "2019-07-15T19:13:49Z")

</div>

I would like to filter out asv's below a certain length, because they seem to be sequencing artifacts. I am trying to use the very elegant solution posted here by @thermokarst  
[Filtering out ASVs from DADA2 based on length](https://forum.qiime2.org/t/filtering-out-asvs-from-dada2-based-on-length/9217/4)

However, nothing seems to be happening at the terminal window when I run this. The command I used was:

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

```

Am I using this correctly?

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [July 15, 2019, 7:16pm UTC](https://forum.qiime2.org/t/trying-to-filter-asvs-based-on-length/10690/2 "2019-07-15T19:16:38Z")

</div>

> [@shira](#):
>
> Am I using this correctly?

Looks like you have a grave mark (or a smart quote) instead of a single quote after the number "350". Updated, it would look like this:

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

```

---

<div class="post-metadata">

### Author: ![shira](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/s/aeb1de/32.png) [@shira](https://forum.qiime2.org/u/shira)
#### Post date: [July 15, 2019, 7:20pm UTC](https://forum.qiime2.org/t/trying-to-filter-asvs-based-on-length/10690/3 "2019-07-15T19:20:26Z")

</div>

Brilliant!  
Thank you so much @thermokarst.  
It works like a charm now!  
😃🌈

---

<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: [August 16, 2019, 1:20am UTC](https://forum.qiime2.org/t/trying-to-filter-asvs-based-on-length/10690/4 "2019-08-16T01:20:27Z")

</div>

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