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
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