# Problem running StrainPhlan

**URL:** <https://forum.biobakery.org/t/problem-running-strainphlan/1904>\
**Category:** StrainPhlAn\
**Created:** [April 8, 2021, 11:55am UTC](https://forum.biobakery.org/t/problem-running-strainphlan/1904 "2021-04-08T11:55:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sinkko](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sinkko](https://forum.biobakery.org/u/sinkko)\
**Post date:** [April 8, 2021, 11:55am UTC](https://forum.biobakery.org/t/problem-running-strainphlan/1904/1 "2021-04-08T11:55:30Z")

</div>

Dear Help

I have been running Strainphlan for the first time and followed the tutorial and manual. The first steps were successful until when I calling strainphlan to build the multiple sequence alignment and the phylogenetic tree by executing Phylophlan.

I have reinstalled Strainphlan and used the latest version. Before this version I tried with the version I installed in May 2020. The older version finalised this step, but couldn’t remove tmp file, so I decided to update Strainphlan and try again but it the newer version didn’t work though this step.

Here is my script ( I didn’t include yet any reference genome for Cutibacterium acnes):

strainphlan -s sample\_markers/all/\*.pkl -m strains\_db\_markers/s\_\_Cutibacterium\_acnes.fna -o strains\_tree\_Cacnes -n 4 -c s\_\_Cutibacterium\_acnes --marker\_in\_n\_samples 40

See below the error message I got:

Tue Apr 6 16:30:11 2021: Start StrainPhlAn 3.0 execution  
Tue Apr 6 16:30:11 2021: Creating temporary directory…  
Tue Apr 6 16:30:11 2021: Done.  
Tue Apr 6 16:30:11 2021: Getting markers from main sample files…  
Tue Apr 6 16:30:14 2021: Done.  
Tue Apr 6 16:30:14 2021: Getting markers from main reference files…  
Tue Apr 6 16:30:15 2021: Done.  
Tue Apr 6 16:30:15 2021: Removing bad markers / samples…  
Tue Apr 6 16:30:15 2021: Done.  
Tue Apr 6 16:30:15 2021: Writing samples as markers’ FASTA files…  
Tue Apr 6 16:30:15 2021: Done.  
Tue Apr 6 16:30:15 2021: Writing filtered clade markers as FASTA file…  
Tue Apr 6 16:30:15 2021: Done.  
Tue Apr 6 16:30:15 2021: Calculating polymorphic rates…  
Tue Apr 6 16:30:16 2021: Done.  
Tue Apr 6 16:30:16 2021: Executing PhyloPhlAn 3.0…  
Tue Apr 6 16:30:16 2021: Creating PhyloPhlAn 3.0 database…  
Tue Apr 6 16:30:16 2021: Done.  
Tue Apr 6 16:30:16 2021: Generating PhyloPhlAn 3.0 configuration file…  
Tue Apr 6 16:30:16 2021: Done.  
Tue Apr 6 16:30:16 2021: Processing samples…  
[e] expected str, bytes or os.PathLike object, not NoneType

[e] gene\_markers\_selection crashed

[e] An error was ocurred executing a external tool, exiting…  
Tue Apr 6 16:30:50 2021: Stop StrainPhlAn 3.0 execution.

Big thanks if you can Help me!  
Br, Hanna Sinkko

---

<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 8, 2021, 2:42pm UTC](https://forum.biobakery.org/t/problem-running-strainphlan/1904/2 "2021-04-08T14:42:13Z")

</div>

Hi @sinkko  
Thanks for getting in touch. Could you provide me some additional info to better address the issue?

- Which was the installation method, conda?
- MetaPhlAn version: you can run `metaphlan --version`
- PhyloPhlAn version: you can run `phylophlan --version`
- The content of the temporal folder created in the output directory

Thanks,  
Aitor

---

<div class="post-metadata">

**Author:** ![sinkko](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sinkko](https://forum.biobakery.org/u/sinkko)\
**Post date:** [April 8, 2021, 3:10pm UTC](https://forum.biobakery.org/t/problem-running-strainphlan/1904/3 "2021-04-08T15:10:46Z")

</div>

Hi Aitor and thanks for help:

I installed with conda with the following commands:

module load bioconda/2  
conda create -n metaphlan  
conda activate metaphlan  
conda install -c bioconda metaphlan

I’m running MetaPhlAn version 3.0.7 (09 Dec 2020) and it is working just fine.

PhyloPhlAn version is older 3.0.51 (11 May 2020)

Maybe the problem is that? Although I think I also updated phylophlan but seems that the version is older than the newest 3.0.2.

The output directory includes these:

24K -rw-rw----. 1 sinkko project\_2001318 24K Apr 8 17:52 s\_\_Cutibacterium\_acnes.polymorphic  
4.0K drwxrws—. 5 sinkko project\_2001318 4.0K Apr 8 17:52 tmp

And the tmp directory includes these:  
4.0K drwxrws—. 2 sinkko project\_2001318 4.0K Apr 8 17:52 blastn  
12K drwxrws—. 2 sinkko project\_2001318 12K Apr 8 17:52 s\_\_Cutibacterium\_acnes  
4.0K drwxrws—. 2 sinkko project\_2001318 4.0K Apr 8 17:52 s\_\_Cutibacterium\_acnes.StrainPhlAn3

blastn folder is empty but in the s\_\_Cutibacterium - folders there are several .fna files.

---

<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 8, 2021, 3:32pm UTC](https://forum.biobakery.org/t/problem-running-strainphlan/1904/4 "2021-04-08T15:32:48Z")

</div>

Hi @sinkko  
Yes, it could actually be a problem with the old version of PhyloPhlAn, we got reported some problems with the BLAST execution in older versions (that seems the stage your execution got stuck) and conda seems to have problems sometimes to retrieve the last version when installing metaphlan. I would try to install the last version of PhyloPhlAn: `conda install -c bioconda phylophlan` and try to execute it again. Let me know if this fixes your issue.

Thanks

---

<div class="post-metadata">

**Author:** ![sinkko](https://avatars.discourse-cdn.com/v4/letter/s/47e85d/32.png) [@sinkko](https://forum.biobakery.org/u/sinkko)\
**Post date:** [April 9, 2021, 6:50am UTC](https://forum.biobakery.org/t/problem-running-strainphlan/1904/5 "2021-04-09T06:50:23Z")

</div>

Hi Aitor,

That helped, thanks! My next question is that as far as I have understood there are reference genomes used in the MetaPhlAn database. Can I use those for strainphlan? I didn’t add the reference genome yet but I would like to, I just have hard time to find them. So where can I find them? Or should I use some public databases to retrieve a reference genome?

Br, Hanna

---

<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 9, 2021, 11:35am UTC](https://forum.biobakery.org/t/problem-running-strainphlan/1904/6 "2021-04-09T11:35:32Z")

</div>

Hi @sinkko  
For building the MetaPhlAn markers database we downloaded all reference genomes available through UniProt Proteomes and linked to the public DDBJ, ENA, and GenBank repositories. However since they are already available in those public repositories we didn’t make them available to download from our servers. I would suggest you to download them directly from GenBank, e.g: [Cutibacterium acnes - Assembly - NCBI](https://www.ncbi.nlm.nih.gov/assembly/?term=Cutibacterium+acnes)

Best,  
Aitor

---

<div class="post-metadata">

**Author:** ![chen](https://avatars.discourse-cdn.com/v4/letter/c/3d9bf3/32.png) [@chen](https://forum.biobakery.org/u/chen)\
**Post date:** [August 21, 2024, 7:40am UTC](https://forum.biobakery.org/t/problem-running-strainphlan/1904/7 "2024-08-21T07:40:39Z")

</div>

Hi,  
I am having the same problem, but my PhyloPhlan version is: PhyloPhlAn version 3.1.68 (6 March 2024). Do you have any other suggestions to what can cause it?  
attaching my script and output log.  
thanks for any help!

script:  
strainphlan -s /consensus\_markers/\*pkl   
-m /db\_markers/all\_sgb/$sgb.fna   
–sample\_with\_n\_markers 40   
–marker\_in\_n\_samples 40   
-o /output/all\_sgbs/test\_all\_sgb/ -c $sgb   
–nprocs $threads   
–mutation\_rates --phylophlan\_mode accurate

output log:  
Thu Aug 15 16:04:36 2024: Start StrainPhlAn 4.0.6 execution

Thu Aug 15 16:04:36 2024: Creating temporary directory…

Thu Aug 15 16:04:36 2024: Done.

Thu Aug 15 16:04:36 2024: Filtering markers and samples…

Thu Aug 15 16:04:36 2024: Getting markers from main samples…

Thu Aug 15 16:04:45 2024: Done.

Thu Aug 15 16:04:45 2024: Getting markers from main references…

Thu Aug 15 16:04:45 2024: Done.

Thu Aug 15 16:04:45 2024: Removing bad markers / samples…

Thu Aug 15 16:04:45 2024: Done.

Thu Aug 15 16:04:45 2024: Getting markers from secondary samples and references…

Thu Aug 15 16:04:45 2024: Done.

Thu Aug 15 16:04:45 2024: Done.

Thu Aug 15 16:04:45 2024: Writing samples as markers’ FASTA files…

Thu Aug 15 16:04:46 2024: Done.

Thu Aug 15 16:04:46 2024: Writing filtered clade markers as FASTA file…

Thu Aug 15 16:04:47 2024: Done.

Thu Aug 15 16:04:47 2024: Calculating polymorphic rates…

Thu Aug 15 16:04:50 2024: Done.

Thu Aug 15 16:04:50 2024: Executing PhyloPhlAn…

Thu Aug 15 16:04:50 2024: Creating PhyloPhlAn database…

Thu Aug 15 16:04:51 2024: Done.

Thu Aug 15 16:04:51 2024: Generating PhyloPhlAn configuration file…

Thu Aug 15 16:04:52 2024: Done.

Thu Aug 15 16:04:53 2024: Processing samples…

[e] expected str, bytes or os.PathLike object, not NoneType

[e] mutation\_rates crashed

Thu Aug 15 16:07:12 2024: [Error] An error was ocurred executing a external tool, exiting…Thu Aug 15 16:07:12 2024: Stop StrainPhlAn execution.

thank you!  
chen
