HyPhy message board
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl
HYPHY Package >> Feature Additions >> more on dnds treees
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl?num=1132082013

Message started by Antonio on Nov 15th, 2005 at 11:13am

Title: more on dnds treees
Post by Antonio on Nov 15th, 2005 at 11:13am
Hello Sergei:

In your code in postdNdS you get syn substitutions per codon or per nucleotide site and similarly for non-syn. But, how can I get syn substitutions per syn-site and non-syn subs per non-syn site? is this possible? How? Is this information just present in the matrices synM  and nonsynM and can I use it in some easy way  ????.

Thank you very much  :D

,
antonio

Title: Re: more on dnds treees
Post by Sergei on Nov 16th, 2005 at 2:08am
Dear Antonio,

Give me a definition of synonymous and non-synonymous sites that you want computed, and I can show you how.

It is my personal view that the notion of synonymous and non-synonymous sites is ill defined (e.g. doesn't take into account the evolutionary history of the sample, fails to account for the fact that site classification depends on the context etc) :P

Cheers,
Sergei

Title: Re: more on dnds treees
Post by Antonio on Nov 16th, 2005 at 6:30am
Dear Sergei:
We just want to compute the standard dN/dS (omega - sensu Nei or Yang) to make inferences about selection. żDo you recommend a different version of
this statistic? What is exactly then the dN/dS reported in DataMonkey?
,
Antonio

Title: Re: more on dnds treees
Post by Sergei on Nov 16th, 2005 at 6:52am
Dear Antonio,

Datamonkey reports one of the two things:

1). For SLAC: dN and dS (and their ratio) computed relative to the neutral expectation. This is done by reconstructing the evolutionary history of the sample (using an ML method)

2). For FEL and REL it effectively reports the omega (in Nielsen Yang terms) value, i.e. the ratio of non-synonymous to synonymous substitution rates.

For likelihood models, in my opinion, one should use the dN/dS rate ratio to estimate selective pressure. Codon models already report either a global dN/dS (if there is not site-to-site variation), or site-by-site values.

If I recall, the Nei-Gojobori distance measure is only properly defined for two sequences anyway. Take a peek at an old paper by Spencer Muse about some of the issues involved with the classic dN and dS estimators: Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login. Also, take a look at Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login.

Effectively, you can now estimate E[syn subs] and E[non-syn subs] PER CODON, but you want to normalize it by the expected substitution counts if your sequences were evolving neutrally (thus the synonymous and non-synonymous sites), i.e. all substitutions out of a codon were equiprobable. There are many ways do this (some are worse than others), but I am not sure which one you had in mind :)  

Cheers,
Sergei

Title: Re: more on dnds treees
Post by Antonio on Nov 16th, 2005 at 9:40am
dear Sergei:

Thank you very much for the references. Yes you are right I want in some way normalize E[syn subs] and E[nonsyn subs] in order to, for example, be able of graphically represent an average non-syn subs per site curve along time. And now I am wondering if this could be done using the E[subs] i.e. the expected substitutions using both syn and non-syn sites as is computed by Hyphy?. Make this any sense? or maybe I am (once again) absolutely lost? :-[

Thus, my question should be, how can I get the E[non-syn subs] by branch normalized by E[tot subs] by branch?.

,
Thank you very much Sergei for all this,
:)
Antonio

Title: Re: more on dnds treees
Post by dposada on Dec 1st, 2005 at 9:56am
Hi Sergei and Simon,

To normalize E[syn subs] and E[nonsyn subs] we could use BL estimates under a pure HKY. But you seem to suggest there might be better options in HYPHY?

All the best,

D.

Title: Re: more on dnds treees
Post by Sergei on Dec 1st, 2005 at 1:19pm
Dear David,


wrote on Dec 1st, 2005 at 9:56am:
To normalize E[syn subs] and E[nonsyn subs] we could use BL estimates under a pure HKY. But you seem to suggest there might be better options in HYPHY?



We could indeed; this would make estimates directly comparable among trees. Alternatively, one can fit a forced neutral model (e.g. MG with dN=dS=1) and the normalize the substitutions relative to the 'neutral case'. The latter case seems cleaner. Let me know if you or Antonio need help with the implementation.

