# Error on iqtree step

**URL:** https://forum.biobakery.org/t/error-on-iqtree-step/2472
**Category:** PhyloPhlAn
**Created:** [August 9, 2021, 4:59pm UTC](https://forum.biobakery.org/t/error-on-iqtree-step/2472 "2021-08-09T16:59:41Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![rnc8](https://avatars.discourse-cdn.com/v4/letter/r/8797f3/32.png) [@rnc8](https://forum.biobakery.org/u/rnc8)
#### Post date: [August 9, 2021, 4:59pm UTC](https://forum.biobakery.org/t/error-on-iqtree-step/2472/1 "2021-08-09T16:59:41Z")

</div>

Hello,

I’m trying to build a phylogenetic tree from a custom database of MAGs.  
When running phylophlan with the following settings:  
phylophlan   
-i bins   
-d phylophlan   
-f 02\_tol.cfg   
–diversity high   
–fast   
-o output\_tol   
–nproc 16   
–verbose 2\>&1 | tee phylophlan.log

I successfully run the script all the way through generating the output\_tol/bins\_concatenated.aln. At the last step in iqtree, I receive the error:

[e] Command ‘[’/miniconda3/bin/iqtree’, ‘-quiet’, ‘-nt’, ‘AUTO’, ‘-m’, ‘LG’, ‘-s’, ‘output\_tol/bins\_concatenated.aln’, ‘-pre’, ‘/output\_tol/bins.tre’]’ returned non-zero exit status 2.

I can see that iqtree seems to be the right version and functioning properly (/miniconda3/bin/iqtree --help generates the help list).  
When I try to run the command by itself I get the error “Sequence XXX contains too many characters”, and it appears that my sequence alignment file contain gaps, but all samples do not have the same lengths.  
Is there a parameter I missed in the phytophlan function call to remedy this error?  
Thanks!

---

<div class="post-metadata">

### Author: ![f.asnicar](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/f.asnicar/32/196_2.png) [@f.asnicar](https://forum.biobakery.org/u/f.asnicar)
#### Post date: [August 10, 2021, 12:59pm UTC](https://forum.biobakery.org/t/error-on-iqtree-step/2472/2 "2021-08-10T12:59:21Z")

</div>

Hi, thanks for using PhyloPhlAn and reporting this.

This is very strange. So, first of all, can you provide the version of PhyloPhlAn you’re running? Also, am I right assuming that the configuration file you used has been created using the very same command as [here](https://github.com/biobakery/biobakery/wiki/PhyloPhlAn-3.0:-Example-02:-Tree-of-life#step-2-generating-the-configuration-file)?

Many thanks,  
Francesco

---

<div class="post-metadata">

### Author: ![rnc8](https://avatars.discourse-cdn.com/v4/letter/r/8797f3/32.png) [@rnc8](https://forum.biobakery.org/u/rnc8)
#### Post date: [August 10, 2021, 4:32pm UTC](https://forum.biobakery.org/t/error-on-iqtree-step/2472/3 "2021-08-10T16:32:51Z")

</div>

Hello,

I’m using PhyloPhlAn version 3.0.60 (27 November 2020).

I created a Markdown file using the following commands (as on the website):

phylophlan\_write\_config\_file   
-d a   
-o 02\_tol.cfg   
–db\_aa diamond   
–map\_dna diamond   
–map\_aa diamond   
–msa mafft   
–trim trimal   
–tree1 iqtree   
–verbose 2\>&1 | tee phylophlan\_write\_config\_file.log

I’m currently re-running the program with --msa muscle and --tree1 fasttree in hopes that works, since the error (as far as I can tell…) seems to come from mafft not outputing alignments of the same size. (or maybe the trimal not working if that is what is supposed to make the alignments the same size?)

Thanks,  
Becca

---

<div class="post-metadata">

### Author: ![f.asnicar](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/f.asnicar/32/196_2.png) [@f.asnicar](https://forum.biobakery.org/u/f.asnicar)
#### Post date: [August 12, 2021, 2:18pm UTC](https://forum.biobakery.org/t/error-on-iqtree-step/2472/4 "2021-08-12T14:18:51Z")

</div>

Thanks Becca for the info.

Either MAFFT or trimAl should not make MSA inconsistent, so if there is something not working there it could be due to something else.  
I’m thinking about two things:

1. The [PhyloPhlAn repo](https://github.com/biobakery/phylophlan) contains a slightly newer version, so maybe you can clone and try with the new version. This will make it easier to identify where in the code I should look at in case we need to fix something there.
2. Did you run only once the command you provided in your first message? Because PhyloPhlAn is able to resume a halted execution (and when there are errors it tries to clean broken files), but if some incomplete files remained that could result in problems in future runs on the same data.

Many thanks,  
Francesco

---

<div class="post-metadata">

### Author: ![rnc8](https://avatars.discourse-cdn.com/v4/letter/r/8797f3/32.png) [@rnc8](https://forum.biobakery.org/u/rnc8)
#### Post date: [August 12, 2021, 5:23pm UTC](https://forum.biobakery.org/t/error-on-iqtree-step/2472/5 "2021-08-12T17:23:06Z")

</div>

Hi Francesco,

I’ll try downloading the updated code and running it once. My guess is it’s the same issue as was posted previously (I hadn’t seen it until just now): [Supermatrix alignment has varying length -\> error in tree build](https://forum.biobakery.org/t/supermatrix-alignment-has-varying-length-error-in-tree-build/1488).  
I only ran the program once, so I don’t think it’s an issue with cleaning broken files.

Thanks,  
Becca

---

<div class="post-metadata">

### Author: ![rnc8](https://avatars.discourse-cdn.com/v4/letter/r/8797f3/32.png) [@rnc8](https://forum.biobakery.org/u/rnc8)
#### Post date: [August 12, 2021, 7:24pm UTC](https://forum.biobakery.org/t/error-on-iqtree-step/2472/6 "2021-08-12T19:24:18Z")

</div>

Hello,

For what it’s worth - the program did not have the same error when I ran it with MUSCLE & Fasttree (the following config file):  
[db\_aa]  
program\_name = ~miniconda3/bin/diamond  
params = makedb  
threads = --threads  
input = --in  
output = --db  
version = version  
command\_line = #program\_name# #params# #threads# #input# #output#

[map\_dna]  
program\_name = ~miniconda3/bin/diamond  
params = blastx --quiet --threads 1 --outfmt 6 --more-sensitive --id 50 --max-hsps 35 -k 0  
input = --query  
database = --db  
output = --out  
version = version  
command\_line = #program\_name# #params# #input# #database# #output#

[map\_aa]  
program\_name = ~miniconda3/bin/diamond  
params = blastp --quiet --threads 1 --outfmt 6 --more-sensitive --id 50 --max-hsps 35 -k 0  
input = --query  
database = --db  
output = --out  
version = version  
command\_line = #program\_name# #params# #input# #database# #output#

[msa]  
program\_name = ~miniconda3/bin/muscle  
params = -quiet -maxiters 2  
input = -in  
output = -out  
version = -version  
command\_line = #program\_name# #params# #input# #output#

[trim]  
program\_name = ~miniconda3/bin/trimal  
params = -gappyout  
input = -in  
output = -out  
version = --version  
command\_line = #program\_name# #params# #input# #output#

[tree1]  
program\_name =~miniconda3/bin/FastTreeMP  
params = -quiet -pseudo -spr 4 -mlacc 2 -slownni -fastest -no2nd -mlnni 4 -lg  
output = -out  
command\_line = #program\_name# #params# #output# #input#  
environment = OMP\_NUM\_THREADS=3

Best,  
Becca

---

<div class="post-metadata">

### Author: ![f.asnicar](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.biobakery.org/f.asnicar/32/196_2.png) [@f.asnicar](https://forum.biobakery.org/u/f.asnicar)
#### Post date: [August 13, 2021, 7:26am UTC](https://forum.biobakery.org/t/error-on-iqtree-step/2472/7 "2021-08-13T07:26:00Z")

</div>

Thanks Becca.  
Yes, I’m aware of the other discussion about this topic, but I never got a reply to do some debug on that case, and I don’t think it is related to the PhyloPhlAn markers as if it were PhyloPhlAn should always fail (which is not the case).  
I’m happy it worked with the other settings, so I’m wondering where it could be due to some problems with MAFFT in your first trial.

I have the command line and the config file from your previous messages, if you can send me (by email if you prefer) your input folder, I’ll be happy to run some tests here to see if I can reproduce your error.

Many thanks,  
Francesco
