1d851880b8a9d745cfed02d9e7893c210fd7bc70 braney Wed May 24 13:56:28 2017 -0700 print out Gencode Gene Id if Gencode version of knownGene diff --git src/hg/hgGene/hgGene.c src/hg/hgGene/hgGene.c index 3e1774c..97406c4 100644 --- src/hg/hgGene/hgGene.c +++ src/hg/hgGene/hgGene.c @@ -235,47 +235,58 @@ if (genomeOptionalSetting("summaryIdSql")) { char *summaryId = genoQuery(id, "summaryIdSql", conn); if (summaryId != NULL) dyStringPrintf(description, " (%s)", summaryId); } dyStringPrintf(description, ": %s", summary); freez(&summary); dyStringPrintf(description, "
\n"); } } } return dyStringCannibalize(&description); } +static char *getGencodeGeneId(struct sqlConnection *conn, char *id, char *buffer, int bufSize) +{ +char query[256]; +sqlSafef(query, sizeof(query), "select protein from knownCanonical c, knownIsoforms i where i.clusterId=c.clusterId and i.transcript='%s'" ,id); +return sqlQuickQuery(conn, query, buffer, bufSize ); +} + static void printDescription(char *id, struct sqlConnection *conn, struct trackDb *tdb) /* Print out description of gene given ID. */ { char *description = descriptionString(id, conn); int i, exonCnt = 0, cdsExonCnt = 0; int cdsStart, cdsEnd; hPrintf("%s", description); freez(&description); /* print genome position and size */ char buffer[1024]; char *commaPos; char *isGencode = trackDbSetting(tdb, "isGencode"); if (isGencode) + { hPrintf("Gencode Transcript: %s
\n", curAlignId); + char buffer[1024]; + hPrintf("Gencode Gene: %s
\n", getGencodeGeneId(conn, curGeneId, buffer, sizeof buffer)); + } exonCnt = curGenePred->exonCount; safef(buffer, sizeof buffer, "%s:%d-%d", curGeneChrom, curGeneStart+1, curGeneEnd); commaPos = addCommasToPos(database, buffer); hPrintf("Transcript (Including UTRs)
\n"); hPrintf("   Position: %s %s ",database, commaPos); sprintLongWithCommas(buffer, (long long)curGeneEnd - curGeneStart); hPrintf("Size: %s ", buffer); hPrintf("Total Exon Count: %d ", exonCnt); hPrintf("Strand: %s
\n",curGenePred->strand); cdsStart = curGenePred->cdsStart; cdsEnd = curGenePred->cdsEnd; /* count CDS exons */