a3221ce060e8efe2e9ef46392625606896f64f96 hiram Fri May 8 23:06:59 2020 -0700 do not print links to other assembly hubs from VGP index pages refs #23734 diff --git src/hg/makeDb/doc/asmHubs/trackData.pl src/hg/makeDb/doc/asmHubs/trackData.pl index 24e7666..71fe9ff 100755 --- src/hg/makeDb/doc/asmHubs/trackData.pl +++ src/hg/makeDb/doc/asmHubs/trackData.pl @@ -25,30 +25,32 @@ if ($spliceOut != -1) { splice @ARGV, $spliceOut, 1; } my $Name = shift; my $asmHubName = shift; my $home = $ENV{'HOME'}; my $toolsDir = "$home/kent/src/hg/makeDb/doc/asmHubs"; my $commonNameList = "$asmHubName.asmId.commonName.tsv"; my $commonNameOrder = "$asmHubName.commonName.asmId.orderList.tsv"; my @orderList; # asmId of the assemblies in order from the *.list files # the order to read the different .list files: my %betterName; # key is asmId, value is better common name than found in # assembly_report +my $vgpIndex = 0; +$vgpIndex = 1 if ($Name =~ m/vgp/i); my $assemblyTotal = 0; # complete list of assemblies in this group my $asmCount = 0; # count of assemblies completed and in the table my $overallNucleotides = 0; my $overallSeqCount = 0; my $overallGapSize = 0; my $overallGapCount = 0; ############################################################################## # from Perl Cookbook Recipe 2.17, print out large numbers with comma delimiters: ############################################################################## sub commify($) { my $text = reverse $_[0]; $text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g; return scalar reverse $text @@ -103,31 +105,31 @@ } ############################################################################## ### start the HTML output ############################################################################## sub startHtml() { my $timeStamp = `date "+%F"`; chomp $timeStamp; my $subSetMessage = "subset of $asmHubName only"; if ($asmHubName eq "vertebrate") { $subSetMessage = "subset of other ${asmHubName}s only"; } -if ($Name =~ m/vgp/i) { +if ($vgpIndex) { print <<"END" <!DOCTYPE HTML 4.01 Transitional> <!--#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> @@ -216,54 +218,62 @@ print "</tr></thead><tbody>\n"; } # sub startTable() ############################################################################## ### end the table output ############################################################################## sub endTable() { my $commaNuc = commify($overallNucleotides); my $commaSeqCount = commify($overallSeqCount); 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=13>total assembly count ${assemblyTotal}</td> +<tfoot><tr><th>TOTALS:</th><td align=center colspan=$colSpanFill>total assembly count ${assemblyTotal}${doneMsg}</td> </tr></tfoot> </table> END } else { print <<"END" </tbody> </table> END } } # sub endTable() ############################################################################## ### end the HTML output ############################################################################## sub endHtml() { -if ($asmHubName ne "viral") { +# do not print these links for VGP index + +if ((0 == $vgpIndex) && ($asmHubName ne "viral")) { printf "<p>\n<table border='1'><thead>\n<tr>"; printf "<th>Assembly hubs index pages: </th>\n"; printf "<th><a href='../primates/index.html'>Primates</a></th>\n"; printf "<th><a href='../mammals/index.html'>Mammals</a></th>\n"; printf "<th><a href='../birds/index.html'>Birds</a></th>\n"; printf "<th><a href='../fish/index.html'>Fish</a></th>\n"; printf "<th><a href='../vertebrate/index.html'>other vertebrates</a></th>\n"; printf "</tr><tr>\n"; printf "<th>Hubs assembly statistics: </th>\n"; printf "<th><a href='../primates/asmStats.html'>Primates</a></th>\n"; printf "<th><a href='../mammals/asmStats.html'>Mammals</a></th>\n"; printf "<th><a href='../birds/asmStats.html'>Birds</a></th>\n"; printf "<th><a href='../fish/asmStats.html'>Fish</a></th>\n"; printf "<th><a href='../vertebrate/asm.html'>other vertebrates</a></th>\n";