Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constraint not compatible with ModelFinder? #166

Closed
alephreish opened this issue Mar 15, 2024 · 5 comments
Closed

Constraint not compatible with ModelFinder? #166

alephreish opened this issue Mar 15, 2024 · 5 comments

Comments

@alephreish
Copy link

alephreish commented Mar 15, 2024

It seems that constraint is not taken taken into account if the model is not specified explicitly:

$ iqtree2 --version
IQ-TREE multicore version 2.3.0 COVID-edition for Linux 64-bit built Mar 14 2024
Developed by Bui Quang Minh, James Barbetti, Nguyen Lam Tung,
Olga Chernomor, Heiko Schmidt, Dominik Schrempf, Michael Woodhams, Ly Trong Nhan.
$ cat constr.tree 
((Human,Cow),(Seal,Whale));
#
# unconstrained
$ iqtree2 -s $CONDA_PREFIX/example.phy --prefix example.unconstr
# constrained, explicit model
$ iqtree2 -s $CONDA_PREFIX/example.phy -m TIM2+I+G -g constr.tree --prefix example.constr
# constrained, ModelFinder
$ iqtree2 -s $CONDA_PREFIX/example.phy -g constr.tree --prefix example.constr.auto
$ grep constraint example.*.log
example.constr.auto.log:Reading constraint tree constr.tree...
example.constr.auto.log:WARNING: Rooted constraint tree will be treated as unrooted tree
example.constr.log:Reading constraint tree constr.tree...
example.constr.log:WARNING: Rooted constraint tree will be treated as unrooted tree
#
# The constraint+ModelFinder tree is not different from the unconstrained tree:
$ nw_labels constr.tree | xargs nw_prune -v example.unconstr.treefile | nw_display - -w 60
                                      /--------------+ Human
                                      |                     
=-------------------------------------+ /-------+ Seal      
                                      | |                   
                                      \-+  /------+ Cow     
                                        \--+                
                                           \--------+ Whale 
                                                            
 |---------------|---------------|---------------|----      
 0             0.2             0.4             0.6          
 substitutions/site                                         
$ nw_labels constr.tree | xargs nw_prune -v example.constr.auto.treefile | nw_display - -w 60
                                      /--------------+ Human
                                      |                     
=-------------------------------------+ /-------+ Seal      
                                      | |                   
                                      \-+  /------+ Cow     
                                        \--+                
                                           \--------+ Whale 
                                                            
 |---------------|---------------|---------------|----      
 0             0.2             0.4             0.6          
 substitutions/site                                         
#
# The constraint+explicit model tree respects the constraint:
$ nw_labels constr.tree | xargs nw_prune -v example.constr.treefile | nw_display - -w 60
                                      /--------------+ Human
                                      |                     
=-------------------------------------+   /--------+ Seal   
                                      |  /+                 
                                      \--+\--------+ Whale  
                                         |                  
                                         \-------+ Cow      
                                                            
 |---------------|---------------|---------------|----      
 0             0.2             0.4             0.6          
 substitutions/site                                         
$ nw_display constr.tree -w 60
                           /-------------------------+ Human
 /-------------------------+                                
 |                         \-------------------------+ Cow  
=+                                                          
 |                         /-------------------------+ Seal 
 \-------------------------+                                
                           \-------------------------+ Whale
@AlesBucek
Copy link

AlesBucek commented Mar 26, 2024

I could not replicate the problem in following run (i.e. constraint was applied as expected):

module load iqtree/2.0.7
iqtree2 -s $InAln -nt AUTO -spp $InPart -m TESTMERGE -rclusterf 10 -g $ConstraintFile -bb 1000 -bnni -pre $OutDir

@alephreish
Copy link
Author

@AlesBucek I cannot comment on your observation since you haven't provided a reproducible example. I've tested versions 2.0.3 and 2.1.2 which are available from conda with my minimal example above and they behave exactly as the latest version (2.3.0).

@iqtree
Copy link
Collaborator

iqtree commented Mar 27, 2024

Can you try adding -t PARS option to the command line and see if that solves the issue?

@alephreish
Copy link
Author

@iqtree Nope, it doesn't solve the issue:

$ iqtree2 --version
IQ-TREE multicore version 2.3.0 COVID-edition for Linux 64-bit built Mar 14 2024
Developed by Bui Quang Minh, James Barbetti, Nguyen Lam Tung,
Olga Chernomor, Heiko Schmidt, Dominik Schrempf, Michael Woodhams, Ly Trong Nhan.
#
$ grep Command example.*.log
example.constr.auto.log:Command: iqtree2 -s /path/to/iqtree_env/example.phy -g constr.tree --prefix example.constr.auto -t PARS -redo
example.constr.TIM2.log:Command: iqtree2 -s /path/to/iqtree_env/example.phy -m TIM2+I+G -g constr.tree --prefix example.constr.TIM2 -t PARS -redo
example.unconstr.log:Command: iqtree2 -s /path/to/iqtree_env/example.phy --prefix example.unconstr -t PARS -redo
#
$ function plot_tree() { nw_labels constr.tree | xargs nw_prune -v "$1" | nw_reroot - Human | nw_order - | nw_topology - | nw_display - -w 20; }
# The constraint
$ plot_tree constr.tree
     /-------+ Cow  
     |              
 /---+   /---+ Seal 
 |   \---+          
=+       \---+ Whale
 |                  
 \-----------+ Human
                    
#                   
# Constrained tree with defined model
$ plot_tree example.constr.TIM2.treefile
     /-------+ Cow  
     |              
 /---+   /---+ Seal 
 |   \---+          
=+       \---+ Whale
 |                  
 \-----------+ Human
                    
#
# "Constrained" tree with ModelFinder
$ plot_tree example.constr.auto.treefile
         /---+ Cow  
     /---+          
 /---+   \---+ Whale
 |   |              
=+   \-------+ Seal 
 |                  
 \-----------+ Human
                    
#                    
# Unconstrained tree
$ plot_tree example.unconstr.treefile
         /---+ Cow  
     /---+          
 /---+   \---+ Whale
 |   |              
=+   \-------+ Seal 
 |                  
 \-----------+ Human
                                    

@thomaskf
Copy link
Collaborator

Hi @alephreish ,
Thanks for reporting the issue. This issue has been fixed. Please use the version 2.3.3 or later.
Thomas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants