# Sub.sample in mothur

**URL:** <https://forum.mothur.org/t/sub-sample-in-mothur/22393>\
**Category:** Commands in mothur\
**Created:** [December 11, 2025, 12:43pm UTC](https://forum.mothur.org/t/sub-sample-in-mothur/22393 "2025-12-11T12:43:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![luo](https://avatars.discourse-cdn.com/v4/letter/l/9f8e36/32.png) [@luo](https://forum.mothur.org/u/luo)\
**Post date:** [December 11, 2025, 12:43pm UTC](https://forum.mothur.org/t/sub-sample-in-mothur/22393/1 "2025-12-11T12:43:54Z")

</div>

Hello, I’m currently facing an issue where I placed sub.sample after remove.lineage. After running sub.sample(  
fasta=stability.trim.contigs.good.unique.good.filter.unique.precluster.pick.pick.fasta,  
count=stability.trim.contigs.good.unique.good.filter.unique.precluster.pick.pick.count\_table,  
size=16794  
),  
the result obtained is a random draw of 16,794 sequences from the total pool,whereas I intended to draw 16,794 sequences from each sample. Why is this happening? What should I do next to achieve the desired outcome?

---

<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:** [December 11, 2025, 2:59pm UTC](https://forum.mothur.org/t/sub-sample-in-mothur/22393/2 "2025-12-11T14:59:56Z")

</div>

My suspicion is that you only have one group represented in `stability.trim.contigs.good.unique.good.filter.unique.precluster.pick.pick.count_table`. Can you run `count.groups` on the file and see what you get? You probably left out the group information at some step in your pipeline. I’d suggest running `count.groups` after each step to see where the grouping information was removed. That will tell you where you have a problem. You might try it right after `make.contigs` to insure you had them from the beginning

Pat

---

<div class="post-metadata">

**Author:** ![luo](https://avatars.discourse-cdn.com/v4/letter/l/9f8e36/32.png) [@luo](https://forum.mothur.org/u/luo)\
**Post date:** [December 11, 2025, 3:32pm UTC](https://forum.mothur.org/t/sub-sample-in-mothur/22393/3 "2025-12-11T15:32:51Z")

</div>

However, after remove.lineage, I ran count.groups, which displayed the number of sequences for each group and the minimum number of sequences among the samples. I believe the grouping information was preserved. If I want to perform sub.sample after remove.lineage, is it feasible? Could you provide me with the code for that?

---

<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:** [December 12, 2025, 2:11pm UTC](https://forum.mothur.org/t/sub-sample-in-mothur/22393/4 "2025-12-12T14:11:35Z")

</div>

Can you try running sub.sample with `persample=true` as one of the arguments? You can learn more about the argument here: [sub.sample](https://mothur.org/wiki/sub.sample/#persample)

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/system/32/2_2.png) [@system](https://forum.mothur.org/u/system)\
**Post date:** [December 22, 2025, 2:12pm UTC](https://forum.mothur.org/t/sub-sample-in-mothur/22393/5 "2025-12-22T14:12:08Z")

</div>

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