237aadfe25a90021e4b6964cc952dedd08aa8d6e hiram Mon Apr 29 10:04:47 2019 -0700 correctly next wiggle data output with columns refs #18869 diff --git src/hg/hubApi/getData.c src/hg/hubApi/getData.c index cbd5976..da59138 100644 --- src/hg/hubApi/getData.c +++ src/hg/hubApi/getData.c @@ -220,52 +220,52 @@ * determine if split, and then will go through each chrom */ sqlDyStringPrintf(query, "select * from %s", splitSqlTable); } else if (0 == (start + end)) /* have chrom, no start,end == full chr */ { if (! sqlColumnExists(conn, splitSqlTable, chromName)) apiErrAbort(err400, err400Msg, "track '%s' is not a position track, request track without chrom specification, genome: '%s'", track, db); jsonWriteString(jw, "chrom", chrom); struct chromInfo *ci = hGetChromInfo(db, chrom); jsonWriteNumber(jw, "start", (long long)0); jsonWriteNumber(jw, "end", (long long)ci->size); if (startsWith("wig", tdb->type)) { - jsonWriteListStart(jw, NULL); if (jsonOutputArrays || debug) wigColumnTypes(jw); + jsonWriteListStart(jw, chrom); wigTableDataOutput(jw, db, splitSqlTable, chrom, 0, ci->size, 0); jsonWriteListEnd(jw); return; /* DONE */ } else { sqlDyStringPrintf(query, "select * from %s where %s='%s'", splitSqlTable, chromName, chrom); } } else /* fully specified chrom:start-end */ { jsonWriteString(jw, "chrom", chrom); - jsonWriteNumber(jw, "start", (long long)start); - jsonWriteNumber(jw, "end", (long long)end); +// jsonWriteNumber(jw, "start", (long long)start); already printed out +// jsonWriteNumber(jw, "end", (long long)end); already printed out if (startsWith("wig", tdb->type)) { - jsonWriteListStart(jw, NULL); if (jsonOutputArrays || debug) wigColumnTypes(jw); + jsonWriteListStart(jw, chrom); wigTableDataOutput(jw, db, splitSqlTable, chrom, start, end, 0); jsonWriteListEnd(jw); return; /* DONE */ } else { sqlDyStringPrintf(query, "select * from %s where ", splitSqlTable); hAddBinToQuery(start, end, query); sqlDyStringPrintf(query, "%s='%s' AND %s > %u AND %s < %u", chromName, chrom, endName, start, startName, end); } } if (debug) jsonWriteString(jw, "select", query->string);