a2d849d0acd9e8921d1ff131d907ca867c858d11
braney
Thu Jul 19 10:47:57 2018 -0700
changes to support new new Gencode models in hgGene
diff --git src/hg/hgGene/hgGene.c src/hg/hgGene/hgGene.c
index 97406c4..3f28fd6 100644
--- src/hg/hgGene/hgGene.c
+++ src/hg/hgGene/hgGene.c
@@ -21,32 +21,34 @@
#include "genePred.h"
#include "hgColors.h"
#include "hgGene.h"
#include "obscure.h"
#include "genbank.h"
/* ---- 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;
+char *curAlignId; /* Align id from knownGene genePred */
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 */
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"
@@ -255,35 +257,34 @@
}
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)
+if (isGencode || isGencode2)
{
- hPrintf("Gencode Transcript: %s
\n", curAlignId);
+ hPrintf("Gencode Transcript: %s
\n", isGencode2 ? 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;
@@ -549,36 +550,35 @@
struct section *section;
int total = 0;
printf("
section, check time, print time, total
\n");
for (section = sectionList; section != NULL; section = section->next)
{
boolean isOpen = sectionIsOpen(section);
int sectionTime = section->checkTime + section->printTime;
printf("%s, %d, %d, %d %s
\n", section->shortLabel, section->checkTime, section->printTime,
sectionTime, isOpen ? "" : "closed");
total += sectionTime;
}
printf("total = %d\n", total);
printf("