6790e66b73c00a9830b64d5fb2eda5733b4e4b90
chmalee
  Thu Jun 25 16:04:36 2020 -0700
New trackDb variable for phased trios to default to alternate labels if available, refs #25582

diff --git src/hg/hgTracks/vcfTrack.c src/hg/hgTracks/vcfTrack.c
index 0b44455..df4fe07 100644
--- src/hg/hgTracks/vcfTrack.c
+++ src/hg/hgTracks/vcfTrack.c
@@ -2015,32 +2015,33 @@
 
 static void vcfPhasedSetupHaplotypesLines(struct track *track, struct hvGfx *hvg, int xOff,
                             int yOff, int width, int *retYOffsets, struct slPair *sampleNames,
                             MgFont *font)
 /* Setup the background for drawing the ticks, the two haplotype lines for each sample, and the
  * transparent gray box to help distinguish between consecutive samples */
 {
 int sampleHeight = round(track->height / track->customInt);
 double yHap1 = track->lineHeight; // relative offset of first haplotype line
 double yHap2 = sampleHeight - track->lineHeight; // relative offset of second line
 struct slPair *name;
 int i, y1, y2;
 struct rgbColor yellow = lightRainbowAtPos(0.2);
 int transYellow = MAKECOLOR_32_A(yellow.r, yellow.g, yellow.b, 100);
 
-boolean useDefaultLabel = cartUsualBooleanClosestToHome(cart, track->tdb, FALSE, VCF_PHASED_DEFAULT_LABEL_VAR, TRUE);
-boolean useAliasLabel = cartUsualBooleanClosestToHome(cart, track->tdb, FALSE, VCF_PHASED_ALIAS_LABEL_VAR, TRUE);
+boolean useDefaultLabel = cartUsualBooleanClosestToHome(cart, track->tdb, FALSE, VCF_PHASED_DEFAULT_LABEL_VAR, FALSE);
+boolean cartUseAliasLabel = cartUsualBooleanClosestToHome(cart, track->tdb, FALSE, VCF_PHASED_ALIAS_LABEL_VAR, FALSE);
+boolean useAliasLabel = trackDbSettingOn(track->tdb, VCF_PHASED_TDB_USE_ALT_NAMES) || cartUseAliasLabel;
 
 for (name = sampleNames, i = 0; name != NULL; name = name->next, i++)
     {
     y1 = yOff + yHap1 + (i * sampleHeight);
     y2 = yOff + yHap2 + (i * sampleHeight);
     retYOffsets[2*i] = y1;
     retYOffsets[(2*i) + 1] = y2;
     // make the background of every other lane light yellow, but only when NOT doing PDF/EPS output
     if ((hvg->pixelBased && i & 1))
         {
         hvGfxBox(hvg, xOff, y1-(track->lineHeight), width, (y2 + track->lineHeight) - (y1-track->lineHeight), transYellow);
         }
     hvGfxLine(hvg, xOff, y1, xOff+width, y1, MG_BLACK);
     hvGfxLine(hvg, xOff, y2, xOff+width, y2, MG_BLACK);
     struct dyString *label = dyStringNew(0);