2521d696f5073ce8cee3f59f423f161fdb77d550
max
  Fri Sep 25 02:48:37 2026 -0700
VCF tracks: the bigBed trackDb filters (filter.*, filterByRange, filterLimits, filterValues, filterType, filterText, filterLabel) now work on INFO fields, plus ID and QUAL. The field list and types come from the VCF header; the bigBed filter code is reused, bigBed behavior unchanged, refs #37617

diff --git src/hg/htdocs/goldenPath/help/trackDb/trackDbLibrary.shtml src/hg/htdocs/goldenPath/help/trackDb/trackDbLibrary.shtml
index 77fa9a20c91..c9f05a758ac 100644
--- src/hg/htdocs/goldenPath/help/trackDb/trackDbLibrary.shtml
+++ src/hg/htdocs/goldenPath/help/trackDb/trackDbLibrary.shtml
@@ -1765,41 +1765,74 @@
     <UL>
         <LI>filterByDate</LI>
         <LI>filterByNumber (currently *Filter)</LI>
         <LI>filterByWild</LI>
         <LI>filterByWildList (like in track search)</LI>
     </UL></I></P>
     <P><I>These generic filter controls should work by
     "where clause" and should be allowed on any item based track
     including bigBeds!  Note that bigBeds already support scoreFilter
     and will always have the problem that zoomed out will not support
     filtering.  The Browser UI should show when tracks are filtered,
     so that losing the filter is obvious!</I></P>
     -->
 </DIV>
 
-<DIV class="filter"><span class="types bed bigBed"></span>
+<DIV class="filter"><span class="types bed bigBed vcf vcfTabix"></span>
 <div class="format">
     <code>filter.&lt;fieldName&gt; &lt;default integer&gt;</code><BR>
     <code>filterByRange.&lt;fieldName&gt; &lt;off/on&gt;</code><BR>
     <code>filterLimits.&lt;fieldName&gt; &lt;low&gt;[:&lt;high&gt;]</code><BR>
     </div>
     <P>There are a number of different filters available for bigBed data. See the 
     <a href="../hubQuickStartFilter.html" target="_blank">Filters Quick Start guide</a> for
     more info. Note: for configurable features, like filters, an additional period
     &quot;.&quot; or plus &quot;+&quot; is required in the type declaration,
     for instance <code>type bigBed 5 .</code> or <code>type bigBed 9 +</code>.</p>
+    <P><B>VCF tracks:</B> the settings <code>filter.*</code>, <code>filterByRange.*</code>,
+    <code>filterLimits.*</code>, <code>filterText.*</code>, <code>filterValues.*</code>,
+    <code>filterValuesDefault.*</code>, <code>filterType.*</code>, <code>filterLabel.*</code>
+    and <code>filterPriority.*</code> also work on <code>vcfTabix</code> and <code>vcf</code>
+    tracks. There, &lt;fieldName&gt; is the key of an INFO field, e.g.
+    <code>filter.AF 0.01</code> or <code>filterText.CSQ *missense*</code>.
+    The key must be declared in an <code>##INFO</code> line of the VCF header; the
+    header's <code>Description</code> is the default label of the filter. In addition, the
+    fixed columns <code>ID</code> and <code>QUAL</code> can be used as field names. These
+    filters are combined with the other VCF filters (minimum QUAL, FILTER column, minimum
+    allele frequency and count). The details for VCF values:</P>
+    <ul>
+    <li>If a field has more than one value, e.g. <code>Number=A</code> with one value per
+    alternate allele, the variant passes if any one of its values passes. With
+    <code>filterType multipleListOr</code> or <code>multipleListAnd</code>, the values are
+    compared as a list, like a comma-separated bigBed field.</li>
+    <li>A missing value (<code>.</code>), or a variant without this INFO key, never passes a
+    numeric filter. For text and value filters, it is compared as an empty string, so the
+    default wildcard <code>*</code> still shows it.</li>
+    <li>A <code>Flag</code> field has the value 1 if the key is present and 0 if not, so
+    <code>filter.DB 1</code> shows only variants with the flag, and
+    <code>filterValues.DB 1|present,0|absent</code> makes a menu.</li>
+    </ul>
+    <P><B>Example:</B></P>
+    <pre>
+    track myVariants
+    type vcfTabix
+    filter.AF 0.01
+    filterByRange.AC on
+    filter.AC 2:100
+    filterLimits.AC 0:1000
+    filterText.CSQ *
+    filterLabel.CSQ Consequence</pre>
     <P><code> filter.&lt;fieldName&gt; </code> is used for numerical data. It requires
     a default value to be passed. A value of 0 (or the lowest value present in the dataset) 
     can be used to enable numerical filtering, but filter nothing by default.</P>
     <P>By default, the range of values for <code>filter.&lt;fieldName&gt;</code> is 0 to 1000. 
     However, you can explicitly set the upper and lower limits of the filter with 
     <code>filterLimits.&lt;fieldName&gt;</code>.</P>
     <P>The numeric filters will exclude items that fall below the setting. That is, a
     <code>filter.&lt;fieldName&gt;</code> of 800 will exclude all items with a score 
     below 800. You can also filter values within a range by including the 
     <code>filterByRange.&lt;fieldName&gt;</code> setting. For example, 
     <code>filter.&lt;fieldName&gt; 800:900</code> will include only items with scores at 
     or above 800 and below 900. It is recommended that <code>filterByRange.&lt;fieldName&gt;</code> 
     be used in combination with <code>filterLimits.&lt;fieldName&gt;</code> 
     to set limit boundaries.</P>
     <P>The filter label will be the description of the field as specified by the autoSql (.as) file.
