7537b3246c147cc4d5de561cd8bed8014dbddf7b max Thu Sep 17 01:59:41 2020 -0700 Adding a hint to bedToBigBed when field count is not as expected. No redmine, just something that I keep forgetting myself and every Covid-track building student has asked about this until now. diff --git src/lib/linefile.c src/lib/linefile.c index 8609c63..f2d0960 100644 --- src/lib/linefile.c +++ src/lib/linefile.c @@ -737,36 +737,42 @@ } void lineFileCloseList(struct lineFile **pList) /* Close up a list of line files. */ { struct lineFile *el, *next; for (el = *pList; el != NULL; el = next) { next = el->next; lineFileClose(&el); } *pList = NULL; } +void lineFileExpectWordsMesg(struct lineFile *lf, int expecting, int got, char* extraMessage) +/* Check line has right number of words. Add extraMessage to end of error message. */ +{ +if (expecting != got) + errAbort("Expecting %d words line %d of %s got %d. %s", + expecting, lf->lineIx, lf->fileName, got, extraMessage); +} + void lineFileExpectWords(struct lineFile *lf, int expecting, int got) /* Check line has right number of words. */ { -if (expecting != got) - errAbort("Expecting %d words line %d of %s got %d", - expecting, lf->lineIx, lf->fileName, got); + lineFileExpectWordsMesg(lf, expecting, got, ""); } void lineFileExpectAtLeast(struct lineFile *lf, int expecting, int got) /* Check line has right number of words. */ { if (got < expecting) errAbort("Expecting at least %d words line %d of %s got %d", expecting, lf->lineIx, lf->fileName, got); } void lineFileShort(struct lineFile *lf) /* Complain that line is too short. */ { errAbort("Short line %d of %s", lf->lineIx, lf->fileName); }