294e28961da0eab069c44113ff02dbd6008bb9cf angie Mon Oct 27 22:13:02 2014 -0700 I was under the mistaken impression that VCF header ##INFO andencouraged." This change remove errors about missing descriptions that were causing hgTables to give up after 101 errors on a track hub VCF. While inspecting the code I found that hgc's vcfClick.c printKeysWithDescriptions had never made use of its infoDefs arg as intended, so descriptions from ##ALT (symbolic alternate alleles) and ##FILTER were not displayed -- fixed that. refs #14231 diff --git src/hg/hgTables/vcf.c src/hg/hgTables/vcf.c index 7e0db92..e675028 100644 --- src/hg/hgTables/vcf.c +++ src/hg/hgTables/vcf.c @@ -83,31 +83,31 @@ } void vcfInfoElsToString(struct dyString *dy, struct vcfFile *vcff, struct vcfRecord *rec) /* Unpack rec's typed infoElements to semicolon-sep'd string in dy.*/ { dyStringClear(dy); if (rec->infoCount == 0) dyStringAppendC(dy, '.'); int i; for (i = 0; i < rec->infoCount; i++) { if (i > 0) dyStringAppendC(dy, ';'); const struct vcfInfoElement *el = &(rec->infoElements[i]); const struct vcfInfoDef *def = vcfInfoDefForKey(vcff, el->key); - enum vcfInfoType type = def? def->type : vcfInfoNoType; + enum vcfInfoType type = def ? def->type : vcfInfoString; dyStringAppend(dy, el->key); if (el->count > 0) dyStringAppendC(dy, '='); int j; for (j = 0; j < el->count; j++) { if (j > 0) dyStringAppendC(dy, ','); if (el->missingData[j]) { dyStringAppend(dy, "."); continue; } union vcfDatum dat = el->values[j]; switch (type) @@ -121,31 +121,30 @@ char fbuf[64]; safef(fbuf, sizeof(fbuf), "%.16lf", dat.datFloat); int i; for (i = strlen(fbuf) - 1; i > 0; i--) if (fbuf[i] == '0') fbuf[i] = '\0'; else break; dyStringAppend(dy, fbuf); } break; case vcfInfoCharacter: dyStringAppendC(dy, dat.datChar); break; case vcfInfoFlag: // Flags could have values in older VCF - case vcfInfoNoType: case vcfInfoString: dyStringAppend(dy, dat.datString); break; default: errAbort("Invalid vcfInfoType %d (how did this get past parser?", type); } } } } #define VCF_NUM_BUF_SIZE 256 void vcfRecordToRow(struct vcfRecord *rec, char *chrom, char *numBuf, struct dyString *dyAlt, struct dyString *dyFilter, struct dyString *dyInfo, struct dyString *dyGt, char *row[VCFDATALINE_NUM_COLS])