df3bbe278ede7c57491db9d6f4f10340c176565b
kate
  Mon Mar 14 14:21:47 2016 -0700
Change boxplot to tissue ordering alphabetically, to match hgTracks.  Leave in code to sort descending by median score, in case we want to provide that as a user option. refs #15645

diff --git src/hg/hgc/gtexClick.c src/hg/hgc/gtexClick.c
index 3565a0a..a080a74 100644
--- src/hg/hgc/gtexClick.c
+++ src/hg/hgc/gtexClick.c
@@ -69,33 +69,35 @@
 int i;
 for (tsv = tsvList; tsv != NULL; tsv = tsv->next)
     {
     int count = tsv->count;
     for (i=0; i<count; i++)
         fprintf(f, "%d\t%s\t%0.3f\n", sampleId++, tsv->name, tsv->vals[i]);
     }
 fclose(f);
 
 // Plot to PNG file
 struct tempName pngTn;
 trashDirFile(&pngTn, "hgc", "gtexGene", ".png");
 char cmd[256];
 
 /* Exec R in quiet mode, without reading/saving environment or workspace */
-safef(cmd, sizeof(cmd), "Rscript --vanilla --slave hgcData/gtexBoxplot.R %s %s %s %s %s",  
+safef(cmd, sizeof(cmd), "Rscript --vanilla --slave hgcData/gtexBoxplot.R %s %s %s %s %s %s",  
                                 gtexGene->name, dfTn.forCgi, pngTn.forHtml, 
-                                doLogTransform ? "log=TRUE" : "log=FALSE", version);
+                                doLogTransform ? "log=TRUE" : "log=FALSE", "order=alpha", version);
+//NOTE: use "order=score" to order bargraph by median RPKM, descending
+
 int ret = system(cmd);
 if (ret == 0)
     {
     printf("<IMG SRC = \"%s\" BORDER=1><BR>\n", pngTn.forHtml);
     //printf("<IMG SRC = \"%s\" BORDER=1 WIDTH=%d HEIGHT=%d><BR>\n",
                     //pngTn.forHtml, imageWidth, imageHeight);
                     //pngTn.forHtml, 900, 500);
     }
 }
 
 struct gtexGeneBed *getGtexGene(char *item, char *table)
 /* Retrieve gene info for this item from the main track table */
 {
 struct gtexGeneBed *gtexGene = NULL;
 struct sqlConnection *conn = hAllocConn(database);