Cheers,
Sergei

Title: Re: more on dnds treees
Post by David Posada on Dec 1st, 2005 at 11:40pm
Sergei,

Right, we talked about constraining omega=1, but we were not sure of how to force it really. If you give us a hint that will make things easier for us. Indeed, many thanks for your fantastic efforts helping users!!!

Best,


D.

Title: Re: more on dnds treees
Post by Sergei on Jan 4th, 2006 at 10:17pm
Dear Antonio (and David),

I have finally added a simple computation of dS and dN trees (following the Muse paper) to a post processor (syn and non-syn trees). This should do the trick for most cases (constraining dN=dS might be a bit too fasitdious). The file can be downloaded from here (it should be dropped inside TemplateBatchFiles): Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login

Cheers,
Sergei


Title: Re: more on dnds treees
Post by Antonio on Jan 17th, 2006 at 3:07am
Dear Sergei I still have a couple of questions regarding the computation of dN and dS trees in hyphy. If I compute the Branch Lenghts of a topology using a codon MG94REV model with dNdSRates analysis script and afterwards use the following batch file:

Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login

to get dN and dS trees and compute the mean path to the tree root from the distinct serial times, I get always dS values greater than dN ones (dS>dN) however if use
Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login
choosing  the appropriate .fit file written out by the dNdSRates analysis and do the same computation as above I get always the opposite pattern dN > dS. This happens with all patients though I know by other method (whcih is not based on BLenghts  from a topology) that the patients have some of them dN>dS and others the opposite. What is suspicious to me is the switch of the patterns between the hyphy methods. Am I missing something?  Could be a problem with the methods? any idea?.

Thank you verymuch in advance,

Antonio

Title: Re: more on dnds treees
Post by Sergei on Jan 17th, 2006 at 9:02am
Dear Antonio,

The post_sns.bf file does not handle models with site-to-site rate variation correctly. It's easy enough to fix, I am not quite sure why I didn't do it previously. I'll post a note when the updated version is ready.

Also the Print Trees file does not report dS and dN trees, only expected synonymous subs and expected non-synonymous subs per codon site (not per hypothetical syn. or non-syn. position).

Cheers,
Sergei

Title: Re: more on dnds treees
Post by Sergei on Jan 23rd, 2006 at 11:15am
Dear Antonio,

post_sns.bf does actually handle models with rate variation (disregard my previous comment).

I modified the Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login file to spool out a .csv files with E[s.subs/codon], E[ns.suns/codon], dS and dN stratified by branch. Let me know if this makes better sense now.

Cheers,
Sergei

Title: Re: more on dnds treees
Post by scottdoniger on Apr 26th, 2007 at 2:41pm
Hello again - What is the difference between nsClass1 and dN/dS? I thought they were the same, but they don't seem to be.

If I print out nsClass1 I get 0.0721754.

Using the dNdS batch file you mentioned in the previous message, for branch 1
I got dN of 0.000539828 and dS or 0.00798629, which gives a dN/dS of  0.06759434.

Is this a result of ncClass using the rates from the matrix, and dN and dS being in units of substitution/site? If so, which one do I report as dN/dS? Also, the testbranchdNdS.bf file outputs the nsClass1 value and I had been treating this as dN/dS, but I guess that isn't correct?

thanks,
Scott

Title: Re: more on dnds treees
Post by Sergei on Apr 26th, 2007 at 8:00pm
Dear Scott,

Use the nsRate for dN/dS. Taking the ratio of dN and dS reported from the sequence is an approximation (since we must approximate the numbers of syn and non-syn sites). Codon models directly take care of syn and non-syn mutability of codons, uncertain ancestral states etc.

Cheers,
Sergei


Title: Re: more on dnds treees
Post by scottdoniger on Apr 26th, 2007 at 8:48pm
Thanks for your help. I probably should have read the Muse MBE paper before asking the question...

HYPHY is great! You guys have done an amazing job with this software. I'm now using it for about 10 different analyses, all of which would be impossible without it.

Scott

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