# gathering a random subset of reference sequences

**URL:** https://forum.qiime2.org/t/gathering-a-random-subset-of-reference-sequences/15961
**Category:** User Support
**Tags:** best-of-the-forum, filter-features, filtering
**Created:** [August 5, 2020, 6:22pm UTC](https://forum.qiime2.org/t/gathering-a-random-subset-of-reference-sequences/15961 "2020-08-05T18:22:04Z")
**Posts on this page:** 1
**Showing post:** 3

<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: [August 10, 2020, 8:54pm UTC](https://forum.qiime2.org/t/gathering-a-random-subset-of-reference-sequences/15961/3 "2020-08-10T20:54:00Z")

</div>

Hey @devonorourke - this is a great feature request (feel free to open a ticket at [GitHub - qiime2/q2-feature-table: QIIME 2 plugin supporting operations on feature tables.](http://github.com/qiime2/q2-feature-table)). In the meantime, here is a SQL-based workaround, all in QIIME 2:

```bash
 qiime feature-table filter-seqs \
  --i-data rep-seqs.qza \
  --m-metadata-file rep-seqs.qza \
  --p-where "[Feature ID] IN (SELECT [Feature ID] FROM metadata ORDER BY RANDOM() LIMIT 10)" \
  --o-filtered-data filtered.qza

```

Here we select 10 random sequences, but you can change the number to match whatever threshold you need.

:qiime2:

---

_[View the full topic](https://forum.qiime2.org/t/gathering-a-random-subset-of-reference-sequences/15961)._
