scottdoniger
YaBB Newbies
Offline
I love YaBB 1G - SP1!
Posts: 7
|
Hi there - I'm trying to read in nucleotide frequencies from a file (I want to specifically set these for the file, rather than using HarvestFreqs). So I have a file with 4 frequencies, e.g.,
.001 .498 .001 .498
then in the batch file I have: fscanf(stdin, "Number", F1); fscanf(stdin, "Number", F2); fscanf(stdin, "Number", F3); fscanf(stdin, "Number", F4); partition3_Freqs = {4,1}; partition3_Freqs[0][0]:= F1; partition3_Freqs[1][0]:= F2; partition3_Freqs[2][0]:= F3; partition3_Freqs[3][0]:= F4;
fprintf(stdout, "A = ",partition3_Freqs[0][0],"\n"); fprintf(stdout, "C = ",partition3_Freqs[1][0],"\n"); fprintf(stdout, "G = ",partition3_Freqs[2][0],"\n"); fprintf(stdout, "T = ",partition3_Freqs[3][0],"\n");
HYPHY correctly prints out the frequencies, so it's reading it from the file, but for some reason the likelihood is actually twice the likelihood when I set the frequencies by hand. That is if I type partition_Freqs[0][0] := .001, I get a different result than if I read them from the file.
It seems like the difference is a result of the fact that when I read in the nuc. frequencies, HYPHY does not change the TVTS ratio from it's starting point. When I set the frequencies by hand, it estimates TVTS as 0.
Here's the rest of my batch file. fscanf(stdin, "String", file); DataSet b = ReadDataFile(file); DataSetFilter partition3 = CreateFilter(b,1); global partition3_Shared_TVTS = .209335; partition3_HKY85={4,4}; partition3_HKY85[0][1]:=t*partition3_Shared_TVTS; partition3_HKY85[0][2]:=t; partition3_HKY85[0][3]:=t*partition3_Shared_TVTS; partition3_HKY85[1][0]:=t*partition3_Shared_TVTS; partition3_HKY85[1][2]:=t*partition3_Shared_TVTS; partition3_HKY85[1][3]:=t; partition3_HKY85[2][0]:=t; partition3_HKY85[2][1]:=t*partition3_Shared_TVTS; partition3_HKY85[2][3]:=t*partition3_Shared_TVTS; partition3_HKY85[3][0]:=t*partition3_Shared_TVTS; partition3_HKY85[3][1]:=t; partition3_HKY85[3][2]:=t*partition3_Shared_TVTS;
fscanf(stdin, "Number", F1); fscanf(stdin, "Number", F2); fscanf(stdin, "Number", F3); fscanf(stdin, "Number", F4); partition3_Freqs = {4,1}; /* partition3_Freqs[0][0]:= F1; partition3_Freqs[1][0]:= F2; partition3_Freqs[2][0]:= F3; partition3_Freqs[3][0]:= F4; */
partition3_Freqs[0][0]:= .001; partition3_Freqs[1][0]:= .498; partition3_Freqs[2][0]:= .001; partition3_Freqs[3][0]:= .498;
fprintf(stdout, "A = ",partition3_Freqs[0][0],"\n"); fprintf(stdout, "C = ",partition3_Freqs[1][0],"\n"); fprintf(stdout, "G = ",partition3_Freqs[2][0],"\n"); fprintf(stdout, "T = ",partition3_Freqs[3][0],"\n");
Model partition3_HKY85_model2=(partition3_HKY85, partition3_Freqs); global r2 = 1; UseModel (partition3_HKY85_model2); Tree Noncoding2 =(((Scer,Spar)Node2,Smik)Node1,Skud,Sbay); Noncoding2.Scer.t=0; Noncoding2.Spar.t=0; Noncoding2.Node2.t=0; Noncoding2.Smik.t=0; Noncoding2.Node1.t=0; Noncoding2.Skud.t=0; Noncoding2.Sbay.t=0;
LikelihoodFunction test_LF2 = (partition3, Noncoding2);
Optimize(res_test_LF2,test_LF2); fprintf(stdout,"\n",test_LF2);
My sequence files looks like: >Scer CTTT >Spa r CTCT >Smik TTTT >Skud TTTT >Sbay TTTT
|