358232fdd2fe9b78248b54fd38a9cd2f52ff4586 angie Wed Oct 21 12:49:05 2020 -0700 lineFileUdcMayOpen automatically decompresses local files but not urls. netLineFileMayOpen does automatically decompress. For now, just use netLineFileMayOpen, although in the long term it would be better to ad support to lineFileUdcMayOpen to get the benefits of caching. diff --git src/hg/hgTracks/vcfTrack.c src/hg/hgTracks/vcfTrack.c index 4a4795c..132a41d 100644 --- src/hg/hgTracks/vcfTrack.c +++ src/hg/hgTracks/vcfTrack.c @@ -3,30 +3,31 @@ /* Copyright (C) 2014 The Regents of the University of California * See README in this or parent directory for licensing information. */ #include "common.h" #include "bigWarn.h" #include "dystring.h" #include "rainbow.h" #include "errCatch.h" #include "fa.h" #include "genePredReader.h" #include "hacTree.h" #include "hdb.h" #include "hgColors.h" #include "hgTracks.h" #include "iupac.h" +#include "net.h" #include "pgSnp.h" #include "phyloTree.h" #include "trackHub.h" #include "trashDir.h" #include "variantProjector.h" #include "vcf.h" #include "vcfUi.h" #include "knetUdc.h" #include "udc.h" #include "memgfx.h" // Russ Corbett-Detig suggested darker shades for coloring non-synonymous variants green Color darkerShadesOfGreenOnWhite[EXPR_DATA_SHADES]; static boolean getMinQual(struct trackDb *tdb, double *retMinQual) @@ -2090,39 +2091,40 @@ struct hash *sampleColors = NULL; char *setting = cartOrTdbString(cart, tdb, VCF_SAMPLE_COLOR_FILE, NULL); if (isNotEmpty(setting)) { // If the setting has not been set in the cart then we're getting the trackDb setting which // may specify a list of files and possibly labels like "Thing_one=file1 Thing_two=file2". // In that case, pick out the first file. if (strchr(setting, '=') || strchr(setting, ' ')) { setting = nextWord(&setting); char *eq = (strchr(setting, '=')); if (eq) setting = eq+1; } char *fileName = hReplaceGbdb(setting); - struct lineFile *lf = lineFileUdcMayOpen(fileName, TRUE); + struct lineFile *lf = netLineFileMayOpen(fileName); if (lf) { sampleColors = hashNew(0); char *line; while (lineFileNextReal(lf, &line)) { - char *words[2]; - chopTabs(line, words); + char *words[3]; + int wordCount = chopTabs(line, words); + lineFileExpectWords(lf, 2, wordCount); char *sample = words[0]; char *colorStr = words[1]; int rgb = bedParseColor(colorStr); Color color = MAKECOLOR_32( ((rgb>>16)&0xff), ((rgb>>8)&0xff), (rgb&0xff) ); hashAddInt(sampleColors, sample, color); } lineFileClose(&lf); } else warn("Can't open sampleColorFile '%s'", fileName); } return sampleColors; } static struct hash *getHighlightSamples(struct trackDb *tdb)