e5bca336b3a879884c7cd865cc2c1758e5ffbb3e angie Fri Oct 13 14:32:01 2017 -0700 Check for NULL to support VCF files with missing header definitions. diff --git src/hg/hgc/vcfClick.c src/hg/hgc/vcfClick.c index 80ce88f..b536064 100644 --- src/hg/hgc/vcfClick.c +++ src/hg/hgc/vcfClick.c @@ -255,31 +255,31 @@ dyStringClear(tmp1); dyStringAppend(tmp1, rec->format); struct vcfFile *vcff = rec->file; enum vcfInfoType formatTypes[256]; char *formatKeys[256]; int formatCount = chopString(tmp1->string, ":", formatKeys, ArraySize(formatKeys)); puts("Genotype info key:
"); int i; for (i = 0; i < formatCount; i++) { if (sameString(formatKeys[i], vcfGtGenotype)) continue; const struct vcfInfoDef *def = vcfInfoDefForGtKey(vcff, formatKeys[i]); char *desc = def ? def->description : "not described in VCF header"; printf("  %s: %s
\n", formatKeys[i], desc); - formatTypes[i] = def->type; + formatTypes[i] = def ? def->type : vcfInfoString; } hTableStart(); puts("Sample IDGenotypePhased?"); for (i = 0; i < formatCount; i++) { if (sameString(formatKeys[i], vcfGtGenotype)) continue; printf("%s", formatKeys[i]); } puts("\n"); for (i = 0; i < vcff->genotypeCount; i++) { struct vcfGenotype *gt = &(rec->genotypes[i]); char *hapA = ".", *hapB = "."; if (gt->hapIxA >= 0)