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/mkAsmStats.pl src/hg/makeDb/doc/asmHubs/mkAsmStats.pl index c6154f9..eaafb3c 100755 --- src/hg/makeDb/doc/asmHubs/mkAsmStats.pl +++ src/hg/makeDb/doc/asmHubs/mkAsmStats.pl @@ -10,61 +10,63 @@ printf STDERR "e.g.: mkAsmStats Mammals mammals\n"; exit 255; } 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 } ############################################################################## ### 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, assembly statistics" --> <!--#set var="ROOT" value="../.." --> <!--#include virtual="\$ROOT/inc/gbPageStartHardcoded.html" --> <h1>VGP - Vertebrate Genomes Project assembly hubs, assembly 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> @@ -144,31 +146,33 @@ 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"; printf "<tr><th colspan=6 style='text-align:center;'>Additional hubs with collections of assemblies</th></tr>\n"; printf "<tr><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"; @@ -322,31 +326,31 @@ } close (FH); my $hubUrl = "https://hgdownload.soe.ucsc.edu/hubs/$accessionDir/$accessionId"; printf "<tr><td align=right>%d</td>\n", ++$asmCount; # printf "<td align=center><a href='https://genome.ucsc.edu/cgi-bin/hgGateway?hubUrl=%s/hub.txt&genome=%s&position=lastDbPos' target=_blank>%s</a></td>\n", $hubUrl, $accessionId, $commonName; printf "<td align=center><a href='https://genome.ucsc.edu/h/%s' target=_blank>%s</a></td>\n", $accessionId, $commonName; printf " <td align=center><a href='%s/' target=_blank>%s</a></td>\n", $hubUrl, $sciName; printf " <td align=left><a href='https://www.ncbi.nlm.nih.gov/assembly/%s/' target=_blank>%s</a></td>\n", $accessionId, $asmId; printf " <td align=right>%s</td>\n", commify($seqCount); printf " <td align=right>%s</td>\n", commify($totalSize); printf " <td align=right>%s</td>\n", commify($gapCount); printf " <td align=right>%s</td>\n", commify($gapSize); printf " <td align=right>%.2f</td>\n", $maskPerCent; printf "</tr>\n"; } -} +} # sub tableContents() ############################################################################## ### main() ############################################################################## open (FH, "<$toolsDir/${commonNameOrder}") or die "can not read ${commonNameOrder}"; while (my $line = <FH>) { next if ($line =~ m/^#/); chomp $line; my ($commonName, $asmId) = split('\t', $line); push @orderList, $asmId; $betterName{$asmId} = $commonName; ++$assemblyTotal; } close (FH);