d7592ea7cb7e4d6126a201cd89d62b87fdcd2981 markd Wed Nov 15 22:02:20 2023 -0800 generate error message rather than abort when bigGenePred is incorrect specified as track type diff --git src/hg/lib/genePred.c src/hg/lib/genePred.c index 30a9dbc..400f8a2 100644 --- src/hg/lib/genePred.c +++ src/hg/lib/genePred.c @@ -2104,31 +2104,32 @@ if (isCoding != NULL && codingBasesSoFar > 0) { *isCoding = FALSE; return codingBasesSoFar; } return -1; // introns not okay } struct genePredExt *genePredFromBedBigGenePred( char *chrom, struct bed *bed, struct bigBedInterval *bb) /* build a genePred from a bigGenePred and a bed file */ { char *extra = cloneString(bb->rest); int numCols = 12 + 8 - 3; char *row[numCols]; int wordCount = chopByChar(extra, '\t', row, numCols); -assert(wordCount == numCols); +if (wordCount < numCols) + errAbort("expected at least %d columns in bigGenePred, got %d; is this actually a bigGenePred?", numCols, wordCount); struct genePredExt *gp = bedToGenePredExt(bed); gp->name2 = cloneString(row[ 9]); int numBlocks; sqlSignedDynamicArray(row[ 12], &gp->exonFrames, &numBlocks); gp->optFields |= genePredExonFramesFld; //assert (numBlocks == gp->exonCount); gp->type = cloneString(row[13]); gp->geneName = cloneString(row[14]); gp->geneName2 = cloneString(row[15]); return gp;