HyPhy message board
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl
HYPHY Package >> Contributions >> CodonModelCompare - save results to file
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl?num=1125942257

Message started by avilella on Sep 5th, 2005 at 10:44am

Title: CodonModelCompare - save results to file
Post by avilella on Sep 5th, 2005 at 10:44am
Dears,

I found out that CodonModelCompare.bf differs from NucModelCompare.bf in that the former won't ask for a results file, while the latter does.

As I find more convenient for batched jobs to save the results in a separate file, I took to liberty of adding the results file prompt in CodonModelCompare.bf.

In hopes of being useful to others, here is the diff:
-----
--- CodonModelCompare.bf.ori    2005-09-05 19:24:51.967872600 +0200
+++ CodonModelCompare.bf        2005-09-05 19:28:44.062588840 +0200
@@ -631,6 +631,10 @@
       fscanf  (stdin,"Number", rejectAt);
}

+SetDialogPrompt ("Save results to:");
+
+fprintf (PROMPT_FOR_FILE, CLEAR_FILE);
+BASE_PATH = LAST_FILE_PATH;


KEEP_OPTIMAL_ORDER = 1;
@@ -942,6 +946,9 @@
               }
       }

+       fprintf (BASE_PATH,CLEAR_FILE,"\n\nRemaining models:\n\n#   |  Model   | # prm |    lnL    |      LRT       |    AIC     |   P-Value        |");
+       fprintf (BASE_PATH,"\n----|----------|-------|-----------|----------------|------------|------------------|");
+
       fprintf (stdout,"\n\nRemaining models:\n\n#   |  Model   | # prm |    lnL    |      LRT       |    AIC     |   P-Value        |");
       fprintf (stdout,"\n----|----------|-------|-----------|----------------|------------|------------------|");

@@ -970,11 +977,15 @@
                       modelNum = modelNum + 1;
                       PRINT_DIGITS = 3;
                       fprintf (stdout,"\n",v2);
+                       fprintf (BASE_PATH,"\n",v2);
                       PRINT_DIGITS = 1;
                       fprintf (stdout," | (",0,resultCache[v2][0],resultCache[v2][1],resultCache[v2][2],resultCache[v2][3],resultCache[v2][4],") | ");
                       fprintf (stdout,Format (np,5,0));
+                       fprintf (BASE_PATH," | (",0,resultCache[v2][0],resultCache[v2][1],resultCache[v2][2],resultCache[v2][3],resultCache[v2][4],") | ");
+                       fprintf (BASE_PATH,Format (np,5,0));
                       PRINT_DIGITS = 8;
                       fprintf (stdout, " |  ",lnL," | ",Format(LRT,14,3), " |  ", AIC, "  |  ", );
+                       fprintf (BASE_PATH, " |  ",lnL," | ",Format(LRT,14,3), " |  ", AIC, "  |  ", );
                       PRINT_DIGITS = 15;
                       if (LRT==0)
                       {
@@ -990,6 +1001,7 @@
                               v4 = v2;
                       }
                       fprintf (stdout,pValue," |");
+                       fprintf (BASE_PATH,pValue," |");

               }
       }
@@ -1002,6 +1014,7 @@
       }

       fprintf (stdout, "\n\nAIC based winner: (", modelString, ") with AIC = ", v5, "\n\n");
+       fprintf (BASE_PATH, "\n\nAIC based winner: (", modelString, ") with AIC = ", v5, "\n\n");

       dummy = printModelMatrix (modelString);

@@ -1021,12 +1034,14 @@
       if (Abs(modelString2))
       {
               fprintf (stdout, "\nThis model is better known as:", modelString2, "\n");
+               fprintf (BASE_PATH, "\nThis model is better known as:", modelString2, "\n");
       }

}
else
{
       fprintf (stdout, "\nGeneral Reversible Model is the winner!\n");
+       fprintf (BASE_PATH, "\nGeneral Reversible Model is the winner!\n");
}


Title: Re: CodonModelCompare - save results to file
Post by Sergei on Sep 6th, 2005 at 12:01pm
Dear Albert,

Thanks for the modified version of the analysis. I will include the additions in the next build of HyPhy.

Cheers,
Sergei

HyPhy message board » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2024. All Rights Reserved.