5c04291d6636242cb62b6f770fdc93b23873f9d3 markd Thu Oct 16 13:29:03 2025 -0700 fix blast alignment parsing to handle format change diff --git src/lib/blastParse.c src/lib/blastParse.c index 6dfa7aeb04b..396245634e0 100644 --- src/lib/blastParse.c +++ src/lib/blastParse.c @@ -112,60 +112,58 @@ { for (;;) { char *line = bfNextLine(bf); if (line == NULL) return NULL; if (startsWith(start, line)) return line; } } static void bfBadHeader(struct blastFile *bf) /* Report bad header. */ { bfError(bf, "Bad first line\nShould be something like:\n" - "BLASTN 2.0.11 [Jan-20-2000]"); + "BLASTN 2.0.11"); } struct blastFile *blastFileOpenVerify(char *fileName) /* Open file, read and verify header. */ { struct blastFile *bf; char *line; char *words[16]; int wordCount; struct lineFile *lf; AllocVar(bf); bf->lf = lf = lineFileOpen(fileName, TRUE); bf->fileName = cloneString(fileName); /* Parse first line - something like: */ line = bfNeedNextLine(bf); wordCount = chopLine(line, words); -if (wordCount < 3) +if (wordCount < 2) bfBadHeader(bf); bf->program = cloneString(words[0]); bf->version = cloneString(words[1]); bf->buildDate = cloneString(words[2]); if (!wildMatch("*BLAST*", bf->program)) bfBadHeader(bf); if (!isdigit(bf->version[0])) bfBadHeader(bf); -if (bf->buildDate[0] != '[') - bfBadHeader(bf); return bf; } void decomma(char *s) /* Remove commas from string. */ { char *d = s; char c; for (;;) { c = *s++; if (c != ',') *d++ = c; if (c == 0)