a44421a79fb36cc2036fe116b97ea3bc9590cd0c braney Fri Dec 2 09:34:39 2011 -0800 removed rcsid (#295) diff --git src/hg/hgGene/rnaStructure.c src/hg/hgGene/rnaStructure.c index cc8733a..54db3a6 100644 --- src/hg/hgGene/rnaStructure.c +++ src/hg/hgGene/rnaStructure.c @@ -1,217 +1,216 @@ /* rnaStructure - do section on 3' and 5' UTR structure. */ #include "common.h" #include "hash.h" #include "linefile.h" #include "jksql.h" #include "rnaFold.h" #include "hui.h" #include "web.h" #include "portable.h" #include "hgGene.h" -static char const rcsid[] = "$Id: rnaStructure.c,v 1.11 2009/09/23 18:42:16 angie Exp $"; static void rnaTrashDirsInit(char **tables, int count) /* create trash directories if necessary */ { for ( count--; count > -1; count--) mkdirTrashDirectory(tables[count]); } static boolean rnaStructureExists(struct section *section, struct sqlConnection *conn, char *geneId) /* Return TRUE if tables exists and have our gene. */ { if (sqlTableExists(conn, "foldUtr3") && sqlRowExists(conn, "foldUtr3", "name", geneId)) return TRUE; if (sqlTableExists(conn, "foldUtr5") && sqlRowExists(conn, "foldUtr5", "name", geneId)) return TRUE; return FALSE; } static void rnaStructurePrint(struct section *section, struct sqlConnection *conn, char *geneId) /* Print out rnaStructure table. */ { static boolean firstTime = TRUE; static char *names[2] = {"5' UTR", "3' UTR"}; static char *tables[2] = {"foldUtr5", "foldUtr3"}; int side; if (firstTime) { rnaTrashDirsInit(tables, ArraySize(tables)); firstTime = FALSE; } webPrintLinkTableStart(); webPrintLabelCell("Region"); webPrintLabelCell("Fold Energy"); webPrintLabelCell("Bases"); webPrintLabelCell("Energy/Base"); webPrintWideCenteredLabelCell("Display As", 3); for (side = 0; side < ArraySize(names); ++side) { char *table = tables[side]; struct sqlResult *sr; char query[256], **row; safef(query, sizeof(query), "select * from %s where name = '%s'", table, geneId); sr = sqlGetResult(conn, query); if ((row = sqlNextRow(sr)) != NULL) { struct rnaFold fold; int bases; char psName[128]; /* Load fold and save it as postScript. */ rnaFoldStaticLoad(row, &fold); safef(psName, sizeof(psName), "../trash/%s/%s_%s.ps", table, table, geneId); if (!fileExists(psName)) { FILE *f; f = popen("../cgi-bin/RNAplot", "w"); if (f != NULL) { fprintf(f, ">%s\n", psName); /* This tells where to put file. */ fprintf(f, "%s\n%s\n", fold.seq, fold.fold); pclose(f); } } /* Print row of table, starting with energy terms . */ hPrintf("
"); hPrintf("%s\n%s (%1.2f)\n", fold->seq, fold->fold, fold->energy); hPrintf(""); } else if (sameString(how, "picture")) { char *psFile = cartString(cart, hggMrnaFoldPs); char *rootName = cloneString(psFile); char pngName[256]; char pdfName[256]; chopSuffix(rootName); safef(pngName, sizeof(pngName), "%s.png", rootName); safef(pdfName, sizeof(pngName), "%s.pdf", rootName); hPrintf("