Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
Getting dS and dN out of NielsenYang.bf (Read 4314 times)
Dan Fulop
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 29
Getting dS and dN out of NielsenYang.bf
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.
Back to top
 
 
IP Logged
 
Dan Fulop
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 29
Re: Getting dS and dN out of NielsenYang.bf
Reply #1 - 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?
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Getting dS and dN out of NielsenYang.bf
Reply #2 - 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
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
Dan Fulop
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 29
Re: Getting dS and dN out of NielsenYang.bf
Reply #3 - 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.
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Getting dS and dN out of NielsenYang.bf
Reply #4 - 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
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
Dan Fulop
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 29
Re: Getting dS and dN out of NielsenYang.bf
Reply #5 - 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;


Back to top
 
 
IP Logged
 
Dan Fulop
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 29
Re: Getting dS and dN out of NielsenYang.bf
Reply #6 - 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.
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Getting dS and dN out of NielsenYang.bf
Reply #7 - 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
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged