HyPhy message board
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl
HYPHY Package >> HyPhy feedback >> branch specific estimates of dN/ds
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl?num=1299869696

Message started by Steve J on Mar 11th, 2011 at 10:54am

Title: branch specific estimates of dN/ds
Post by Steve J on Mar 11th, 2011 at 10:54am
Just wondering if anyone can provide some guidance on perhaps using testBranchDNDS.bf to assign estimates for dN/dS for more than two branch sets.  I don't see that you can assign more than two.  I am looking at dN/ds ratios for transposable elements occurring in sexual and asexual organisms.  I would like to test whether this parameter differs in asexual and sexual external branches.  I have attached a paper where I previously estimated one ratio to four ratio models using PAML.  I would much rather use HyPhy!  thanks for any help

Steve J
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl?action=downloadfile;file=finalevolution2007.pdf (151 KB | )

Title: Re: branch specific estimates of dN/ds
Post by Sergei on Mar 11th, 2011 at 11:26am
Hi Steve,

For this you are probably better off using the GUI. Take a look at Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login Download both archives and look at LocalModels.pdf in the PDF folder. There is an example there on how to do a 3-ratio test. The idea is to start with a local model and then use ReplicateConstraint on the branches that you want (or just define them one at a time) to constrain sets of branches to have the same dN/dS. I presume you've already looked at Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login for a general primer on using the GUI?

Sergei

Title: Re: branch specific estimates of dN/ds
Post by Steve J on Mar 11th, 2011 at 11:29am
Sergei
 Yes I have even done the replicateConstraint exercise in the manual.  Thanks

Title: Re: branch specific estimates of dN/ds
Post by Steve J on Mar 11th, 2011 at 12:22pm
with my trees, the asexual and sexual external branches are somewhat scattered without strong clumping. Rather than using text language used in your example, can you assign branches manually say in the constraint boxes.  I couldn't see anyway to do that. Or can you assign on the trees where you can see the nodes and branches

Title: Re: branch specific estimates of dN/ds
Post by Sergei on Mar 11th, 2011 at 1:56pm
Hi Steve,

Yep, you can constrain branches one at a time. Take a peek at Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login

Basically you want to set nonSynRate proportional to synRate along one of the lineages (with the appropriate ratio, there is an option in the proportionality button), and then reuse the same ratio for all branches in the same class.

Hope this makes sense. You can save and reuse the likelihood function and constraints after you've defined them once (I hope this is described in one of the book chapters)...

Sergei

Title: Re: branch specific estimates of dN/ds
Post by Steve J on Mar 17th, 2011 at 11:50am
Sergei
finally back at this.  Okay my previous approach was to develop a one ratio model, which I assume is what you refer to as a global model.  When I fit this, you only get synonymous rates in likelihood parameter table.  Is this what I call the one-ratio model with all branches having the same dN/dS ratio?
Second, you can only constrain two parameters at a time when using the constrain 2 parameters button and then you have to specify the constant of proportionality - so when I use a value of 1 it equalizes the dN and ds for a particular external haplotype.  I'm not really sure what constant I should be using.  
third, let's say I want to test the one-ratio model with a two-ratio model of dN/ds ratio for internal and external branches.  Would I run the global model, save as the null model, and then select all external branches in the tree and set a value to 1 by using the constrain parameters to be equal button?  Thanks and sorry for all the questions.

Title: Re: branch specific estimates of dN/ds
Post by Sergei on Mar 17th, 2011 at 12:23pm
Hi Steve,

To answer your questions

1). Global is equivalent to 'one-ratio'
2). If you start by defining the local model (where each branch will have it's own synRate and nonSynRate), you would use the 'Constrain 2 parameters to be proportional' button and then select the appropriate option from the pull down (see attached). You would define one omega per group of branches and (i.e. define a new ratio for the first branch in a group and then reuse it for other branches in a group).
3). Once you've defined this model (multi-ratio), save it as the alternative model, and then test restrictions (i.e. setting all omegas equal to one another) as nulls.

HTH,
Sergei
Untitled.png (281 KB | )

Title: Re: branch specific estimates of dN/ds
Post by Steve J on Mar 17th, 2011 at 1:06pm
Thanks Sergei. When defining an omega for say external branches do you enter an arbitrary value say 1?

Title: Re: branch specific estimates of dN/ds
Post by Sergei on Mar 17th, 2011 at 1:07pm
Hi Steve,


Steve J wrote on Mar 17th, 2011 at 1:06pm:
Thanks Sergei. When defining an omega for say external branches do you enter an arbitrary value say 1?


Enter the variable name that you want to use, e.g. omega1 or omega_External or whatever you'd like. Its value will be set to 1 automatically, and later optimized...

Sergei

Title: Re: branch specific estimates of dN/ds
Post by Steve J on Mar 17th, 2011 at 1:09pm
Thanks. I get it now. I'm a little slow!

Title: Re: branch specific estimates of dN/ds
Post by Steve J on Mar 18th, 2011 at 9:08am
Hey Sergei,
 So  I was able to set up the two ratio model with external and internal branches.  I optimized this and saved it as the alternative.  I then went back into the parameter table to set up a one ratio model as the null model.  the first time I didn't clear the constraints, and when I selected the first pair to constrain the parameters, it gave me an error message "Bad Binary Placement Operator" when I used global as the parameter name.  I then cleared the constraints, and when I entered another name like equal I didn't get the error message but no text showed up in the constraints box.

Title: Re: branch specific estimates of dN/ds
Post by Sergei on Mar 24th, 2011 at 1:10pm
Hi Steve,

Your experience revealed that HyPhy was allowing users to enter invalid variable names in some prompt boxes and then did not report the error in a meaningful way. I modified the behavior to automatically check that the name is a valid one, and only allow the OK button to be clicked if that's the case. E.g. if you enter 'global' now, it will be highlighted in red, and you won't be able to click 'OK'. The next code push (probably in a few days) will have this feature.

Sorry for your troubles, and thanks for providing me with valuable user feedback.

Sergei

Title: Re: branch specific estimates of dN/ds
Post by Steve J on Mar 24th, 2011 at 1:29pm
I really appreciate all your help. Great program

HyPhy message board » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2024. All Rights Reserved.