752e20a9a1dc08793c5b529bbeac4ce5836a6be4
braney
Fri Sep 4 17:13:55 2026 -0700
hgc: stop five details-page handlers from aborting over a missing piece.
chromSeqFileExists() opened its connection with sqlConnect() and only then
asked whether the database existed, so it aborted before it could answer.
The otherDb of a chain or net track is often not a local database at all --
a GenArk hub assembly, or one long retired -- so use sqlMayConnect() and
return FALSE. This is 112 of the failures the TrackCheck robot reports, most
of them hg38 net tracks against HPRC assemblies. Also moved the disconnect
out of the if, where it leaked a connection whenever a database had no
chromInfo table, and dropped the now-redundant sqlDatabaseExists() call,
which was itself a second connection.
mgcCloneInfoLoad() aborted when a clone carried no MGC: id in
hgFixed.mrnaClone. Nothing on the page reads that field, and a clone can
legitimately have only an IMAGE: id, so the check went away rather than the
page. hDbOrganism() aborted for an assembly that has left dbDb but is still
named by a maf component, which hg16.evofold does via mm3; it now falls back
on the database name.
The pgSnp SIFT and Polyphen prediction tables are loaded separately from the
tracks that name them, so a machine can have the track and not the table, as
hgwbeta and the RR do for hg18. Check with hTableExists first and say the
predictions are unavailable instead of letting the query take the page down.
Same treatment for the RNA fold diagram: a non-zero ghostscript exit now
drops only the diagram and keeps the rest of the page, including the
PseudoViewer link.
Two of these report an unavailable piece through warn(), which still marks
the page for the robot. That is deliberate -- the missing hg18 tables and
the RNA fold diagram are real defects, and the log should keep naming them
until they are fixed. On the RNA fold diagram in particular: RNAplot
truncates the sequence id it is given to 42 characters, and the trash path
we build is already 41, so it has never written the file ghostscript is
asked to convert. That is worth its own fix.
refs #37424
diff --git src/hg/hgc/rnaFoldClick.c src/hg/hgc/rnaFoldClick.c
index e792152fd40..bcf9afa10a1 100644
--- src/hg/hgc/rnaFoldClick.c
+++ src/hg/hgc/rnaFoldClick.c
@@ -163,32 +163,34 @@
char *res = NULL;
char *database;
char *chp;
database = cloneString(databaseIn);
// process special case like "hg19.chr21"
chp = strstr(database, ".");
if (chp != NULL)
{
*chp = '\0';
}
sqlSafef(query, sizeof(query), "select organism from dbDb where name = '%s'", database);
if(sqlQuickQuery(connCentral, query, buf, sizeof(buf)) == NULL)
- // this can happen in mirrors (see #8490).
- errAbort("organism '%s' not found in dbDb", database);
+ // This can happen in mirrors (see #8490), and also for an assembly that has
+ // been retired from dbDb but is still named by a maf component (see #37424).
+ // Fall back on the database name, which is all we know about it.
+ res = cloneString(database);
else
res = cloneString(buf);
hDisconnectCentral(&connCentral);
freez(&database);
return res;
}
void htmlPrintMafAndFold(FILE *f, struct mafAli *maf, char *fold, double *scores, int lineSize)
/* HTML pretty print maf and fold to f. If scores is non-null then
* scores are indicated below alignemnt.*/
{
struct mafComp *mc;
int i, N, lineStart, lineEnd;
int *pairList = NULL;
@@ -397,38 +399,50 @@
fprintf(of, "%s\n%s\n", seq->dna, item->secStr);
}
pipelineClose(&plStruct);
char pngName[256];
char *rootName = cloneString(psName);
chopSuffix(rootName);
safef(pngName, sizeof(pngName), "%s.png", rootName);
char outputBuf[1024];
safef(outputBuf, sizeof outputBuf, "-sOutputFile=%s", pngName);
char *pipeCmd[] = {"gs", "-sDEVICE=png16m", outputBuf, "-dBATCH","-dNOPAUSE","-q", psName, NULL};
struct pipeline *pl = pipelineOpen1(pipeCmd, pipelineWrite | pipelineNoAbort, "/dev/null", NULL, 0);
int sysRet = pipelineWait(pl);
-if (sysRet != 0)
- errAbort("System call returned %d for:\n %s", sysRet, pipelineDesc(pl));
printf("Display on PseudoViewer
", seq->dna, item->secStr, start);
htmlHorizontalLine();
+if (sysRet != 0)
+ {
+ /* Always fires today: RNAplot truncates the sequence id we hand it to 42
+ * characters and appends "_ss.ps", and psName's directory prefix is already 41
+ * characters, so RNAplot writes rnaStructRangan__ss.ps and gs is
+ * pointed at a file that was never created. Drop just the diagram; the rest of
+ * the page is still worth showing. refs #37424 */
+ printf("RNAFold diagram could not be made.
");
+ warn("Could not make the RNA fold diagram: system call returned %d for:\n %s",
+ sysRet, pipelineDesc(pl));
+ }
+else
+ {
printf("RNAFold diagram:
");
printf("
", pngName);
}
+}
void htmlPrintSecStrEvofoldDrawing(FILE *f, struct rnaSecStr *item)
{
char fileName[512];
struct dnaSeq *seq;
seq = hChromSeq(database, item->chrom, item->chromStart, item->chromEnd);
touppers(seq->dna);
if (item->strand[0] == '-')
reverseComplement(seq->dna, seq->size);
memSwapChar(seq->dna, seq->size, 'T', 'U');
safef(fileName, sizeof(fileName), "/gbdb/%s/evoFold/%s/%s.png",
database, item->chrom, item->name);
if (fileExists(fileName))
{