@@ -1859,31 +1892,31 @@
     5
     6 (Uncertain)
     Unknown
     7.0</pre>	
     <P>This example applies <code>filter.&lt;fieldName&gt;</code> to values in the
     field named <code>confidenceScore</code> containing some non-numerical values.
     If items with the four values above were filtered with a minimum value of 6:
     <P>
     <code>5</code> - item would be removed as it is less than the filter value<br>
     <code>6 (Uncertain)</code> - item should show up, as it would be interpreted as
     &quot;6&quot;<br>
     <code>Unknown</code> - item would be removed as it would be interpreted as 0<br>
     <code>7.0</code> - item would appear as decimals are supported</P>
 </DIV>
 
-<DIV class="filterText"><span class="types bigBed"></span>
+<DIV class="filterText"><span class="types bigBed vcf vcfTabix"></span>
 <div class="format">
     <code>filterText.&lt;fieldName&gt; &lt;default search string&gt;</code><BR>
     <code>filterType.&lt;fieldName&gt; &lt;wildcard/regexp&gt;</code><BR>
     </div>
     <P>There are a number of different filters available for bigBed data. See the     
     <a href="../hubQuickStartFilter.html" target="_blank">Filters Quick Start guide</a> for
     more info. Note: for configurable features, like filters, an additional period
     &quot;.&quot; or plus &quot;+&quot; is required in the type declaration,
     for instance <code>type bigBed 5 .</code> or <code>type bigBed 9 +</code>.</p>
     <P><code>filterText.&lt;fieldName&gt;</code> is used to enable text searching in the 
     specified fieldName. It requires a default search string to be passed. An asterisk/wildcard (*)
     can be used to enable text searching, but pass no default value. If a word or string is
     passed, items matching the string will be filtered by default. See examples below for 
     details.</P>
     <P><code>filterText.&lt;fieldName&gt;</code> will enable two kinds of searching, wildcard and
@@ -1925,31 +1958,31 @@
     filterText.geneName *</pre>
     <P>This example is enabling filtering on the same field as above, <code>geneName</code>,
     however, it is not declaring a default search parameter. This is done by passing only an
     asterisk/wildcard (*). This means that the search box 
     will be present but no <code>geneName</code> items will be filtered out of the data 
     unless the user specifies a value.</P>
     <pre>
     filterText.geneName \.1$
     filterType.geneName regexp</pre>
     <P>
     This example once again enables filtering on the same field, however, it is declaring
     regexp as the filter type and passing a regular expression to be applied by default. 
     In this case, we are targeting all <code>geneName</code> items that are version 1.</P>
 </DIV>
 
