Rachel
YaBB Newbies
Offline
Feed your monkey!
Posts: 9
|
Hello Sergei,
I've formalized the list of inputs and outputs and I am hoping if you can tell me whether or not I am on the right track or if you can see any problems with my setup. In short, I want to determine if the species1 branch is evolving at an accelerated rate.
Below is a snip from a test batch file. The reference partition contains putatively neutral sequence, the element partition contains putatively functional noncoding sequence. I define the expected rate of evolution through calculating a constant of proportionality external to the data. S is a tree-wide scaling factor that accounts for varying levels of conservation and G is a variable that allows the species1 terminal branch to be longer under the alternative hypothesis.
/*Create the partitions*/ DataSetFilter ReferenceFilter = CreateFilter(myData, 1, "0-429, 1119-1718"); DataSetFilter ElementFilter = CreateFilter(myData, 1, "430-1118");
/*Create vector of observed frequencies*/ HarvestFrequencies(obsFreqsRef, ReferenceFilter,1,1,1); HarvestFrequencies(obsFreqsEle, ElementFilter, 1,1,1);
/*Define models and trees*/ HKY85RateMatrix = {{*,b,a,b}{b,*,b,a}{a,b,*,b}{b,a,b,*}};
Model HKY85Ref = (HKY85RateMatrix, obsFreqsRef); Tree myTreeRef = ((species1,species2),species3);
Model HKY85Ele = (HKY85RateMatrix, obsFreqsEle); Tree myTreeEle = ((species1,species2),species3);
LikelihoodFunction theLnLik = (ReferenceFilter, myTreeRef, ElementFilter, myTreeEle);
/* Initialize S, the tree-wide scaling factor*/ global S;
/*Set the constraints*/ myTreeEle.species1.a:=S*0.4*myTreeRef.species1.a; myTreeEle.species1.b:=S*0.35*myTreeRef.species1.b; myTreeEle.species2.a:=S*0.2*myTreeRef.species2.a; myTreeEle.species2.b:=S*0.23*myTreeRef.species2.b; myTreeEle.species3.a:=S*0.33*myTreeRef.species3.a; myTreeEle.species3.b:=S*0.35*myTreeRef.species3.b;
Optimize (paramValues, theLnLik); nullLnLik = paramValues[1][0];
/*Initialize G, the variable that allows the species1 terminal branch to be longer*/ global G; G:>1; myTreeEle.species1.a:=G*S*0.4*myTreeRef.species1.a; myTreeEle.species1.b:=G*S*0.35*myTreeRef.species1.b; myTreeEle.species2.a:=S*0.2*myTreeRef.species2.a; myTreeEle.species2.b:=S*0.23*myTreeRef.species2.b; myTreeEle.species3.a:=S*0.33*myTreeRef.species3.a; myTreeEle.species3.b:=S*0.35*myTreeRef.species3.b;
Optimize (paramValues, theLnLik);
lnlikDelta = 2(nullLnLik-paramValues[1][0]);
Many thanks.
Rachel
|