# A Error occurred by running StrainPhlAn(4.0.6), this error is \[Error\] Phylogeny can not be inferred. Too many samples were discarded

**URL:** <https://forum.biobakery.org/t/a-error-occurred-by-running-strainphlan-4-0-6-this-error-is-error-phylogeny-can-not-be-inferred-too-many-samples-were-discarded/5180>\
**Category:** StrainPhlAn\
**Created:** [April 21, 2023, 11:11am UTC](https://forum.biobakery.org/t/a-error-occurred-by-running-strainphlan-4-0-6-this-error-is-error-phylogeny-can-not-be-inferred-too-many-samples-were-discarded/5180 "2023-04-21T11:11:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yunan](https://avatars.discourse-cdn.com/v4/letter/y/779978/32.png) [@Yunan](https://forum.biobakery.org/u/Yunan)\
**Post date:** [April 21, 2023, 11:11am UTC](https://forum.biobakery.org/t/a-error-occurred-by-running-strainphlan-4-0-6-this-error-is-error-phylogeny-can-not-be-inferred-too-many-samples-were-discarded/5180/1 "2023-04-21T11:11:25Z")

</div>

Dear authors,

I am encountering an error when running StrainPhlAn(version=4.0.6) using the pipeline provided in the Github([StrainPhlAn 4 · biobakery/MetaPhlAn Wiki · GitHub](https://github.com/biobakery/MetaPhlAn/wiki/StrainPhlAn-4)). The error message is"[Error] Phylogeny can not be inferred. Too many samples were discarded".

I am using the data provided in this link: [Index of /biobakery4/github\_strainphlan4](http://cmprod1.cibio.unitn.it/biobakery4/github_strainphlan4/). Specifically, I am running step 5 of the pipeline to obtain the output results.

When examining the reference database file, db\_markers, I noticed that there were some differences between the version provided in the link and the version that is generated when I run the pipeline. For example, the reference sequence for the SGB1877 strain is represented differently in the two versions.

“the link” offered is “\>SGB1877\_\_FHNOMNMD\_02167 UniRef90\_R5UVX9;k\_\_Bacteria|p\_\_Bacteroidetes|c\_\_Bacteroidia|o\_\_Bacteroidales|f\_\_Bacteroidaceae|g\_\_Bacteroides|s\_\_Bacteroides\_caccae|t\_\_SGB1877;ZeeviD\_2015\_\_PNP\_Main\_212\_\_bin.37 ATGAAATATTTTAAAAGATTAATGATAACGCTATGTACAGCGTTCTACTTTTGCCTGTCC TCCTGCAATTACTTGAATGTGGATGAGTATTTTGCTGATACATTGGGATACGATTCTATT TTTTCAGAATAAAATGAATCTTCAGAAATATCTATGGGCTACGGCTGCTTTCTTCCCCGAT GAGGGCGCTATCTGGGGTGGTGCTTATACACCGGGTGTTACCGGTTCGGATGAAGCCTTT GTGCAATGGAACACGGGCGAATTTCCCGGAGTAACATTTGTTTTGGGGCACACGACTCCC”

which generated by running the pipeline is “\>UniRef90\_A0A174E9V7|4\_\_9|SGB1877 CGAAGAATCCTGTCCGGTGAAAGCTATCAGTAAAGATGAACACGGAATAGAGCATATCGA CGAAAGCAAATGTATATATTGCGGAAAGTGCATGAATGCTTGTCCGTTCGGTGCTATCTT CGAGATTTCACAGACATTCGACGTTTTGCAACGAATCCGTAAAGGAGAGAAAATGGTGGC TATTATTGCTCCGTCTATCCTCGGGCAGTTCAAGACTTCGATCGAACAAGTATATGGAGC TTTTAAAGAAATAGGATTTACCGATGTGATTGAAGTGGCCGAAGGAGCAATGTCGACTAC”

I am not sure if this difference is the cause of the error I am encountering, but I wanted to mention it in case it is relevant.

Do you have any suggestions for how I can resolve this error? I have already tried to troubleshoot the issue by examining the data and software versions, but I have not been able to identify a solution.

Thank you for your time and assistance.

---

<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:** [April 21, 2023, 1:31pm UTC](https://forum.biobakery.org/t/a-error-occurred-by-running-strainphlan-4-0-6-this-error-is-error-phylogeny-can-not-be-inferred-too-many-samples-were-discarded/5180/2 "2023-04-21T13:31:20Z")

</div>

Hi @Yunan  
The example in github was executed using the vJan21 database while now, by default, metaphlan 4 execute version vOct22. Using the parameter `--index mpa_vJan21_CHOCOPhlAnSGB_202103` (will also download and install the old database, but oct22 will still be the default) should produce the same results

---

<div class="post-metadata">

**Author:** ![Yunan](https://avatars.discourse-cdn.com/v4/letter/y/779978/32.png) [@Yunan](https://forum.biobakery.org/u/Yunan)\
**Post date:** [April 21, 2023, 3:17pm UTC](https://forum.biobakery.org/t/a-error-occurred-by-running-strainphlan-4-0-6-this-error-is-error-phylogeny-can-not-be-inferred-too-many-samples-were-discarded/5180/3 "2023-04-21T15:17:25Z")

</div>

> [@aitor.blancomiguez](#):
>
> vJan21 database

@aitor.blancomiguez  
In the begining, I thought it was the version of dataset caused the error,so I clear vJan21 database.and rerun the pipeline.  
However this error still occured in step5 when run “strainphlan -s consensus\_markers/\*.pkl -m db\_markers/t\_\_SGB1877.fna -r reference\_genomes/G000273725.fna.bz2 -o output -n 8 -c t\_\_SGB1877 --mutation\_rates”  
then i add "–marker\_in\_n\_samples 1 --sample\_with\_n\_markers 1 " in this code and the other error occured ,it seems like occured in the aligning process  
“[e] Command ‘[’~/miniconda3/envs/Metaphlan/bin/mafft’, ‘–quiet’, ‘–anysymbol’, ‘–thread’, ‘1’, ‘–auto’, ‘output/tmpil09t85f/markers/848025373357.fna’]’ returned non-zero exit status 1.”  
“[e] msas crashed” So,is it the dataset caused this error?and how to solve it?

---

<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:** [April 27, 2023, 8:16am UTC](https://forum.biobakery.org/t/a-error-occurred-by-running-strainphlan-4-0-6-this-error-is-error-phylogeny-can-not-be-inferred-too-many-samples-were-discarded/5180/4 "2023-04-27T08:16:53Z")

</div>

Hi @Yunan  
Reducing the --marker\_in\_n\_samples or --sample\_with\_n\_markers to 1 (meaning 1%) will produce that some of the markers would be empty and the multiple sequence alignment by mafft will crash. But, did you also run sample2markers specifying the jan21 version of the database or only strainphlan?

---

<div class="post-metadata">

**Author:** ![Yunan](https://avatars.discourse-cdn.com/v4/letter/y/779978/32.png) [@Yunan](https://forum.biobakery.org/u/Yunan)\
**Post date:** [April 28, 2023, 3:08am UTC](https://forum.biobakery.org/t/a-error-occurred-by-running-strainphlan-4-0-6-this-error-is-error-phylogeny-can-not-be-inferred-too-many-samples-were-discarded/5180/5 "2023-04-28T03:08:27Z")

</div>

Hello @aitor.blancomiguez  
I just use StrainPhlan(4.0.6) to test the pipeline. and the demo data can run fluently by Jan21,when I use datadet Oct22, this pipeline give me this error message. I don’t know if the dataset version caused this error.And if you have free time to use Oct22 dataset to run the demo data,and might help me to exclude whether is the dataset version problems.  
Good luck for you

---

<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:** [May 9, 2023, 6:47am UTC](https://forum.biobakery.org/t/a-error-occurred-by-running-strainphlan-4-0-6-this-error-is-error-phylogeny-can-not-be-inferred-too-many-samples-were-discarded/5180/6 "2023-05-09T06:47:12Z")

</div>

Hi Yunan,  
The tutorial read files were filtered out for speed up purposes to contain only reads mapping against the Jan21 markers. As the markers between versions might change, it can produce slightly different results or even not work.