-<DIV class="filterValues"><span class="types bigBed"></span>
+<DIV class="filterValues"><span class="types bigBed vcf vcfTabix"></span>
 <div class="format">
     <code>filterValues.&lt;fieldName&gt; &lt;value1,value2,value3...&gt;</code><BR>
     <code>filterValuesDefault.&lt;fieldName&gt; &lt;value1,value2,value3...&gt;</code><BR>
     <code>filterType.&lt;fieldName&gt; &lt;single/singleList/multiple/multipleListOr/multipleListAnd/multipleListOnlyOr/multipleListOnlyAnd&gt;</code><BR>
     </div>
     <P>There are a number of different filters available for bigBed data. See the     
     <a href="../hubQuickStartFilter.html" target="_blank">Filters Quick Start guide</a> for
     more info. Note: for configurable features, like filters, an additional period
     &quot;.&quot; or plus &quot;+&quot; is required in the type declaration,
     for instance <code>type bigBed 5 .</code> or <code>type bigBed 9 +</code>.</p>
     <P><code>filterValues.&lt;fieldName&gt;</code> is used to enable filtering by 
     specified values within a field. It can be used on fields that can contain
     one text value or a list of comma-separated values of text, like "classA,classB".
     Usually these are category names.
     The option requires at least one value to filter on.</P>
@@ -2045,51 +2078,51 @@
     <pre>
     filterValues.annotationType DNA-BR,AS,BS,BSi</pre>
     <P>In this example the filter is being applied to multiple values in the 
     <code>annotationType</code> field. We can then select from these values in the 
     <code>annotationType</code> field with a drop-down menu displayed on the track settings page, 
     and display only items that match our selections. The selection choices will let us match
     one, all, or any combination of the supplied values.</P>
     <pre>
     filterValues.annotationType DNA-BR|DNA-binding region,AS|active site,BS|beta strand,BSi|binding site</pre>
     <P>In this follow up to the previous question, we have changed the name of the items that
     show up in the drop down menu to be more descriptive than the dense file format values. This means
     that if we wanted to only see items with <code>annotationType</code> of 
     <code>DNA-BR</code>, we would select <code>DNA-binding region</code> from the interface menu.</P>
 </DIV>
 
-<DIV class="filterLabel"><span class="types bed bigBed"></span>
+<DIV class="filterLabel"><span class="types bed bigBed vcf vcfTabix"></span>
 <div class="format"><code>filterLabel.&lt;fieldName&gt; &lt;label&gt;</code></div>
     <P>When a user clicks on a track item in the Browser image,
     the item detail page is shown. This setting specifies an
     alternate label for the filter on that page. Without this
     setting, the label will be the description of the field as
     specified by the autoSql (.as) file. Some of the parameters modified by
     this are:</P>
     <P><ul><li><code>filter.&lt;fieldName&gt;</code></li>
     <li><code>filterText.&lt;fieldName&gt;</code></li>
     <li><code>filterValues.&lt;fieldName&gt;</code></li></ul></P>
     <P><B>Example:</B></P>
     <pre>
     filterValues.strand +,-
     filterLabel.strand Strand (Orientation)</pre>
     <P>In this example, we have a standard &quot;strand&quot; BED field with the default
     description &quot;+ or - for strand&quot;. We have enabled a filter and simplified
     the label to just "Strand (Orientation)".</P>
 </DIV>
 
-<DIV class="filterPriority"><span class="types bed bigBed"></span>
+<DIV class="filterPriority"><span class="types bed bigBed vcf vcfTabix"></span>
 <div class="format"><code>filterPriority.&lt;fieldName&gt; &lt;number&gt;</code></div>
     <P>Sets the display order of filters on the track configuration page.
     Filters are shown in ascending order of <code>filterPriority</code>
     value (lowest first), so a filter with priority 1 appears above one with
     priority 2. Filters that do not specify a priority sort after all filters
     that do, sorted alphabetically by field name.</P>
     <P>The setting applies to any filter declared on <code>&lt;fieldName&gt;</code>,
     regardless of which filter style is used. <code>filter.&lt;fieldName&gt;</code>,
     <code>filterText.&lt;fieldName&gt;</code>, and
     <code>filterValues.&lt;fieldName&gt;</code> all share a single
     <code>filterPriority.&lt;fieldName&gt;</code> entry. The companion setting
     <code>highlightPriority.&lt;fieldName&gt;</code> does the same for
     <code>highlight*.&lt;fieldName&gt;</code>.</P>
     <P>Numbers may be integers or decimals; only the relative ordering matters,
     so values like <code>1 2 3</code> and <code>10 20 30</code> produce the same