.newick branch length issue.

280 views
Skip to first unread message

George Munday

unread,
Mar 25, 2015, 12:49:57 PM3/25/15
to bioge...@googlegroups.com
Hi,

I'm currently using BGB for a University project.
Having compiled the relevant .newick file from the 'Strap' R package 
I keep receiving the following error when running the BGB 'check' command,

Error in check_BioGeoBEARS_run(BioGeoBEARS_run_object) : 
FATAL ERROR in check_BioGeoBEARS_run(): the output tree has branchlengths <= 0:
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
This can sometimes happen in e.g. MCC (majority clade consensus) trees output by BEAST's TreeAnnotator.
You must fix the Newick file. See ?check_BioGeoBEARS_run for comments.

I understand the reason for the error, however as far as I'm concerned $edge.length are associated with the tree.

I've attached the tree file (CrocsFinalAge666.phy) as well as the time data and original time independent tree (crocfin.phy & CROCOAGESxoxo.txt).

Hope someone can help - Its probably a very amateur oversight!

Thanks
George
CrocsFinalAge666.phy
crocfin.phy
CROCOAGESxoxo.txt

Nick Matzke

unread,
Mar 25, 2015, 2:14:44 PM3/25/15
to bioge...@googlegroups.com
Hi -- it looks like you must have used this as the input tree:

CrocsFinalAge666.phy, which has many 0-length branches

...when you probably meant to use this:

crocfin.phy

...which I think has no 0-length branches.  

(Or perhaps the filenames were mixed up.)

PS: It looks like you are time-scaling a parsimony tree with fossils in it.  You might be interested in Bayesian tip-dating with BEASTmasteR: http://phylo.wikidot.com/beastmaster

Cheers!
Nick


--
You received this message because you are subscribed to the Google Groups "BioGeoBEARS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeobears...@googlegroups.com.
To post to this group, send email to bioge...@googlegroups.com.
Visit this group at http://groups.google.com/group/biogeobears.
To view this discussion on the web visit https://groups.google.com/d/msgid/biogeobears/025f4b44-d4fd-4307-bf59-617c20017f75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

George Munday

unread,
Mar 25, 2015, 2:20:43 PM3/25/15
to bioge...@googlegroups.com, mat...@nimbios.org
Thanks Nick!

I can run the undated crocfin.phy which hasn't been passed through 'strap',
but our adviser seemed to think it was necessary to set the branch lengths using strap first, hence the creation of the CrocsFinalAge666.phy with 0 length branches.

By the sounds of it we've got a bit confused with the necessary input to BGB, I'll have a crack with BEAST

Cheers
George

Nick Matzke

unread,
Mar 25, 2015, 2:28:40 PM3/25/15
to bioge...@googlegroups.com
Yeah -- technically you should have:

1. a time-scaled tree (with or without fossils in the tree)

2. with no branch lengths of 0 or <0

(actually, if you have a branch length >0 but < 0.000001 or something, this gets treated as a "direct ancestor" -- see:

Fossil Data In Biogeographical Analysis In BioGeoBEARS

Cheers!
Nick


George Munday

unread,
Mar 29, 2015, 8:00:55 AM3/29/15
to bioge...@googlegroups.com, mat...@nimbios.org
Fantastic! - We've got some results using the script unstratified, Thanks for all your help with that....

But now I'm trying the stratified and I get this return;

> BioGeoBEARS_run_object = section_the_tree(inputs=BioGeoBEARS_run_object, make_master_table=TRUE, plot_pieces=FALSE,cut_fossils=FALSE,fossils_older_than = 250)

1- top: 0, bot: 34, rel_bot: 34
2- top: 34, bot: 32, rel_bot: -2

Error in if (nodes_to_chainsaw[i] <= numtips) { : missing value where TRUE/FALSE needed

>BioGeoBEARS_run_object$master_table
NULL

So as you suggested in a previous answer I ran check_BioGeoBEARS_run(BioGeoBEARS_run_object)
and it returned,

FATAL ERROR: You have time slices, but you do not have 'inputs$tree_sections_list'.
Run 'section_the_tree()' to add tree sections to your input BioGeoBEARS_run_object.

I've uncommented section_the_tree() so I'm mythed as to why I'm getting the error.... does nodes_to_chainsaw[i] correspond with an error in the 'i' column in the dispersal matrix?

Hope you can help (again)
George

Nick Matzke

unread,
Mar 29, 2015, 7:52:13 PM3/29/15
to bioge...@googlegroups.com
Hi, this error is occurring specifically in section_the_tree(), which basically takes the input phylogeny and chops it up into a bunch of pieces, as determined by where the stratum time boundaries cross the tree.  So this has to work before any further time-stratified analysis steps in BioGeoBEARS.

It is peculiar that you have the setting "fossils_older_than = 250" -- normally fossils_older_than is 0.6 or something.  This is intended to distinguish between (1) actual fossil tips in the tree and (2) tips that have an "age" slightly older than 0 mya, just because of minor issues in building the time-scaled tree (these issues sometimes cause some of the tips living in the present to be not quite equal-aged).  If you set it to 250 mya, many of your actual fossil tips will be called non-fossils, and this will lead to various catastrophes in section_the_tree(), since section_the_tree() will think your fossil tips are living in the present and the tree accordingly.

(Re: nodes_to_chainsaw[i] -- "chainsaw" is the internal function that cuts the tree flat across a timepoint, nodes_to_chainsaw are the nodes above branches that will be cut, if a nodes_to_chainsaw[i] is not found due to e.g. the issue above, that could cause this error)

So, change that setting back to 0.6 or something similar, and if you still get similar crashes during section_the_tree() then probably the problem is with your input tree... note again that the tree has to be time-scaled, no 0 length branches, no polytomies, etc....

Cheers!
Nick




--
You received this message because you are subscribed to the Google Groups "BioGeoBEARS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeobears...@googlegroups.com.
To post to this group, send email to bioge...@googlegroups.com.
Visit this group at http://groups.google.com/group/biogeobears.
Reply all
Reply to author
Forward
0 new messages