Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
REV with different rate matrix for one branch (Read 2332 times)
Alan dQ
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 2
REV with different rate matrix for one branch
Mar 9th, 2010 at 6:48pm
 
Hello Sergei,

I'm analyzing a data set consisting of a bunch of mitochondrial sequences and a single paralogous nuclear-mitochondrial pseudogene.  I'd like to estimate branch lengths using a REV model in which all the mt branches have a common rate matrix and the pseudogene branch has a different matrix (with the rate parameter values all estimated from the data).  Is it possible to do this in HYPHY and, if so, how? 

The (or at least one) problem is that I don't know how to specify the REV global model in the batch file.  I've gotten it to estimate shared rate parameters but the tree produced was ultrametric.
Back to top
 
 
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: REV with different rate matrix for one branch
Reply #1 - Mar 9th, 2010 at 11:57pm
 
Hi Alan,

Alan dQ wrote on Mar 9th, 2010 at 6:48pm:
Hello Sergei,

I'm analyzing a data set consisting of a bunch of mitochondrial sequences and a single paralogous nuclear-mitochondrial pseudogene.  I'd like to estimate branch lengths using a REV model in which all the mt branches have a common rate matrix and the pseudogene branch has a different matrix (with the rate parameter values all estimated from the data).  Is it possible to do this in HYPHY and, if so, how?  



It is definitely possible. The logic is as follows:

1). Define TWO instances of the REV model with different sets of global rate parameters (in the code below simply copy and paste the model definition, and (for instance), append _paralog to all global variable names and in the rate matrix for the second model.

Code:
SetDialogPrompt("Select a nucleotide data file:");
DataSet myData  = ReadDataFile(PROMPT_FOR_FILE);
DataSetFilter myFilter = CreateFilter(myData,1);
HarvestFrequencies(obsFreqs,myFilter,1,1,1);

global AC = 1;
global AT = 1;
global CG = 1;
global CT = 1;
global GT = 1;

REVRateMatrix  = {{*,AC*t,t,AT*t}{AC*t,*,CG*t,CT*t}{t,CG*t,*,GT*t}{AT*t,CT*t,GT*t,*}};
Model REV = (REVRateMatrix, obsFreqs);

 



2). Apply the paralog model to specific branches in the tree as in the following

Code:
UseModel (REV); /* default model */

Tree myTree = ((mt1,mt2),mt3,paralog{REV_paralog});

 



The {model} notation will assign the specified model to the branch you single out. All other branches will be assigned the default model.

If you are interested in learning how to code in HBL, I would recommend the third chapter of Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login as a primer.

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
 
Alan dQ
YaBB Newbies
*
Offline


Feed your monkey!

Posts: 2
Re: REV with different rate matrix for one branch
Reply #2 - Mar 10th, 2010 at 12:26pm
 
Sergei,  Thanks very much for the quick reply.  That did exactly what I wanted it to do.
Back to top
 
 
IP Logged