70c47307cc384a4d1664346c9976fb3126f64ce7 hiram Mon Mar 17 10:03:56 2014 -0700 fixup logic and compile problems for Mac OSX refs #12209 diff --git src/hg/hgTracks/loweLabTracks.c src/hg/hgTracks/loweLabTracks.c index 4b2a933..703158d 100644 --- src/hg/hgTracks/loweLabTracks.c +++ src/hg/hgTracks/loweLabTracks.c @@ -65,31 +65,31 @@ LLshadesOfCOGS['N'-'A']=hvGfxFindColorIx(hvg, 220, 252,172); LLshadesOfCOGS['Z'-'A']=hvGfxFindColorIx(hvg, 204, 252,172); LLshadesOfCOGS['W'-'A']=hvGfxFindColorIx(hvg, 188, 252,172); LLshadesOfCOGS['U'-'A']=hvGfxFindColorIx(hvg, 172, 252,172); LLshadesOfCOGS['O'-'A']=hvGfxFindColorIx(hvg, 156, 252,172); LLshadesOfCOGS['C'-'A']=hvGfxFindColorIx(hvg, 188, 252,252); /* light blue 133, 233,204); */ LLshadesOfCOGS['G'-'A']=hvGfxFindColorIx(hvg, 204, 252,252); LLshadesOfCOGS['E'-'A']=hvGfxFindColorIx(hvg, 220, 252,252); LLshadesOfCOGS['F'-'A']=hvGfxFindColorIx(hvg, 220, 236,252); LLshadesOfCOGS['H'-'A']=hvGfxFindColorIx(hvg, 220, 220,252); LLshadesOfCOGS['I'-'A']=hvGfxFindColorIx(hvg, 220, 204,252); LLshadesOfCOGS['P'-'A']=hvGfxFindColorIx(hvg, 204, 204,252); LLshadesOfCOGS['Q'-'A']=hvGfxFindColorIx(hvg, 188, 204,252); LLshadesOfCOGS['R'-'A']=hvGfxFindColorIx(hvg, 224, 224,224); /* general function prediction */ LLshadesOfCOGS['S'-'A']=hvGfxFindColorIx(hvg, 204, 204,204); -LLshadesOfCOGS['-'-'A']=hvGfxFindColorIx(hvg, 224, 224,224);/* no cog - same as R (general function prediction) */ +LLshadesOfCOGS['+'+'-'-'A']=hvGfxFindColorIx(hvg, 224, 224,224);/* no cog - same as R (general function prediction) */ } void loadBed6(struct track *tg) /* Load the items in one custom track - just move beds in * window... */ { struct bed *bed, *list = NULL; struct sqlConnection *conn = hAllocConn(database); struct sqlResult *sr; char **row; int rowOffset; sr = hRangeQuery(conn, tg->table, chromName, winStart, winEnd, NULL, &rowOffset); while ((row = sqlNextRow(sr)) != NULL) { @@ -113,30 +113,33 @@ char *temparray[160]; char **row; if(hTableExists(database, "COG")) { sqlSafef(query, sizeof query, "select * from COG where name = '%s'", bed->name); sr = sqlGetResult(conn, query); if ((row = sqlNextRow(sr)) != NULL) COG = COGLoad(row); sqlFreeResult(&sr); hFreeConn(&conn); initializeColors(hvg); if(COG!=NULL) { chopString(COG->code, "," , temparray, 9999); + if (temparray[0][0] == '-') + return LLshadesOfCOGS[('+'+temparray[0][0]-'A')]; + else return LLshadesOfCOGS[(temparray[0][0]-'A')]; } else return blackIndex(); } else { hFreeConn(&conn); return blackIndex(); } slFreeList(&bed); } void gbGeneMethods(struct track *tg) /* Track group for genbank gene tracks */ @@ -159,30 +162,33 @@ return shadesOfGray[9]; if (lf->name == NULL) return shadesOfGray[9]; if(hTableExists(database, "COG")) { sqlSafef(query, sizeof query,"select * from COG where name = '%s'", lf->name); sr = sqlGetResult(conn, query); if ((row = sqlNextRow(sr)) != NULL) COG = COGLoad(row); sqlFreeResult(&sr); hFreeConn(&conn); initializeColors(hvg); if(COG!=NULL) { chopString(COG->code, "," , temparray, 9999); + if (temparray[0][0] == '-') + return LLshadesOfCOGS[('+'+temparray[0][0]-'A')]; + else return LLshadesOfCOGS[(temparray[0][0]-'A')]; } else return shadesOfGray[9]; } else { hFreeConn(&conn); return shadesOfGray[9]; } slFreeList(&lf); } Color gpGeneNameColor(struct track *tg, void *item, struct hvGfx *hvg) /* draw name for the linked feature in blue. */