HyPhy message board
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl
HYPHY Package >> HyPhy feedback >> Getting dS and dN out of NielsenYang.bf
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl?num=1337133739

Message started by Dan Fulop on May 15th, 2012 at 7:02pm

Title: Getting dS and dN out of NielsenYang.bf
Post by Dan Fulop on May 15th, 2012 at 7:02pm
Hi HyPhy community,

I am trying to hack NielsenYang.bf to return certain parameters.  Specifically, I want to not only get out the dN/dS rate, but also the dN and dS separately.

I think specifying certain elements in distrInfo[][] will get me these two rates, but I don't know which numbers to put into each square bracket.

By the way, I am running NielsenYang.bf only with model 0, i.e. single rate.

Thanks in advance for your help!
Dan Fulop.

Title: Re: Getting dS and dN out of NielsenYang.bf
Post by Dan Fulop on May 16th, 2012 at 3:56pm
So, I was able to get several numbers out of res[][].  res[0][0] and res[0][2] seem like they're rates.  Are they dS1 and dS2?  And, for genes that only have evidence of a single dS only res[0][0] has a value different than zero?

Title: Re: Getting dS and dN out of NielsenYang.bf
Post by Sergei on May 17th, 2012 at 7:54am
Hi Dan,

NielsenYang is probably not the best solution in this case. dS and dN generally are not very well defined, but if you are looking at the measure of synonymous substitutions / synonymous site, and its non-synonymous analogue, try downloading and running Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login

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

Sergei

Title: Re: Getting dS and dN out of NielsenYang.bf
Post by Dan Fulop on May 26th, 2012 at 2:56pm
Hi Sergei,

In the end I got dS from a script that does essentially the same thing as dSdN.bf

I got the dN/dS single rate estimate for each gene with model M0 of NielsenYang.bf.  This estimate proved to be more conservative than that of the simpler method akin to dSdN.bf.  This is important because many of my alignments have very few substitutions and I thus get some genes with wildly high dN/dS estimates.  In the end I'm filtering out any gene with less than a given number of synonymous substitutions.

Finally, I calculated dN from the above two estimates.

Cheers,
Dan.

Title: Re: Getting dS and dN out of NielsenYang.bf
Post by Sergei on May 27th, 2012 at 12:41am
Hi Dan,

Just be cautious that dN/dS estimated directly (i.e. a model-based omega) is NOT the same as dN/dS estimated by computing classical definition of dN and dS and taking their ratio. Also, dSdN.bf is actually more complex that M0 -- it is the local (i.e. each branch of the tree has its own omega) model.

Take a look at section 1.4.3 of Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login for some more discussion.

Sergei

Title: Re: Getting dS and dN out of NielsenYang.bf
Post by Dan Fulop on Jun 4th, 2012 at 7:09am
Hi Sergei,

Thank you so much for the feedback.  I see, one is a distance method and the other a ML method.

So, I'll use the dN and dS estimates from the WrapDNDS.bf script (code copied below) and the dN/dS estimates from NielsenYang.bf .  I will make sure to mention that difference in these estimates.

Is there, though, a fully ML way to get single rate dN and dS?

Thanks,
Dan.


WrapDNDS.bf code:

LoadFunctionLibrary ("AnalyzeCodonData", dOptions2);
                              
LoadFunctionLibrary ("post_dNdS", {"00":"Display"});

GLOBAL_FPRINTF_REDIRECT      = "";

sum = 0;
synSubsAVL ["addValues"][""];
dS = sum;
sum = 0;
nsSubsAVL  ["addValues"][""];
dN = sum;

// Enter values in associative array
RatesRetVal["dS"] = dS;
RatesRetVal["dN"] = dN;



Title: Re: Getting dS and dN out of NielsenYang.bf
Post by Dan Fulop on Jun 4th, 2012 at 7:22am
By the way, the associative array of options that is input into WrapDNDS.bf is:


dOptions2 = {};
dOptions2["00"] = "Universal";
dOptions2["01"] = inputFilePath;
dOptions2["02"] = "MG94CUSTOMCF3X4";
dOptions2["03"] = "Global";
dOptions2["04"] = modelString;
dOptions2["05"] = PATH_TO_CURRENT_BF + "6sppTree.tre";
dOptions2["06"] = "Estimate";

Thanks,
Dan.

Title: Re: Getting dS and dN out of NielsenYang.bf
Post by Sergei on Jun 4th, 2012 at 9:58am
Hi Dan,

I don't think there is a full ML way to get a sense of what dN might be, because there is no clearly defined concept of what a 'non-synonymous site' is. The best reference for this is an old paper by Spencer Muse that has (unfortunately) been largely ignored by the field:

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

Sergei

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