# sub.sample selectively?

**URL:** <https://forum.mothur.org/t/sub-sample-selectively/2262>\
**Category:** Commands in mothur\
**Created:** [February 20, 2015, 4:33pm UTC](https://forum.mothur.org/t/sub-sample-selectively/2262 "2015-02-20T16:33:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![epringle](https://avatars.discourse-cdn.com/v4/letter/e/c2a13f/32.png) [@epringle](https://forum.mothur.org/u/epringle)\
**Post date:** [February 20, 2015, 4:33pm UTC](https://forum.mothur.org/t/sub-sample-selectively/2262/1 "2015-02-20T16:33:57Z")

</div>

Hi,

I have a dataset where the sequences come from very different sources, but I’d like to analyze all of them together, at least for beta-diversity.  
When I get to count.groups the dramatic differences in source material cause dramatic differences in number of sequences per group. Can I sub.sample separately for each source, using key identifiers in the sampleName for each?

i.e., I have 14 groups/samples whose sample name start with “Az\_”–can I subsample these to 600, but subsample the 4 groups/samples whose sample name starts with “Coc\_” to 1500?

Many thanks,  
Beth

---

<div class="post-metadata">

**Author:** ![pschloss](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/pschloss/32/4_2.png) [@pschloss](https://forum.mothur.org/u/pschloss)\
**Post date:** [February 23, 2015, 1:36pm UTC](https://forum.mothur.org/t/sub-sample-selectively/2262/2 "2015-02-23T13:36:35Z")

</div>

No. To do what you want to do, you’d have to do get.groups on the shared file and subsample the separate subsampled shared files. I’m not sure I can think of a case where you’d want to do an analysis where things would be subsampled differently.
