8a16a63280f05173a8a843e586012199b9104f77
braney
Mon Feb 8 14:48:02 2021 -0800
tweaking Gencode Genes search
diff --git src/hg/hgGene/hgGene.c src/hg/hgGene/hgGene.c
index bc7e738..bbefda5 100644
--- src/hg/hgGene/hgGene.c
+++ src/hg/hgGene/hgGene.c
@@ -26,30 +26,31 @@
/* ---- Global variables. ---- */
struct cart *cart; /* This holds cgi and other variables between clicks. */
struct hash *oldVars; /* Old cart hash. */
char *database; /* Name of genome database - hg15, mm3, or the like. */
char *genome; /* Name of genome - mouse, human, etc. */
char *curGeneId; /* Current Gene Id. */
char *curGeneName; /* Biological name of gene. */
char *curGeneChrom; /* Chromosome current gene is on. */
char *curAlignId; /* Align id from knownGene genePred */
struct trackDb *globalTdb;
struct genePred *curGenePred; /* Current gene prediction structure. */
boolean isGencode; /* is this based on the Gencode models */
boolean isGencode2; /* is this based on the Gencode models and use ensembl id as primary id */
+boolean isGencode3; /* is this based on the Gencode models and use ensembl id as primary id */
int curGeneStart,curGeneEnd; /* Position in chromosome. */
struct sqlConnection *spConn; /* Connection to SwissProt database. */
char *swissProtAcc; /* SwissProt accession (may be NULL). */
int kgVersion = KG_UNKNOWN; /* KG version */
int measureTiming = FALSE;
//#include "rgdInfo.c"
void usage()
/* Explain usage and exit. */
{
errAbort(
"hgGene - A CGI script to display the gene details page.\n"
"usage:\n"
" hgGene cgi-vars in var=val format\n"
@@ -248,33 +249,33 @@
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;
-if (isGencode || isGencode2)
+if (isGencode || isGencode2 || isGencode3)
{
- hPrintf("Gencode Transcript: %s
\n", isGencode2 ? curGeneId : curAlignId);;
+ hPrintf("Gencode Transcript: %s
\n", isGencode2 || isGencode3 ? curGeneId : 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;
@@ -754,32 +755,33 @@
doWikiTrack(conn);
else if (cartVarExists(cart, hggDoGetProteinSeq))
doGetProteinSeq(conn, curGeneId, curGeneName);
else if (cartVarExists(cart, hggDoRnaFoldDisplay))
doRnaFoldDisplay(conn, curGeneId, curGeneName);
else if (cartVarExists(cart, hggDoOtherProteinSeq))
doOtherProteinSeq(conn, curGeneName);
else if (cartVarExists(cart, hggDoOtherProteinAli))
doOtherProteinAli(conn, curGeneId, curGeneName);
else
{
/* Default case - start fancy web page. */
measureTiming = isNotEmpty(cartOptionalString(cart, "measureTiming"));
isGencode = trackDbSettingOn(tdb, "isGencode");
isGencode2 = trackDbSettingOn(tdb, "isGencode2");
+ isGencode3 = trackDbSettingOn(tdb, "isGencode3");
cartWebStart(cart, database, "%s Gene %s (%s) Description and Page Index",
- genome, curGeneName, isGencode2 ? curGeneId : curAlignId);
+ genome, curGeneName, isGencode2 || isGencode3 ? curGeneId : curAlignId);
webMain(conn, tdb);
cartWebEnd();
}
hFreeConn(&spConn);
hFreeConn(&conn);
}
cartRemovePrefix(cart, hggDoPrefix);
}
char *excludeVars[] = {"Submit", "submit", "ajax", hggAjaxSection, NULL};
int main(int argc, char *argv[])
/* Process command line. */
{
long enteredMainTime = clock1000();