revbayes / revbayes.archive

GNU General Public License v3.0
68 stars 37 forks source link

Indexing to place branch lengths #90

Closed duchene closed 9 years ago

duchene commented 9 years ago

I would like to monitor the rate estimates for specific branches. One way to do this is to use the treeAssembly() function and monitor the tree with the rates as branch lengths. But it seems like treeAssembly() only takes topology objects from dnUniformTopology().

Another way to do this is to know the indexing method that RevBayes uses to place branch lengths from a given vector, and then I could write a function in R to use the monitored rates as branch lengths.

Any help with this would be greatly appreciated.

hoehna commented 9 years ago

I suggest to use some post-processing technique. RevBayes should always print the index of the nodes as a extended newick comment (e.g., [&index=3]). You could also monitor the rates (or anything else) as branch or node specific parameter using the "mnExtNewick" which is our extended newick monitor. That monitor will print the node or branch variables as newick comments directly into the tree.

Please let me know if there are any issues.

duchene commented 9 years ago

Hi Sebastian,

Thanks for your help, "mvExtNewick" works perfectly.

I am analysing simulated data with a known matrix of substitutions. Is there a way to fix the value of the Q matrix to make my runs faster? Functions that produce rateMatrix objects, like "fnGTR", only accept the output of distribution functions, like "dnDirichlet", but there must be a way to get around this and set an arbitrary value for Q.

Thanks a lot for helping me with these couple of issues.

Cheers,

David Duchene

On 5 January 2015 at 15:13, Sebastian Höhna notifications@github.com wrote:

Closed #90 https://github.com/revbayes/revbayes/issues/90.

— Reply to this email directly or view it on GitHub https://github.com/revbayes/revbayes/issues/90#event-214306000.

hoehna commented 9 years ago

Hi David,

I saw that you solved the problem yourself now. In general, it should be possible to use any stochastic variable also as a constant variable. Important is the assignment operator '<-' and the function to create the variable, such as simplex. It should be faster for your simulations, but maybe not by much. Actually, it is only faster if in the previous analyses you estimated the substitution rate parameters as well.

Let me know if you have any other questions.

Best, Sebastian

On Thu, Jan 8, 2015 at 5:22 PM, duchene notifications@github.com wrote:

Hi Sebastian,

Thanks for your help, "mvExtNewick" works perfectly.

I am analysing simulated data with a known matrix of substitutions. Is there a way to fix the value of the Q matrix to make my runs faster? Functions that produce rateMatrix objects, like "fnGTR", only accept the output of distribution functions, like "dnDirichlet", but there must be a way to get around this and set an arbitrary value for Q.

Thanks a lot for helping me with these couple of issues.

Cheers,

David Duchene

On 5 January 2015 at 15:13, Sebastian Höhna notifications@github.com wrote:

Closed #90 https://github.com/revbayes/revbayes/issues/90.

— Reply to this email directly or view it on GitHub https://github.com/revbayes/revbayes/issues/90#event-214306000.

— Reply to this email directly or view it on GitHub https://github.com/revbayes/revbayes/issues/90#issuecomment-69280072.