Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
Calculating positive/negative selection (Read 3449 times)
davidtb
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 4
Calculating positive/negative selection
Dec 1st, 2009 at 4:17am
 
Hi,

I am very new at phylogenies analysis and using HyPhy; so, I apologise in advance for the naivety (and possible non-sense) of my questions.

I need to analise if some residues in a set of proteins are evolving under positive/negative selection. I aligned the cDNAs and generated the trees. As I have few sequences per alignment, I am using REL (dBdSRateAnalysis.bf). After that, I saw that I can select positively selected codons using dNdSResultProcessor.bf but I couldn't find any template to determine the negatively selected codons.

In addition, I am not sure of understanding correctly the output. Is Log[BF{NS/S>1|s}] the ln of the Bayes Factor? Is this number the same as P[NS/S>1|s]? Could I use P[NS/S<=1|s] to find the negatively selected codons?

Many thanks.

David  
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Calculating positive/negative selection
Reply #1 - Dec 1st, 2009 at 8:18am
 
Dear David,

Please take a look at Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login
Section 1.6.1 discusses the theory behind REL, and section 2.6.5 provides a "how-to" for running it.

To answer your specific questions:

1). Is Log[BF{NS/S>1|s}] the ln of the Bayes Factor?
Yes it is: the empirical Bayes Factor for positive selection at a site
2). Is this number the same as P[NS/S>1|s]?
The former (Bayes Factor) is the function of the latter (Posterior Probability) - the exact formula is on page 27 of the above reference.
3). Could I use P[NS/S<=1|s] to find the negatively selected codons?
Yes. You could also use the analog of the Bayes Factor (as in (1)).

Best,
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
 
davidtb
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 4
Re: Calculating positive/negative selection
Reply #2 - Dec 2nd, 2009 at 4:09am
 
Dear Sergei,

Thanks for your answer.

I continue on having problems with understanding the output (probably due to my lack of statistical expertise). I have used the flu example to do some tests. I observed that the Log[BF{NS/S>1|s}] value of the positively selected sites is the same as their P[NS/S>1|s]. As you said that the former is the natural logarithm of the Bayes Factor, whereas the other is the Posterior Probability (used to calculate the BF), shouldn't this values be different?

Sorry for the naivety of my questions.

Best,
David
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Calculating positive/negative selection
Reply #3 - Dec 2nd, 2009 at 6:10am
 
Dear David,

The values should be different. Unless there is a bug in the code (which is definitely possible), Log (BF) and P[NS/S>1] cannot be the same... Could you humor me by describing which analysis output reports Log (BF...) = P[NS/S...]? When you run dNdSResultProcessor.bf, which options did you select? I'd like to replicate your result and try to understand what is going on.

Sergei

PS If you run your alignment through REL on Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login, what happens there?
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
 
davidtb
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 4
Re: Calculating positive/negative selection
Reply #4 - Dec 2nd, 2009 at 7:40am
 
Dear Sergei,

I included all the options in the attached .bf file. I used the Flu alignment from your website and I inferred the tree using HyPhy.

This is a detail of the output when using "Positive Selection":
Codon      P[NS/S>1|s]      P[NS/S<=1|s]
1      0      2.51214
2      0      1.73459
3      1.57905      0
4      0      2.08207
5      0      1.71434
6      0      1.35117
7      0      1.35117
8      5.05474      0
9      0      1.85867

This is a detail of the output when using "Find Positively Selected Sites":
Counter      Site Index      Log[BF{NS/S>1|s}]
1      8      5.05474
2      10      4.40309
3      11      8.00546
4      12      4.29289
5      21      4.75764
6      69      7.70401
7      100      7.58658
8      102      7.84679
9      110      4.54851

When running the same dataset on datamonkey, I got slightly different results in terms of selected positions (I suppose that the options are not the same I used in HyPhy). Looking at the HTML report, I see that all posterior probabilities are <= 1 and that P{dN>dS}+P{dN<dS} = 1. Finally, Bayes Factors are different to posterior probabilities.

Many thanks for your help.

Cheers,
David
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Calculating positive/negative selection
Reply #5 - Dec 2nd, 2009 at 10:01am
 
Dear David,

The analysis incorrectly labels log(BF) columns with PS[NS>S|s], but it reports the log of BF. I'll fix the problem in the next code update. Thanks for pointing out the error.

Best,
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
 
davidtb
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 4
Re: Calculating positive/negative selection
Reply #6 - Dec 2nd, 2009 at 10:36am
 
Dear Sergei.

Then, can I assume that the other column (P[NS/S<=1|s]) is the ln(BF) of being negatively selected? Is this right or I am wrong?

All the best,
David

Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: Calculating positive/negative selection
Reply #7 - Dec 2nd, 2009 at 11:14am
 
Dear David,

You are correct - the other column is the Log (BF) for negative selection.

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