8165601dddc27978eb4a2fe2654ba81212e30473
braney
Sat May 31 11:46:07 2025 -0700
hgGene changes for quickLift
diff --git src/hg/hgGene/sequence.c src/hg/hgGene/sequence.c
index 206953a5b8c..d8fb75fa54e 100644
--- src/hg/hgGene/sequence.c
+++ src/hg/hgGene/sequence.c
@@ -73,47 +73,80 @@
sqlSafef(query, sizeof(query), "select count(*) from %s where name = '%s'",
table, geneId);
if (sqlExists(conn, query))
{
hPrintf("",
cartSidUrlString(cart), command, geneId);
hPrintf("%s", label);
gotHyperlink = TRUE;
}
}
if (!gotHyperlink)
hPrintf("%s", label);
webPrintLinkCellEnd();
}
+char *hgcPathAndSettings()
+/* Return path with hgc and session state variable. */
+{
+static struct dyString *dy = NULL;
+if (dy == NULL)
+ {
+ dy = dyStringNew(128);
+ dyStringPrintf(dy, "%s?%s", hgcName(), cartSidUrlString(cart));
+ }
+return dy->string;
+}
void printMrnaSeqLink(struct sqlConnection *conn, char *geneId)
/* Print out link to fetch mRNA. */
{
+if (liftDb) // if we're quicklifting go through hgc because local functions assume sequence can come from files
+ {
+ char *command = "htcGeneMrna";
+ webPrintWideCellStart(2, HG_COL_TABLE);
+ printf("",
+ hgcPathAndSettings(), command, geneId, curGenePred->chrom, curGenePred->txStart, curGenePred->txEnd, globalTdb->track,globalTdb->track);
+ printf("Predicted mRNA from genomic DNA\n");
+ webPrintLinkCellEnd();
+ return;
+ }
+
char *title = "mRNA";
char *tableId = "knownGene";
if (genomeOptionalSetting("knownGeneMrna") != NULL)
{
title = "mRNA (may differ from genome)";
tableId = "knownGeneMrna";
}
printSeqLink(conn, geneId, tableId, hggDoGetMrnaSeq, title, 2);
}
void printProteinSeqLink(struct sqlConnection *conn, char *geneId)
/* Print out link to fetch protein. */
{
+if (liftDb) // if we're quicklifting go through hgc because local functions assume sequence can come from files
+ {
+ char *command = "htcTranslatedPredMRna";
+ webPrintWideCellStart(3, HG_COL_TABLE);
+ printf("",
+ hgcPathAndSettings(), command, geneId, curGenePred->chrom, curGenePred->txStart, curGenePred->txEnd, "translate", globalTdb->track);
+ printf("Translated Protein from genomic DNA\n");
+ webPrintLinkCellEnd();
+ return;
+ }
+
char *table = genomeSetting("knownGenePep");
char query[256];
char title[128];
sqlSafef(query, sizeof(query),
"select length(seq) from %s where name='%s'" , table, geneId);
int protSize = sqlQuickNum(conn, query);
if (protSize > 0)
{
safef(title, sizeof(title), "Protein (%d aa)", protSize);
printSeqLink(conn, geneId, "knownGenePep", hggDoGetProteinSeq,
title, 1);
}
else
{
webPrintLinkCellStart();