nonohomogenous one_per_branch setting - how to alias based on branch ID?

31 views
Skip to first unread message

Keren Halabi

unread,
Oct 15, 2018, 11:02:04 AM10/15/18
to Bio++ Usage Help Forum
Dear Bio++ team,

I wish to create a branch-site model with two branch model, denoted FG and BG, where each is a mixture model over 3 omega categories.

I wish to restrict all the parameters except for the omegas to be the same in both branch models.

I wish to allow all the transitions between omega categories along the branches of the tree (see the random effects category in my documentation here).

For this purpose, I can set my model as nonhomogenous, with the setting "one_per_branch". This would result in a different model instance for each branch, thus allowing all the possible omega categories assignments along the tree. Now, I need to:

Alias all the parameters except the omega values across all the induced models (that is, a model fro each branch).
Alias the omega values across a subset of branches IDs that belong to the BG.
Alias the omega values across a subset of branches IDs that belong to the FG.

Could you please guide me how to do so?

Many thanks!
Keren


Laurent Guéguen

unread,
Oct 17, 2018, 1:07:10 AM10/17/18
to Bio++ Usage Help Forum
Dear Keren,

for a parameter to be shared among all branches, the option is :

nonhomogeneous_one_per_branch.shared_parameters= YN98.123_Full.theta, YN98.kappa, ...


If you want to share the parameter among a set of branches, you need to alias 
the branch specific parameters individually.

For example:

nonhomogeneous.alias = YN98.123_Full.theta_2->YN98.123_Full.theta_1, YN98.123_Full.theta_3->YN98.123_Full.theta_1, ...

where _1 means branch with ID 1.

 
This may be long if you have many branches. Usually I use a script to fill the line, but it would be
very easy to change the general option in such way:


nonhomogeneous_one_per_branch.shared_parameters= YN98.123_Full.theta_[1,2,3,4], YN98.kappa_[3,4,2,9], ...

where sets of branch IDs are defined explicitely.

I can do it quickly, no problem.

Cheers,
Laurent


Keren Halabi

unread,
Oct 17, 2018, 2:05:27 AM10/17/18
to Bio++ Usage Help Forum
Thank you, Laurent!

Since I wish to alias the same parameters over two different subsets of branches with different initial values, I have implemented an alternative version of the function SubstitutionModelSetTools::createNonHomogeneousModelSet that receives as argument two vectors of the subsets to alias over and a list of parameter names that should be aliased over each subset separately. This version allows different initialization of these parameters over the two subsets as well.

This implementations quite specific to my needs, so I would be happy to adjust this code according to the users requirements, if available and needed.

Please let me know if I should do so, and if so, I will update the implementation and pull request for your review.

Cheers,
Keren 

Laurent Guéguen

unread,
Oct 17, 2018, 4:19:11 PM10/17/18
to Bio++ Usage Help Forum
Dear Keren,

meantime, also I have implemented the option as I said, and it is on the github. 
Actually it is more general than yours, since any sets of nodes can be aliased, and not only two.

Both are in devel branches of bpp-phyl and bppsuite.

Also, I have seen all your pull requests, I will look at it when I have time.

Cheers,
Laurent

Keren Halabi

unread,
Nov 1, 2018, 5:36:16 AM11/1/18
to Bio++ Usage Help Forum
Many thanks, Laurent!

Could you please address me to the specific branch / commit in which I can find the added feature?

As for the pull requests, as per Juliens guidance, I shall pull request to each feature separately into the devel branch. I have more features to pull request, but I do not wish to overload you. Please let me know if you have any preference to a policy of pull requests, and I will adjust.

Cheers,
Keren

Laurent Guéguen

unread,
Nov 5, 2018, 10:42:34 AM11/5/18
to Bio++ Usage Help Forum
Dear Keren,

all new developments related to the classic likelihood computation are on the devel branch. If you pull it, you should not
have to many conflicts.

Cheers,
Laurent

Reply all
Reply to author
Forward
0 new messages