2b77a59a9a6cda4306802b59c74cf78fd56f57f2 kate Wed Mar 23 10:14:09 2016 -0700 Readability improvements to gene details page boxplot. Use long labels instead of short. Space out sample counts. Change yellow text to black. refs #15645 diff --git src/hg/hgc/gtexClick.c src/hg/hgc/gtexClick.c index 51058a6..13abd18 100644 --- src/hg/hgc/gtexClick.c +++ src/hg/hgc/gtexClick.c @@ -58,54 +58,51 @@ { /* Create R data frame. This is a tab-sep file, one row per sample, * with columns for sample, tissue, rpkm */ struct tempName dfTn; trashDirFile(&dfTn, "hgc", "gtexGene", ".df.txt"); FILE *f = fopen(dfTn.forCgi, "w"); if (f == NULL) errAbort("can't create temp file %s", dfTn.forCgi); fprintf(f, "sample\ttissue\trpkm\n"); struct tissueSampleVals *tsv; int sampleId=1; int i; for (tsv = tsvList; tsv != NULL; tsv = tsv->next) { int count = tsv->count; + // remove trailing parenthesized phrases as not worth label length + chopSuffixAt(tsv->description, '('); for (i=0; iname, tsv->vals[i]); + fprintf(f, "%d\t%s\t%0.3f\n", sampleId++, tsv->description, 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 %s", gtexGene->name, dfTn.forCgi, pngTn.forHtml, 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("
\n", pngTn.forHtml); - //printf("
\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); char **row; char query[512]; struct sqlResult *sr; if (sqlTableExists(conn, table)) { sqlSafef(query, sizeof(query), "select * from %s where name = '%s'", table, item); sr = sqlGetResult(conn, query); row = sqlNextRow(sr);