HyPhy message board
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl
Methodology Questions >> How to >> Generate synrate or nonsynrate tree
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl?num=1101838973

Message started by Jeff Mower on Nov 30th, 2004 at 10:22am

Title: Generate synrate or nonsynrate tree
Post by Jeff Mower on Nov 30th, 2004 at 10:22am
After codon based ML analyses, hyphy reports a total branch length tree in parenthetical tree format.  Is there any way to take the estimated synrates or nonsynrates and report them in the same tree format?

Thanks for your help.

Jeff

Title: Re: Generate synrate or nonsynrate tree
Post by Sergei on Dec 1st, 2004 at 2:15am
Dear Jeff,

Presuming you have used a model which fits different syn and non-syn rates (local models), you can use the tree viewer to scale the tree on syn rates or non-syn rates and write it out a Newick string.

Open Object Inspector (Window Menu), display the list of trees in memory (the ones involved in likelihood functions will be in bold), double click on the one you want to display. Once the tree viewer has opened, you can an appropriate 'Branch Scaling' and then invoke 'File->Save'.

Note that this will scale the tree on rates, NOT on expected syn subs or non-syn subs. The latter can also be done, but differently.

HTH,
Sergei

Title: Re: Generate synrate or nonsynrate tree
Post by Leslie Turner on Dec 20th, 2004 at 11:59am
Dear Sergei:

I'd like to produce a tree scaled by expected number of synonymous substitutions, how would I do that?

I also noticed that if I scale by syn rate (or exp subst or nonsyn rate) then hit the button again the branch lengths sometimes change substantially- are the rates re-estimated each time?

Thanks a lot!
Leslie

Title: Re: Generate synrate or nonsynrate tree
Post by Sergei on Dec 20th, 2004 at 6:29pm
Dear Leslie,

"I'd like to produce a tree scaled by expected number of synonymous substitutions, how would I do that?"

Due to the way HyPhy is written, the program has no intrinsic knowledge of how to differentiate synonymous and non-synonymous substitutions.

In short, there is no uniform way (unfortunately) to do this. However, I wrote a few files, which can be downloaded from Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login and (after the archive is unzipped) should be placed in 'TemplateBatchFiles' (replacing existing ones when prompted) inside the HyPhy directory (or you can just download a HyPhy build from Dec 20th 2004 onwards). These files enable the user to draw trees scaled on expected Syn (and Non-Syn) substitutions per nucleotide site (the sum of these two quantities is the branch length measured in total expected substitutions). One must however, use the standard analysis AnalyzeCodonData to fit the codon model. When the fit has finished, one should be able to select menu options 'Analysis->Results->Syn and non-syn trees' and the program will output and draw the trees scaled on expected synonymous and non-synonymous substitutions. At present the files also assume that the model has no site-to-site rate heterogenity.

I have a good idea about how to enable plotting syn and non-syn trees in general, but it requires a bit more work - I should have time after the holidays to put this in - seeing how the feature would be generally useful.

In the meantime, I hope the stopgap solution I propose above is useful.
 
"I also noticed that if I scale by syn rate (or exp subst or nonsyn rate) then hit the button again the branch lengths sometimes change substantially- are the rates re-estimated each time?"

No - the scaling changes, i.e. the tree is plotted using the quantity you selected from the drop-down menu. In general E[Subs] = C1 * synRate + C2 * nonSynRate, where C1 and C2 are some constants which depend on the data (genetic code and base composition).

HTH,
Sergei

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