eebe031af9dfcecc8f5d0c1a5cd6a13b4d3e8865
mspeir
Wed Sep 9 14:43:26 2026 -0700
VCF help: explain which display modes draw the haplotype view, and add the settings that were missing, refs #38010
Neither VCF help page said that the haplotype sorting display depends on the
track's display mode. vcfTrack.c reaches vcfHapClusterOverloadMethods only when
the visibility is pack or squish and the file has genotypes for more than one
sample; every other case falls through to vcfFileToPgSnp. So full draws one row
per variant, dense collapses them onto a single row, and in both of those the
"Enable Haplotype sorting display" checkbox and everything conditional on it do
nothing. Multi-region view and the density graph option disable it as well. Say
so on hgVcfTrackHelp.html, above the settings it governs, and on vcf.html next
to the visibility parameter.
vcf.html also listed only hapCluster{Enabled,ColorBy,TreeAngle,Height},
applyMinQual, minQual and minFreq. Add hapClusterMethod, sampleColorFile, minAc
and the four vcfDo* switches that hide filter controls, in a block of their own
since they are mostly used by hubs. sampleMetadataFile and showHardyWeinberg
are defined in vcfUi.h but nothing in the tree reads them, so they are left out.
Checked all four modes on the HGDP phased variants track, chr21:33,000,000-
33,010,000: dense 566 px, squish 617, pack 681, full 9574.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
diff --git src/hg/htdocs/goldenPath/help/hgVcfTrackHelp.html src/hg/htdocs/goldenPath/help/hgVcfTrackHelp.html
index e70b51fe779..989b0612616 100755
--- src/hg/htdocs/goldenPath/help/hgVcfTrackHelp.html
+++ src/hg/htdocs/goldenPath/help/hgVcfTrackHelp.html
@@ -22,30 +22,40 @@
</p>
<p>
The following section describes configuration settings available to VCF files compressed and
indexed in the Tabix format. This requires VCF manipulation, separate index files, and a web
accessible directory to reference from the bigDataUrl track line. For more information
on setting up and uploading VCF/Tabix data, click the link on <a href="vcf.html" target="_blank">
VCF custom track creation</a>.
</p>
<h2>Configuring the haplotype sorting display</h2>
<p>
If the VCF file contains genotype columns for at least two samples (four haplotypes), then a
haplotype sorting display can be configured. This can be useful for determining the similarity
between the samples and inferring inheritance at a particular locus.
</p>
<p>
+The haplotype sorting display is drawn only when the track's display mode is set to
+<strong>pack</strong> or <strong>squish</strong>; squish draws it at half the configured height.
+In <strong>full</strong> mode the track shows one row per variant, and in <strong>dense</strong>
+mode it collapses every variant onto a single row. Neither of those modes draws per-sample rows,
+so the settings described below have no effect in them. The haplotype sorting display is
+likewise unavailable in
+<a href="multiRegionHelp.html" target="_blank">multi-region view</a> and when
+<strong>Display data as a density graph</strong> is checked.
+</p>
+<p>
<strong>Enable Haplotype sorting display:</strong> When this option is checked, each sample's phased
and/or homozygous genotypes are split into haplotypes, clustered by similarity around a central
variant, and sorted for display by their position in the clustering tree. The tree (as
space allows) is drawn in the label area next to the track image. Leaf clusters, in
which all haplotypes are identical (at least for the variants used in clustering), are
colored purple.
</p>
<p class='text-center'>
<img src="../../images/vcfTree.png" alt="VCF tree diagram" width=600px>
<p class='gbsCaption text-center'>The haplotype tree can be seen to the left of the track.</p>
</p>
<p>
Each variant is drawn as a vertical column, using color to distinguish between
reference alleles and alternate alleles of the horizontally running haplotypes. If unchecked, then
the display is the same as for VCF without genotypes: a stacked bar graph of the top two alleles,