6e2ce95748a6b80895027e24e6f5086890d169bc
hiram
  Tue Nov 28 14:10:37 2023 -0800
correct style statements in html elements for border and text alignment and do not declare type javascript refs #29545

diff --git src/hg/makeDb/doc/asmHubs/trackData.pl src/hg/makeDb/doc/asmHubs/trackData.pl
index bc480df..2b5c23d 100755
--- src/hg/makeDb/doc/asmHubs/trackData.pl
+++ src/hg/makeDb/doc/asmHubs/trackData.pl
@@ -139,70 +139,70 @@
 my $subSetMessage = "subset of $asmHubName only";
 if ($asmHubName eq "vertebrate") {
    $subSetMessage = "subset of other ${asmHubName}s only";
 }
 
 if ($vgpIndex) {
   my $vgpSubset = "(set of primary assemblies)";
   if ($orderList =~ m/vgp.alternate/) {
      $vgpSubset = "(set of alternate/haplotype assemblies)";
   } elsif ($orderList =~ m/vgp.trio/) {
      $vgpSubset = "(set of trio assemblies, maternal/paternal)";
   } elsif ($orderList =~ m/vgp.legacy/) {
      $vgpSubset = "(set of legacy/superseded assemblies)";
   }
   print <<"END"
-<!DOCTYPE HTML 4.01 Transitional>
+<!DOCTYPE HTML>
 <!--#set var="TITLE" value="VGP - Vertebrate Genomes Project assembly hubs, track statistics" -->
 <!--#set var="ROOT" value="../.." -->
 
 <!--#include virtual="\$ROOT/inc/gbPageStartHardcoded.html" -->
 
 <h1>VGP - Vertebrate Genomes Project assembly hubs, track statistics</h1>
 <p>
 <a href='https://vertebrategenomesproject.org/' target=_blank>
 <img src='VGPlogo.png' width=280 alt='VGP logo'></a></p>
 <p>
 This assembly hub contains assemblies released
 by the <a href='https://vertebrategenomesproject.org/' target=_blank>
 Vertebrate Genomes Project.</a> $vgpSubset
 </p>
 
 END
 } else {
   if ($hprcIndex) {
     print <<"END"
-<!DOCTYPE HTML 4.01 Transitional>
+<!DOCTYPE HTML>
 <!--#set var="TITLE" value="HPRC - Human Pangenome Reference Consortium assembly hubs, track statistics" -->
 <!--#set var="ROOT" value="../.." -->
 
 <!--#include virtual="\$ROOT/inc/gbPageStartHardcoded.html" -->
 
 <h1>HPRC - Human Pangenome Reference Consortium assembly hubs, track statistics</h1>
 <p>
 <a href='https://humanpangenome.org/' target=_blank>
 <img src='HPRC_logo.png' width=280 alt='HPRC logo'></a></p>
 <p>
 This assembly hub contains assemblies released
 by the <a href='https://humanpangenome.org/' target=_blank>
 Human Pangenome Reference Consortium.</a>
 </p>
 
 END
   } else {
     print <<"END"
-<!DOCTYPE HTML 4.01 Transitional>
+<!DOCTYPE HTML>
 <!--#set var="TITLE" value="$Name genomes assembly hubs, track statistics" -->
 <!--#set var="ROOT" value="../.." -->
 
 <!--#include virtual="\$ROOT/inc/gbPageStartHardcoded.html" -->
 
 <h1>$Name Genomes assembly hubs, track statistics</h1>
 <p>
 Assemblies from NCBI/Genbank/Refseq sources, $subSetMessage.
 </p>
 
 END
   }
 }
   my $indexUrl = "index";
   my $asmStats = "asmStats";
@@ -219,31 +219,31 @@
 }	#	sub startHtml()
 
 # order of columns in the table
 # eliminated the ncbiGene track
 my @trackList = qw(ncbiRefSeq xenoRefGene augustus ensGene gc5Base allGaps assembly rmsk simpleRepeat windowMasker cpgIslandExtUnmasked);
 ### XXX beware, this trackList is going to be edited below to add or
 ###             remove elements depending upon the situation
 
 ##############################################################################
 ### start the table output
 ##############################################################################
 sub startTable() {
 
 # coordinate the order of these column headings with the @trackList listed above
 
-print '<table class="sortable" border="1">
+print '<table class="sortable" style="border: 1px solid black;">
 <thead style="position:sticky; top:0;"><tr><th>count</th>
   <th>common name<br>link&nbsp;to&nbsp;genome&nbsp;browser</th>
 ';
   print '<th class="sorttable_numeric">ncbiRefSeq</th>
 ' if ("viral" ne $asmHubName);
 
 print "  <th class=\"sorttable_numeric\">ncbiGene</th>\n" if ($testOutput || ("viral" eq $asmHubName));
 
 print '  <th class="sorttable_numeric">xenoRefGene</th>
   <th class="sorttable_numeric">augustus<br>genes</th>
   <th class="sorttable_numeric">Ensembl<br>genes</th>
 ' if ("viral" ne $asmHubName);
 
 print '  <th class="sorttable_numeric">gc5 base</th>
 ';
@@ -285,31 +285,31 @@
 my $commaGapSize = commify($overallGapSize);
 my $commaGapCount = commify($overallGapCount);
 
 my $percentDone = 100.0 * $asmCount / $assemblyTotal;
 my $doneMsg = "";
 if ($asmCount < $assemblyTotal) {
   $doneMsg = sprintf(" (%d build completed, %.2f %% finished)", $asmCount, $percentDone);
 }
 my $columnCount = scalar(@trackList);
 my $colSpanFill = $columnCount - 1;
 
 if ($assemblyTotal > 1) {
   print <<"END"
 
 </tbody>
-<tfoot><tr><th>TOTALS:</th><td align=center colspan=$colSpanFill>total assembly count&nbsp;${assemblyTotal}${doneMsg}</td>
+<tfoot><tr><th>TOTALS:</th><td style='text-align: center;' colspan=$colSpanFill>total assembly count&nbsp;${assemblyTotal}${doneMsg}</td>
   </tr></tfoot>
 </table>
 END
 } else {
   print <<"END"
 
 </tbody>
 </table>
 END
 }
 }	#	sub endTable()
 
 ##############################################################################
 ### end the HTML output
 ##############################################################################
@@ -429,33 +429,33 @@
      $buildDir = "/hive/data/genomes/asmHubs/genbankBuild/$accessionDir/$asmId";
        }
        $asmReport="$buildDir/download/${asmId}_assembly_report.txt";
        $chromSizes = "${buildDir}/${asmId}.chrom.sizes";
        $twoBit = "${buildDir}/trackData/addMask/${asmId}.masked.2bit";
        $faSizeTxt = "${buildDir}/${asmId}.faSize.txt";
     }
 #    my $trackDb="$buildDir/${asmId}.trackDb.txt";
 #    next if (! -s "$trackDb");	# assembly build not complete
     if (! -s "$asmReport") {
       printf STDERR "# no assembly report:\n# %s\n", $asmReport;
       next;
     }
     if (! -s "$twoBit") {
       printf STDERR "# no 2bit file:\n# %s\n", $twoBit;
-      printf "<tr><td align=right>%d</td>\n", ++$asmCount;
-      printf "<td align=center>%s</td>\n", $accessionId;
-      printf "<th colspan=15 align=center>missing masked 2bit file</th>\n";
+      printf "<tr><td style='text-align: right;'>%d</td>\n", ++$asmCount;
+      printf "<td style='text-align: center;'>%s</td>\n", $accessionId;
+      printf "<th colspan=15 style='text-align: center;'>missing masked 2bit file</th>\n";
       printf "</tr>\n";
       next;
     }
     if ( ! -s "$faSizeTxt" ) {
        printf STDERR "twoBitToFa $twoBit stdout | faSize stdin > $faSizeTxt\n";
        print `twoBitToFa $twoBit stdout | faSize stdin > $faSizeTxt`;
     }
     my ($gapSize, $maskPerCent, $sizeNoGaps) = maskStats($faSizeTxt);
     $overallGapSize += $gapSize;
     my ($seqCount, $totalSize) = asmCounts($chromSizes);
     $overallSeqCount += $seqCount;
     $overallNucleotides += $totalSize;
     my $gapCount = gapStats($buildDir, $asmId);
     $overallGapCount += $gapCount;
     my $sciName = "notFound";
@@ -490,32 +490,32 @@
     close (FH);
     my $hubUrl = "https://hgdownload.soe.ucsc.edu/hubs/$accessionDir/$accessionId";
     my $browserName = $commonName;
     my $browserUrl = "https://genome.ucsc.edu/h/$accessionId";
     if ($asmId !~ m/^GC/) {
        $hubUrl = "https://hgdownload.soe.ucsc.edu/goldenPath/$asmId/bigZips";
        $browserUrl = "https://genome.ucsc.edu/cgi-bin/hgTracks?db=$asmId";
        $browserName = "$commonName ($asmId)";
        if ($testOutput) {
          $browserUrl = "https://genome-test.gi.ucsc.edu/cgi-bin/hgTracks?db=$asmId";
          $hubUrl = "https://hgdownload-test.gi.ucsc.edu/goldenPath/$asmId/bigZips";
        }
     } elsif ($testOutput) {
       $browserUrl = "https://genome-test.gi.ucsc.edu/h/$accessionId";
     }
-    printf "<tr><td align=right>%d</td>\n", ++$asmCount;
-    printf "<td align=center><a href='%s' target=_blank>%s<br>%s</a></td>\n", $browserUrl, $browserName, $accessionId;
+    printf "<tr><td style='text-align: right;'>%d</td>\n", ++$asmCount;
+    printf "<td style='text-align: center;'><a href='%s' target=_blank>%s<br>%s</a></td>\n", $browserUrl, $browserName, $accessionId;
     foreach my $track (@trackList) {
       my $trackFile = "$buildDir/bbi/$asmId.$track";
       my $trackFb = "$buildDir/trackData/$track/fb.$asmId.$track.txt";
       # no ensGene file ?  Then look for ebiGene file
       if ($track eq "ensGene" && ! -s $trackFb) {
         if ( -d "$buildDir/trackData/ebiGene" ) {
           $trackFb = "$buildDir/trackData/ebiGene/fb.ebiGene.txt" if ( -d "$buildDir/trackData/ebiGene/fb.ebiGene.txt");
           $trackFile = "$buildDir/bbi/$asmId.ebiGene";
         }
       }
       my $runDir = "$buildDir/trackData/$track";
       my ($itemCount, $percentCover);
       my $customKey = "";
       if ($asmId !~ m/^GC/) {
         $itemCount = "n/a";
@@ -613,36 +613,36 @@
               ($itemCount, $percentCover) = oneTrackData($asmId, "ebiGene", $trackFile, $totalSize, $trackFb, $runDir);
             } elsif ($track eq "ncbiRefSeq" && $itemCount eq "n/a") {
             # if track ncbiRefSeq does not exist, try the ncbiGene track
               $runDir = "$buildDir/trackData/ncbiGene";
               $trackFile = "$buildDir/bbi/$asmId.$track.bb";
               ($itemCount, $percentCover) = oneTrackData($asmId, "ncbiGene", $trackFile, $totalSize, $trackFb, $runDir);
             }
           }
 	}	#       else not the rmsk track
       }		#       else if ($asmId !~ m/^GC/)
       if (($percentCover =~ m/%/) || ($percentCover !~ m#n/a#)) {
         $customKey = $percentCover;
         $customKey =~ s/[ %]+//;
       }
       if (length($customKey)) {
-        printf "    <td align=right sorttable_customkey='%s'>%s<br>(%s)</td>\n", $customKey, $itemCount, $percentCover;
+        printf "    <td style='text-align: right;' sorttable_customkey='%s'>%s<br>(%s)</td>\n", $customKey, $itemCount, $percentCover;
       } else {
         if ($itemCount eq "n/a") {
-      printf "    <td align=right>n/a</td>\n";
+      printf "    <td style='text-align: right;'>n/a</td>\n";
         } else {
-      printf "    <td align=right>%s<br>(%s)</td>\n", $itemCount, $percentCover;
+      printf "    <td style='text-align: right;'>%s<br>(%s)</td>\n", $itemCount, $percentCover;
         }
       }
       $tracksCounted += 1 if ($itemCount ne "n/a");
     }	#	foreach my $track (@trackList)
     printf "</tr>\n";
     $asmCounted += 1;
     if ($asmId =~ m/^GC/) {
        printf STDERR "# %03d\t%02d tracks\t%s\n", $asmCounted, $tracksCounted, $asmId;
     } else {
        printf STDERR "# %03d\t%02d tracks\t%s_%s (%s)\n", $asmCounted, $tracksCounted, $accessionId, $asmName, $asmId;
     }
   }
 }
 
 ##############################################################################