d4cd9e95212c727b3b70c351d56dae25b1bca17a angie Mon Jun 22 09:33:14 2015 -0700 Don't refuse VCF v4.2 files -- display as well as we can. At some point, someone should take a closer look at the 4.2 spec to see what changes will require code changes. diff --git src/lib/vcf.c src/lib/vcf.c index b4e308b..6f4ad60 100644 --- src/lib/vcf.c +++ src/lib/vcf.c @@ -486,33 +486,33 @@ { dyStringAppend(dyHeader, line); dyStringAppendC(dyHeader, '\n'); parseMetadataLine(vcff, line); } slReverse(&(vcff->infoDefs)); slReverse(&(vcff->filterDefs)); slReverse(&(vcff->gtFormatDefs)); // Did we get the bare minimum VCF header with supported version? if (vcff->majorVersion == 0) { vcfFileWarn(vcff, "missing ##fileformat= header line? Assuming 4.1."); vcff->majorVersion = 4; vcff->minorVersion = 1; } -if ((vcff->majorVersion != 4 || (vcff->minorVersion != 0 && vcff->minorVersion != 1)) && +if ((vcff->majorVersion != 4 || vcff->minorVersion < 0 || vcff->minorVersion > 2) && (vcff->majorVersion != 3)) - vcfFileErr(vcff, "VCFv%d.%d not supported -- only v3.*, v4.0 or v4.1", + vcfFileErr(vcff, "VCFv%d.%d not supported -- only v3.*, v4.0, v4.1 or v4.2", vcff->majorVersion, vcff->minorVersion); // Next, one header line beginning with single "#" that names the columns: if (line == NULL) // EOF after metadata return vcff; char headerLineBuf[256]; if (line[0] != '#') { lineFileReuse(lf); vcfFileWarn(vcff, "Expected to find # followed by column names (\"#CHROM POS ...\"), " "assuming default VCF 4.1 columns"); safef(headerLineBuf, sizeof(headerLineBuf), "%s", vcfDefaultHeader); line = headerLineBuf; } dyStringAppend(dyHeader, line);