/* info - UCSC Known Genes Model Info section. */ #include "common.h" #include "hash.h" #include "linefile.h" #include "dystring.h" #include "spDb.h" #include "web.h" #include "txInfo.h" #include "hgGene.h" void doTxInfoDescription() /* Put up info on fields in txInfo table. */ { cartWebStart(cart, database, "Gene Model Information Table Fields"); printf("%s", "\n"); cartWebEnd(); } static void showInfoTable(struct sqlConnection *conn, char *geneName, char *txInfoTable) /* Print out stuff from txInfo table. */ { if (!sqlTableExists(conn, txInfoTable)) return; char query[512]; safef(query, sizeof(query), "select * from %s where name='%s'", txInfoTable, geneName); struct sqlResult *sr = sqlGetResult(conn, query); char **row; if ((row = sqlNextRow(sr)) != NULL) { struct txInfo *info = txInfoLoad(row); webPrintLinkTableStart(); webPrintLinkCell("category:"); webPrintLinkCell(info->category); webPrintLinkCell("nonsense-mediated-decay:"); webPrintLinkCell(info->nonsenseMediatedDecay ? "yes" : "no"); webPrintLinkCell("RNA accession:"); webPrintLinkCell(info->sourceAcc); webPrintLinkTableNewRow(); webPrintLinkCell("exon count:"); webPrintIntCell(info->exonCount); webPrintLinkCell("CDS single in 3' UTR:"); webPrintLinkCell(info->cdsSingleInUtr3 ? "yes" : "no"); webPrintLinkCell("RNA size:"); webPrintIntCell(info->sourceSize); webPrintLinkTableNewRow(); webPrintLinkCell("ORF size:"); webPrintIntCell(info->orfSize); webPrintLinkCell("CDS single in intron:"); webPrintLinkCell(info->cdsSingleInIntron ? "yes" : "no"); webPrintLinkCell("Alignment % ID:"); webPrintDoubleCell(info->aliIdRatio*100); webPrintLinkTableNewRow(); webPrintLinkCell("txCdsPredict score:"); webPrintDoubleCell(info->cdsScore); webPrintLinkCell("frame shift in genome:"); webPrintLinkCell(info->genomicFrameShift ? "yes" : "no"); webPrintLinkCell("% Coverage:"); webPrintDoubleCell(info->aliCoverage*100); webPrintLinkTableNewRow(); webPrintLinkCell("has start codon:"); webPrintLinkCell(info->startComplete ? "yes" : "no"); webPrintLinkCell("stop codon in genome:"); webPrintLinkCell(info->genomicStop ? "yes" : "no"); webPrintLinkCell("# of Alignments:"); webPrintIntCell(info->genoMapCount); webPrintLinkTableNewRow(); webPrintLinkCell("has end codon:"); webPrintLinkCell(info->endComplete ? "yes" : "no"); webPrintLinkCell("retained intron:"); webPrintLinkCell(info->retainedIntron ? "yes" : "no"); webPrintLinkCell("# AT/AC introns"); webPrintIntCell(info->atacIntrons); webPrintLinkTableNewRow(); webPrintLinkCell("selenocysteine:"); webPrintLinkCell(info->selenocysteine ? "yes" : "no"); webPrintLinkCell("end bleed into intron:"); webPrintIntCell(info->bleedIntoIntron); webPrintLinkCell("# strange splices:"); webPrintIntCell(info->strangeSplice); webPrintLinkTableEnd(); txInfoFree(&info); } sqlFreeResult(&sr); } static void infoPrint(struct section *section, struct sqlConnection *conn, char *geneId) /* Print out UCSC KG info. */ { showInfoTable(conn, geneId, "kgTxInfo"); hPrintf("Click "); hPrintf("", hggDoTxInfoDescription, cartSidUrlString(cart)); hPrintf("here\n"); hPrintf(" for a detailed description of the fields of the table above.
"); } static boolean infoExists(struct section *section, struct sqlConnection *conn, char *geneId) /* Return TRUE if info exists and has data. */ { return sqlTablesExist(conn, "kgTxInfo"); } struct section *infoSection(struct sqlConnection *conn, struct hash *sectionRa) /* Create UCSC KG Model Info section. */ { struct section *section = sectionNew(sectionRa, "info"); section->exists = infoExists; section->print = infoPrint; return section; }