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
[BUG] dnConstrainedTopology doesn't work with dnCDBDP/dnGLHBDSP #375
Comments
Working on trying to solve it now, it seems like in the current revbayes dev branch I'm not getting a segfault with |
Tracked problem down to line 126 of |
Thanks for looking into this @brpetrucci! Let me know if you need anything else from me. |
No worries!! Solved the problem I mentioned above--it seems like the |
Gonna keep using this as a diary I guess, maybe someone has an epiphany I don't eventually. Tracked down the call to I tried running just an FBD skyline model with constraints and it seems like the dynamic casting/= operator work fine, so I guess the problem when we try to make a |
Set up a branch (dev_const_top_bug) to work on this. The only change right now is the fix to how GLHBDSP is calculating taxa ages during simulations (@mikeryanmay tagging you here so you can confirm this wasn't a mistake), which solved one problem. I'm currently not sure how to solve the segfault (i.e. how to get the GLHBDSP distribution to inherit something that can be cast as an |
@brpetrucci Thanks for looking into this. I made a debug build using Then I used gdb to find the exception that was thrown. I usually use
Finding the relevant exception is challenging because
I finally found the exception we were looking for, and it was here:
It turns out that The code for Tree::getNumberOfInteriorNodes() does:
It turns out that getNumberOfNodes() == getNumberOfTips() == 1. Since the tree is rooted, this ends up returning If we change this to the following, then the crash doesn't happen.
Then we get a different error message:
|
Thanks @bredelings for looking into this. I implemented the changes that you and @brpetrucci made on my forked branch, rebuilt rb, and I'm now running into a similar error (this is when using
When I use only the clade28 constraint (line 102), I get the exact same error as @bredelings. I've double checked and both Argochampsa_krebsi and Gavialis_bengawanicus are in the taxon list, habitat character matrix, and the constraints file with the exact same names. Further, when I switch to
|
I've played around with various random clade constraints and it just seems to complain about whichever taxon I give it (even if the clade constraint is a single taxon that is confirmed to be in the taxon list). |
Let me know if you need any other information from me @bredelings @brpetrucci. |
Hi @willgearty. The segmentation fault is fixed on the Can you (or @brpetrucci) compile revbayes from the latest version of the development branch and provide a script that demonstrates the problem? Currently I'm having to guess what to uncomment. |
Hi @bredelings, thanks for getting back to me. I just pulled the revbayes/development branch, then added the changes suggested in this issue, and I'm still hitting a segmentation fault using You should be able to replicate the issue with this set of files: crocodylia_bisse.zip. Note that the tensorPhylo plugin location will need to be changed on line 2. If you comment line 105 and uncomment line 106, you should get the same error from our comments above using |
Hmm... it looks like you forgot to include |
I just realized I didn't put the files within the correct folders, I've updated the zip folder with the correct folder system here: |
Thanks! It looks like the problem occurs here: revbayes/src/core/distributions/phylogenetics/tree/TopologyConstrainedTreeDistribution.cpp Line 709 in 3ad7874
The problem is that Two things should probably be fixed:
Probably you should contact @mikeryanmay about fixing the first one of these. |
Thanks @bredelings, hopefully @mikeryanmay will be able to help with that. And do any of you have any insight into the error with |
I think they actually don't exist at first. No taxa are given to fbd_dist = dnGLHBDSP(rootAge = root_age,
lambda = lambda,
mu = mu,
eta = Q,
pi = pi,
phi = phi,
taxa = taxa,
rho = rho,
nStates = num_states)
The taxa only get added here:
So, I think that is actually correct for a version of the script where the |
I'm confused, there is indeed |
Oh, right, its that no taxa are given to
|
Oh, yes, you're right, thanks for pointing that out! |
Wait, |
@bredelings or @brpetrucci any ideas? |
I'm not sure. You might try asking on the revbayes-users mailing list. You could also open a new issue about the dnCDCladoBDP not having any taxa parameter. My guess is that dnCDCladoBDP has previously only been used in situations where the tree is clamped, and in those cases the taxa can come from the observed phylogeny. For example:
But I have never used it myself. |
Describe the bug
I'm currently trying to run an FBD BiSSE analysis using
dnCDBDP
/dnGLHBDSP
. I'm following a combination of this BiSSE tutorial and this FBD tutorial. I've been able to run an FBD analysis with all of the clade constraints I want (based on an existing unresolved supertree), although I had to implement a few source code hacks (willgearty@3724075) that I found in various github issues related to having lots of constraints (thanks @bredelings and @wrightaprilm). Now I'm trying to convert my FBD analysis into a BiSSE analysis, but I always run into an issue when I try to enforce the constraints (usingdnConstrainedTopology
). I've tried this without success with bothdnCDBDP
(which results in the errorcannot create std::vector larger than max_size()
) anddnGLHBDSP
(results in a segmentation fault). I initially was running this with an entire set of 109 constraints, but even just a single constraint causes the same errors. I thought it might be justconstraints
, but I've also tried just supplying aninitialTree
todnConstrainedTopology
and that also causes the same issues.To Reproduce
The analysis can be reproduced using the files in this zip folder: croc_files.zip. Note that the analysis can be swapped from
dnCDBDP
todnGLHBDSP
by changing which lines are commented. I've also included a tree and commented code for supplying aninitialTree
instead ofconstraints
.Expected behavior
The tree distribution should be constrained and the analysis should continue.
Computer info
I'm using a slightly modified version of the current development branch (willgearty@3724075) on Ubuntu (via WSL2).
The text was updated successfully, but these errors were encountered: