e8f2620df2a833ef15bdc2c7c4e132302770c900
hiram
  Tue May 26 20:14:28 2026 -0700
now have data access on hgdownload refs #31811

diff --git src/hg/makeDb/doc/vgp577way/mkHtml.pl src/hg/makeDb/doc/vgp577way/mkHtml.pl
index 38a7594c2e4..605c6011c59 100755
--- src/hg/makeDb/doc/vgp577way/mkHtml.pl
+++ src/hg/makeDb/doc/vgp577way/mkHtml.pl
@@ -29,30 +29,36 @@
 my %comName;    # key is accession, value is common name
 my %clade;      # key is accession, value is clade string
 
 open (my $fh, "<", $tsvFile) or die "can not read $tsvFile";
 while (my $line = <$fh>) {
   chomp $line;
   my ($acc, $sci, $com, $cl) = split('\t', $line);
   $sciName{$acc} = $sci;
   $comName{$acc} = $com;
   $clade{$acc} = $cl;
 }
 close ($fh);
 
 # read order.list: ordered list of accessions with coverage measures
 my @orderData;   # array of hashrefs with keys: coverage, acc, tsvKey
+# first one is the reference species:
+push (@orderData, {
+  coverage => 0,
+  acc => $refAcc,
+  tsvKey => defined($aliasToTsv{$refAcc}) ? $aliasToTsv{$refAcc} : $refAcc
+});
 
 open ($fh, "<", $orderFile) or die "can not read $orderFile";
 while (my $line = <$fh>) {
   chomp $line;
   next if ($line =~ m/^\s*$/);
   my @fields = split('\s+', $line);
 
   # check we have exactly 2 fields
   if (scalar(@fields) != 2) {
     warn "ORDER: Skipping malformed line: $line\n";
     next;
   }
 
   my ($coverage, $acc) = @fields;
 
@@ -153,51 +159,49 @@
 reference bias and improve alignment accuracy across diverse evolutionary distances.
 </P>
 
 <P>
 The alignment includes:
 <UL>
 __EOF__
 
 # print clade statistics
 foreach my $cl (@cladeOrder) {
   my $count = scalar(@{$cladeSpecies{$cl}});
   my $displayName = cladeDisplayName($cl);
   print "<li><b>$displayName</b>: $count species\n";
 }
 
-print <<'__EOF__';
+print <<__EOF__;
 </UL>
 </P>
 
 <P>
 This broad phylogenetic sampling enables comparative genomics studies across
 the vertebrate tree of life, supporting research in evolution, conservation,
 and functional genomics.
 </P>
-__EOF__
 
-# <h2>Data Access</h2>
-# <p>
-# Downloads for data in this track are available from the directory:
-# <ul>
-# <li>
-# <a href="https://hgdownload.soe.ucsc.edu/goldenPath/hg38/vgp577way/">VGP 577-way alignments</a> (MAF format)
-# </ul>
-# </p>
+<h2>Data Access</h2>
+<p>
+Downloads for data in this track are available from the directories:
+<ul>
+<li><a href="https://hgdownload.soe.ucsc.edu/hubs/VGP/vgp577way/maf/${refAcc}/">gzipped MAF files for the 577-way alignments</a></li>
+<li><a href="https://hgdownload.soe.ucsc.edu/hubs/VGP/vgp577way/bbi/${refAcc}/">the bigBed data files for the track display</a></li>
+</ul>
+</p>
 
-print <<'__EOF__';
 <h2>Display Conventions and Configuration</h2>
 <p>
 Pairwise alignments of each species to the reference genome are
 displayed as a grayscale density plot (in pack mode) or as a wiggle (in full mode)
 that indicates alignment quality. In dense display mode, alignments are shown in
 grayscale using darker values to indicate higher levels of coverage.
 </p>
 <p>
 Checkboxes on the track configuration page allow selection of the
 species to include in the pairwise display.
 Note that excluding species from the pairwise display does not alter the
 underlying alignment data.
 </p>
 <p>
 To view detailed information about the alignments at a specific
@@ -264,77 +268,81 @@
 </p>
 
 <p>
 Unlike traditional progressive alignment approaches, Cactus performs an additional
 "bar" phase that identifies and resolves alignment conflicts by considering all
 genomes simultaneously. This helps reduce reference bias and improves accuracy
 across diverse evolutionary distances present in vertebrate genomes.
 </p>
 
 <p>
 The input genomes represent high-quality chromosome-level assemblies primarily
 from the Vertebrate Genomes Project, with additional assemblies from NCBI RefSeq
 and GenBank that meet quality standards for whole-genome alignment.
 </p>
 
-<h2>Sequences</h2>
+<h2>Sequences (click on header labels to sort by that column)</h2>
+<h3>Default order is by similarity to the reference</h3>
 <p>
 <blockquote>
-<table border=1 class='stdTbl'>
-<tr><th>count</th>
+<style>
+tr:nth-child(5n) {
+  background-color: #ffffcc;
+}
+</style>
+<table border=1 class="stdTbl sortable">
+<thead style="position:sticky; top:0; background-color: lightblue;"><tr><th>count</th>
+    <th>accession<br>(link&nbsp;to&nbsp;browser)</th>
     <th>common<br>name</th>
-    <th>clade</th>
-    <th>scientific&nbsp;name<br>(link&nbsp;to&nbsp;browser&nbsp;when&nbsp;existing)</th>
-</tr>
+    <th>scientific&nbsp;name</th>
+    <th>VGP grouping</th>
+</tr></thead><tbody>
 __EOF__
 
 # print species table
 my $rowCount = 1;
 foreach my $item (@orderData) {
-  my $pos = sprintf("%03d", $rowCount++);
+  my $count = sprintf("%03d", $rowCount++);
   my $acc = $item->{acc};
   my $tsvKey = $item->{tsvKey};
   my $coverage = formatNumber($item->{coverage});
 
   my $commonName = $comName{$tsvKey} || "unknown";
   my $sciName = $sciName{$tsvKey} || "unknown";
   my $cladeDisplay = cladeDisplayName($clade{$tsvKey} || "unknown");
 
   # clean up common name - remove extra info after /
   $commonName =~ s/\/.*$//;
 
   # create scientific name with link if available
+  my $accDisplay = $acc;
   my $sciNameDisplay = $sciName;
   my $dbLink = getDbLink($acc);
   if (defined($dbLink)) {
-    $sciNameDisplay = $sciName . "<br><a href='$dbLink' target=_blank>$acc</a>";
-  } elsif ($acc =~ /^GC[AF]_/) {
-    $sciNameDisplay = $sciName . "<br><a href='/h/$acc' target=_blank>$acc</a>";
-  } else {
-    $sciNameDisplay = $sciName . "<br>$acc";
+    $accDisplay = "<a href='$dbLink' target=_blank>$acc</a>";
   }
 
   # make reference species special
   if ($acc eq $refAcc || $tsvKey eq $refAcc) {
     $sciNameDisplay .= "<br><b>reference species</b>";
   }
 
-  print "<tr><td>$pos</td><th>$commonName</th><td>$cladeDisplay</td><td>$sciNameDisplay</td></tr>\n";
+  printf "<tr><td>%s</td><td>%s</td><th>%s</th><td>%s</td><td>%s</td></tr>\n", $count, $accDisplay, $commonName, $sciNameDisplay, $cladeDisplay;
 }
 
 print <<'__EOF__';
-</table><br>
+</tbody></table><br>
 <b>Table 1.</b> <em>Genome assemblies included in the VGP 577-way alignment.</em>
 </blockquote></p>
 
 <h2>References</h2>
 <p>
 Rhie A, McCarthy SA, Fedrigo O, Damas J, Formenti G, Koren S, Uliano-Silva M, Chow W, Fungtammasan A, Kim J
 <em>et al</em>.
 <a href="https://doi.org/10.1038/s41586-021-03451-0" target="_blank">
 Towards complete and error-free genome assemblies of all vertebrate species</a>.
 <em>Nature</em>. 2021 Apr 29;592(7856):737-746.
 DOI: <a href="https://doi.org/10.1038/s41586-021-03451-0"
 target="_blank">10.1038/s41586-021-03451-0</a>; PMID: <a
 href="https://www.ncbi.nlm.nih.gov/pubmed/33911273" target="_blank">33911273</a>;
 PMC: <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8081667/" target="_blank">PMC8081667</a>
 </p>