DRHomogeneousTreeLikelihood fails to set rootFreqs_ when constructor is called

6 views
Skip to first unread message

Jean-Baka Domelevo Entfellner

unread,
Jan 18, 2013, 7:00:23 AM1/18/13
to biopp-he...@googlegroups.com
Hi all!

In Bpp-phyl, I have an issue building and using a DRHomogeneousTreeLikelihood object, because after having created such a DRHTL object with some data and a suitable model of evolution, when I call the computeTreeLikelihood() method on this object, it segfaults in the computeSubTreeLikelihoodPrefix() step because of the absence of a proper rootFreqs_ vector. I can see it is still a zero-sized vector at that moment.

A DRHTL object being also an implementation of an AbstractHomogeneousTreeLikelihood object, it first calls the constructor of AHTL, but the line we need is never to be found in this constructor: it is

rootFreqs_ = model_->getFrequencies();

only found in AHTL::computeAllTransitionProbabilities() and in AHTL::applyParameters(), but none of these are called in the chain of operations triggered by the constructor of the DRHTL object...

Best,
   JB

P.S. The documentation says that the "full" DRHTL constructor (i.e. the one with a dataset corresponding to the leaves of the tree provided as an argument) also "computes the corresponding likelihood". It seems untrue because the constructor only goes through the init_(); and setData(data); steps. After these two steps minusLogLik_ is still -1, and you have to call DRHTL::computeTreeLikelihood() to get the likelihood value. 

JB

unread,
Jan 18, 2013, 8:06:31 AM1/18/13
to biopp-he...@googlegroups.com
okay, it seems that I missed a compulsory call to initialize() after the creation of the DRHTL object... My remark about the doc still holds, that's all, sorry for the noise again,
JB
Reply all
Reply to author
Forward
0 new messages