6eab7fc47402f1ce34ed331ae80f5bcbee54da82 braney Thu Dec 16 13:30:33 2010 -0800 remove USE_PNG and GIF support #1323 diff --git src/hg/lib/hgExp.c src/hg/lib/hgExp.c index 8ce6a06..7c1ba60 100644 --- src/hg/lib/hgExp.c +++ src/hg/lib/hgExp.c @@ -1,331 +1,326 @@ /* hgExp - help browse expression data. */ #include "common.h" #include "hash.h" #include "jksql.h" #include "hdb.h" #include "gifLabel.h" #include "cart.h" #include "cheapcgi.h" #include "hgExp.h" #include "portable.h" static char const rcsid[] = "$Id: hgExp.c,v 1.18 2009/03/03 23:29:06 aamp Exp $"; static int expSubcellWidth = 21; static char *colorSchemeVals[] = { /* Menu option for color scheme. */ "red high/green low", "yellow high/blue low", }; void hgExpColorDropDown(struct cart *cart, char *varName) /* Make color drop-down. */ { char *checked = cartUsualString(cart, varName, colorSchemeVals[0]); cgiMakeDropList(varName, colorSchemeVals, ArraySize(colorSchemeVals), checked); } boolean hgExpRatioUseBlue(struct cart *cart, char *varName) /* Return TRUE if should use blue instead of red * in the expression ratios. */ { char *val = cartUsualString(cart, varName, colorSchemeVals[0]); return !sameString(val, colorSchemeVals[0]); } char **hgExpGetNames(char *database, char *table, int expCount, int *expIds, int skipSize) /* Create array filled with experiment names. */ { char **names, *name; int i; char *db = database; struct sqlConnection *conn; char query[256], nameBuf[128]; int maxLen = 0, len; if (!hTableExists(database, table)) db = "hgFixed"; conn = sqlConnect(db); /* Read into array and figure out longest name. */ AllocArray(names, expCount); for (i=0; i maxLen) maxLen = len; } } sqlDisconnect(&conn); /* Right justify names. */ for (i=0; i", expSubcellWidth); groupSize = countNonNull(experiments+i, representativeCount-i); -#ifdef USE_PNG safef(gifName, sizeof(gifName), "../trash/nea_%s_%s%d.png", colName, subName, ++gifStart); -#else - safef(gifName, sizeof(gifName), "../trash/nea_%s_%s%d.gif", - colName, subName, ++gifStart); -#endif gifLabelVerticalText(gifName, experiments+i, groupSize, height); if (url != NULL) printf("", url); printf("", gifName); if (url != NULL) printf(""); printf(""); } /* Clean up */ for (i=0; i 0xFF) hex = 0xFF; printf("%02X", hex); } static void colorVal(double val, double scale, boolean useBlue, boolean useGrays, boolean logGrays) /* Val is -1.0 to 1.0. Print color in form #FF0000, normally * using green for minus values, red for plus values, but * optionally using blue for minus values and yellow for plus values. */ { if (useGrays) { if (val < 1) printf("000000"); else { val = (logGrays) ? log(val) * scale : val * scale; hexOne(val); hexOne(val); hexOne(val); } } else { val *= scale; if (useBlue) { if (val < 0) { val = -val; printf("00"); printf("00"); hexOne(val); } else { val *= 0.7; hexOne(val); /* Red */ hexOne(val); /* Green */ printf("00"); /* Blue */ } } else { if (val < 0) { printf("00"); /* Red */ hexOne(-val*0.8); /* Green - brighter than red*/ printf("00"); /* Blue */ } else { hexOne(val); printf("00"); printf("00"); } } } } static void startExpCell() /* Print out start of expression cell, which contains a table. */ { printf(""); } static void endExpCell() /* Print out end of expression cell, closing up internal table. */ { printf("
"); } static void restartExpCell() /* End expression cell and begin a new one. */ { endExpCell(); startExpCell(); } static void printRatioShades(char *colName, int repCount, int *reps, int valCount, float *vals, boolean colorBlindColors, boolean useGrays, boolean logGrays, float scale) /* Print out representatives in shades of color in table background. */ { int i; float val; startExpCell(); for (i=0; i valCount) errAbort("Representative larger than biggest experiment in %s", colName); if (ix == -1) { restartExpCell(); } else { val = vals[ix]; if (val <= -9999) printf(" ", expSubcellWidth); else { printf(" "); } } } endExpCell(); } static void replicate(char *s, int repCount, int *reps) /* Replicate s in cells of table */ { int i; startExpCell(); printf("%s", s); for (i=0; in/a", representativeCount, representatives); } }