0fb492400a83b9d96c96ccf6e02a43bd3e54b08a angie Thu Jul 26 12:20:54 2018 -0700 A little refinement to pgSnp recognizer errors. diff --git src/hg/lib/pgSnp.c src/hg/lib/pgSnp.c index 97e2028..c03a6c7 100644 --- src/hg/lib/pgSnp.c +++ src/hg/lib/pgSnp.c @@ -705,31 +705,33 @@ item->chromStart = lineFileNeedNum(lf, row, 1); item->chromEnd = lineFileNeedNum(lf, row, 2); if (item->chromEnd < 1) lineFileAbort(lf, "chromEnd less than 1 (%d)", item->chromEnd); if (item->chromEnd < item->chromStart) lineFileAbort(lf, "chromStart after chromEnd (%d > %d)", item->chromStart, item->chromEnd); /* use pattern match to check values and counts both */ /* alleles are separated by / and can be ACTG- */ item->name = cloneString(row[3]); /* allele count, positive integer matching # of alleles */ item->alleleCount = lineFileNeedNum(lf, row, 4); char alleles[128]; /* pattern to match alleles */ safef(alleles, sizeof(alleles), "^[ACTG-]+(\\/[ACTG-]+){%d}$", item->alleleCount - 1); if (! regexMatchNoCase(row[3], alleles)) - lineFileAbort(lf, "invalid alleles %s", row[3]); + lineFileAbort(lf, "invalid alleles (%s)" + " - must be slash-separated nucleotide(s) with correct number of alleles (%d)", + row[3], item->alleleCount); /* read count, comma separated list of numbers with above # of items */ item->alleleFreq = cloneString(row[5]); char pattern[128]; safef(pattern, sizeof(pattern), "^[0-9]+(,[0-9]+){%d}$", item->alleleCount - 1); if (! regexMatchNoCase(row[5], pattern)) lineFileAbort(lf, "invalid allele frequency, %s with count of %d", row[5], item->alleleCount); /* scores, comma separated list of numbers with above # of items */ item->alleleScores = cloneString(row[6]); safef(pattern, sizeof(pattern), "^[0-9.]+(,[0-9.]+){%d}$", item->alleleCount - 1); if (! regexMatchNoCase(row[6], pattern)) lineFileAbort(lf, "invalid allele scores, %s with count of %d", row[6], item->alleleCount); return item; } #define VCF_MAX_ALLELE_LEN 80