# Options to adjust thresholds to work around 'too many samples discarded' issue

**URL:** https://forum.biobakery.org/t/options-to-adjust-thresholds-to-work-around-too-many-samples-discarded-issue/5332
**Category:** StrainPhlAn
**Created:** [May 25, 2023, 9:11am UTC](https://forum.biobakery.org/t/options-to-adjust-thresholds-to-work-around-too-many-samples-discarded-issue/5332 "2023-05-25T09:11:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![osvatic](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/osvatic/32/2062_2.png) [@osvatic](https://forum.biobakery.org/u/osvatic)
#### Post date: [May 25, 2023, 9:11am UTC](https://forum.biobakery.org/t/options-to-adjust-thresholds-to-work-around-too-many-samples-discarded-issue/5332/1 "2023-05-25T09:11:41Z")

</div>

Hey,

I am using StrainPhlan in MetaPhlan 4.0.6. I have been trying to generate strain phylogenies for taxonomies that appear in \>50% of my samples according to my MetaPhlan outputs. Even with this threshold I am getting a lot of strainphlan issues that say “too many samples discarded”.

I noticed that there is also the following options:

```auto
[--marker_in_n_samples MARKER_IN_N_SAMPLES]                                                                                                                                                     
[--sample_with_n_markers SAMPLE_WITH_N_MARKERS]  

```

Both of these thresholds are automatically set to 80%. Are there suggested minimum thresholds to use or would setting these to 1% be appropriate? Or should I set the --marker\_in\_n\_samples to 1% and keep the --sample\_with\_n\_markers to 50% to minimize low quality (uninformative) alignments?

Thanks!

---

<div class="post-metadata">

### Author: ![aitor.blancomiguez](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/aitor.blancomiguez/32/86_2.png) [@aitor.blancomiguez](https://forum.biobakery.org/u/aitor.blancomiguez)
#### Post date: [June 6, 2023, 9:29am UTC](https://forum.biobakery.org/t/options-to-adjust-thresholds-to-work-around-too-many-samples-discarded-issue/5332/2 "2023-06-06T09:29:36Z")

</div>

Hi @osvatic  
Decreasing the threshold to 1% will probably lead to low quality alignments with large gappy regions, I would not go below 20% for most of the cases

---

<div class="post-metadata">

### Author: ![osvatic](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/osvatic/32/2062_2.png) [@osvatic](https://forum.biobakery.org/u/osvatic)
#### Post date: [June 6, 2023, 9:46am UTC](https://forum.biobakery.org/t/options-to-adjust-thresholds-to-work-around-too-many-samples-discarded-issue/5332/3 "2023-06-06T09:46:38Z")

</div>

Hi @aitor.blancomiguez,

Thanks for the response!

Are you referring to 1% (or 20%) for --marker\_in\_n\_samples? or --sample\_with\_n\_markers?

I could see how a low % in ‘sample\_with\_n\_markers’ would effect the alignments. Currently I am trying 50% for this value and reduced the ‘marker\_in\_n\_samples’ to 10%, which was used in a few papers.

---

<div class="post-metadata">

### Author: ![aitor.blancomiguez](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/aitor.blancomiguez/32/86_2.png) [@aitor.blancomiguez](https://forum.biobakery.org/u/aitor.blancomiguez)
#### Post date: [June 6, 2023, 9:49am UTC](https://forum.biobakery.org/t/options-to-adjust-thresholds-to-work-around-too-many-samples-discarded-issue/5332/4 "2023-06-06T09:49:04Z")

</div>

For any of them. Reducing too much --sample\_with\_n\_markers, will create rows in the MSA with many gaps while reducing --markers\_in\_n\_samples will include gappy columns that will further be discarded during the trimming procedure.
