mcmctree: "Error: check #seqs and tree: perhaps too many '('?"

210 views
Skip to first unread message

bucek...@gmail.com

unread,
Oct 21, 2023, 6:57:15 PM10/21/23
to PAML discussion group
I'm running into error "Error: check #seqs and tree: perhaps too many '('?" when running mcmctree with paml version 4.9j

Another user on the forum resolved the problem by removing extra brackets (https://groups.google.com/g/pamlsoftware/c/HDzJoYYKgKg) but that does not seem to be my problem (tree attached). Could something else trigger this error?

Thanks!
mcmctree.tre

bucek...@gmail.com

unread,
Oct 22, 2023, 6:16:32 AM10/22/23
to PAML discussion group
RESOLVED. (I accidentally swapped the numbers for the number of trees and number of taxa on the first line of tree file)

Sandra AC

unread,
Oct 22, 2023, 6:26:42 AM10/22/23
to PAML discussion group
Hi there!

Good to read that you found the problem! To clarify this issue to other users, please make sure that the header has `number_taxa  number_trees`. In this case,  instead of `1 47`, one would need to write `47 1`. In addition, you need to constrain the root age with a calibration too as this is one of the requirements to run the program -- I guess you will get an error if you do not add it. In your example:

` [..]   'B(0.943,2.35)'))'B(1.2525,2.35)')'B(1.2525,2.35)')[ADD_ROOT_CALIBRATION];```

Hope this helps!
S.

bucek...@gmail.com

unread,
Oct 22, 2023, 9:10:45 AM10/22/23
to PAML discussion group
That's very useful, thanks! 
I'm constraining root age in the *.ctl file using the "RootAge =" parameter. I would indeed prefer (because of clarity) to add all calibration information to the tree file but I was not sure how to define a root age constraint in the tree file while I could find the syntax of root age constraint when written into the *.ctl file. My constraint is "younger than 412 MYA" which I write into the *.ctl file as '<4.12'. If written into the tree file, would it be simply '<4.12' or '0, 4.12'? I could not find much documentation on the syntax of the calibrations.
Cheers,
Ales

Sandra AC

unread,
Oct 22, 2023, 10:27:18 AM10/22/23
to PAML discussion group
Hi Ales,

All the info regarding `MCMCtree` settings (as well as about other PAML programs settings) can be found in the PAML documentation. We are slowly migrating information from the documentation into the PAML Wiki, but we have not yet had time to incorporate program settings yet -- the PAML documentation is thus the best point of reference for everything and anything you need to know about PAML programs!

In page 49  (at the time of writing, same applies to the other pages mentioned in this message), you have a section where all the details are given regarding how to specify fossil calibrations in `MCMCtree` format. For your analysis, it seems that you specified an upper-bound calibration using the format '<4.12' in the control file. To avoid possible errors about the calibrations (e.g., you change the time unit in the calibrations in the tree but forget to do that in the control file) and to easily automate your analyses in pipelines, it is best to avoid using the `RootAge` option in the control file and just write all the calibrations in the tree file. There are various formats that you can use to specify the calibrations in `MCMCtree` depending on the age restrictions you want to apply and how you want the calibration density to look like. Regarding the upper-bound calibrations, you have the following in page 50 in the PAML documentation:

Screenshot 2023-10-22 151015.png

In that way, you can use one of the following formats:

a) If you want to keep the right tail probability to the default value, pU=0.025, then you can use any of the two formats:

```
# Option a
[...] 'B(0.943,2.35)'))'B(1.2525,2.35)')'B(1.2525,2.35)')'U(4.12)';
# Option b
[...] 'B(0.943,2.35)'))'B(1.2525,2.35)')'B(1.2525,2.35)')'<4.12';
```

If you want to modify the tail probability, e.g., 0.01, then you need to use the option with the `U`, which stands for upper bound:

```
[...] 'B(0.943,2.35)'))'B(1.2525,2.35)')'B(1.2525,2.35)')'U(4.12,0.01)';
```

If you need to modify the tail probabilities for the soft-bound calibrations or other parameters required to define other calibrations, you can also take a look at the documentation as everything is thoroughly detailed. In case it might interest you or other users, Mario dos Reis implemented a feature in the `mcmc3r` R package that you can use to visualise the calibration densities you are to use in `MCMCtree` to constrain node ages. You can find more details in the main `README.md` file, although I also attach a screenshot below:

mcmc3r.png

If you install the R package and type `?mcmc3r::calibrations`, you will also find more details about the arguments of the functions :) 

Hope this helps!
Sandra
Message has been deleted

Jeffrey Sosa-Calvo

unread,
Jan 28, 2025, 3:56:02 PMJan 28
to PAML discussion group
Hi there,

I am having the same issue now. I am using PAML v4.10.7. I never had this issue before. I checked the headings of both the alignment and the tree and I make sure that there were in the right order. I have several calibration points, with priors estimated using MCMCtreeR. I would appreciate it if anyone can give me some advise on how to solve this issue. I am attaching my mcmctree.ctl file and tree (the alignment is too big to share here. If there is another way, I can add a link). The error written in the log file is: error: check #seqs and tree: perhaps too many '('?MCMCTREE in paml version 4.10.7, June 2023
Thanks again for the help!!
Jeff
mcmctree.ctl
Platy_50p_sym_MCMCinput_v2_rename.tre

Sandra AC

unread,
Jan 29, 2025, 9:12:48 AMJan 29
to PAML discussion group
Hi there,

Thanks for your message! As the error states, you have too many parentheses in your tree, which can sometimes happen depending on how you have assembled the tree topology in your input tree file (e.g., manual pruning or putting together different clades, etc.). The only (somewhat slow) solution I have found that helps resolve this issue is manually going through your Newick tree to try and find where in your tree topology you may have two pairs of parentheses that are used to identify the same clade, and thus one of them is redundant.

E.g.: the two Newick trees below would display the same tree topology in a graphical interfaces such as FigTree or TreeViewer without any warning or error.

```
((a, b), c);
((a, b), c));
```

Nevertheless, the format of the second tree has an additional pair of parentheses (those I have highlighted in bold and coloured in blue), which are redundant and not required. Whenever this "parenthesis duplication" occurs, MCMCtree will raise the issue "Error: check #seqs and tree: perhaps too many '('?", which is what seems to have happened with your tree topology. I have gone through your tree topology and found that there two instances when this issue happened:
  • The parentheses that were used to identify how the outgroup (I think it is the outgroup, sorry if not!) joins the main clade of taxa appears twice: (((Wasp_OTU_1,Wasp_OTU_2) ...  )'SN(2.062,0.07,0)'));
  • The parentheses that would identify the MRCA of Wasp_OTU_3 and Wasp_OTU_8:  (((Wasp_OTU_3,(((Wasp_OTU_4,Wasp_OTU_5),Wasp_OTU_6),(Wasp_OTU_7,(Wasp_OTU_8,Wasp_OTU_9))))'SN(1.45,0.11,0)'),...
I attach the control file with a dummy alignment and the updated tree after I removed the problematic parentheses shown above, please let us know if that works now with your dataset too! :) 

All the best,
Sandy
mcmctree.ctl
tree_fixedparentheses.tree
dummy_aln.txt
Reply all
Reply to author
Forward
0 new messages