d517d7563a1e14f913bf2d21893daada5e35134d angie Wed Aug 24 14:15:31 2022 -0700 Use chopTabs not chopLine for VCF header parsing. refs #29923 diff --git src/lib/vcf.c src/lib/vcf.c index 8f7df6f..85db6c6 100644 --- src/lib/vcf.c +++ src/lib/vcf.c @@ -398,33 +398,33 @@ vcfFileErr(vcff, "Expected column %d's name in header to be \"%s\" or \"%s\" " "but got \"%s\"", ix+1, exp1, exp2, words[ix]); } } #define expectColumnName(vcff, exp, words, ix) expectColumnName2(vcff, exp, NULL, words, ix) #define VCF_MIN_COLUMNS 8 char *vcfDefaultHeader = "#CHROM POS ID REF ALT QUAL FILTER INFO"; /* Default header if we have none. */ static void parseColumnHeaderRow(struct vcfFile *vcff, char *line) /* Make sure column names are as we expect, and store genotype sample IDs if any are given. */ { -int wordCount = chopLine(line+1, NULL); +int wordCount = chopTabs(line+1, NULL); char *words[wordCount]; -chopLine(line+1, words); +chopTabs(line+1, words); if (wordCount < VCF_MIN_COLUMNS) errAbort("VCF header missing at least one of the required VCF fields"); expectColumnName(vcff, "CHROM", words, 0); expectColumnName(vcff, "POS", words, 1); expectColumnName(vcff, "ID", words, 2); expectColumnName(vcff, "REF", words, 3); expectColumnName(vcff, "ALT", words, 4); expectColumnName2(vcff, "QUAL", "PROB", words, 5); expectColumnName(vcff, "FILTER", words, 6); expectColumnName(vcff, "INFO", words, 7); if (wordCount > VCF_MIN_COLUMNS) { expectColumnName(vcff, "FORMAT", words, 8); if (wordCount < 10) vcfFileErr(vcff, "FORMAT column is given, but no sample IDs for genotype columns...?");