d10d359c47f9f4a1245111f8b75b4c25c483c9ee hiram Tue May 10 14:52:17 2022 -0700 fixup some types for cleaner html vs. W3C validator no redmine diff --git src/hg/gar/garTable.pl src/hg/gar/garTable.pl index 962b4b5..9f3b2b6 100755 --- src/hg/gar/garTable.pl +++ src/hg/gar/garTable.pl @@ -567,36 +567,34 @@ open (FH, "cut -f1 ${refSeq} ${genBank} ${asmHubTsv}|sort -u|") or die "can not read $refSeq or $genBank or $asmHubTsv"; while (my $asmId = <FH>) { chomp $asmId; $asmId =~ s/\.]/_/g; $asmId =~ s/\:/_/g; $asmId =~ s/\%/_/g; $asmId =~ s/\+/_/g; $asmId =~ s/\//_/g; $asmId =~ s/\#/_/g; # $asmId =~ s/[.:%+/#]/_/g; $asmId =~ s/[()]//g; $asmId =~ s/__/_/g; ++$shouldBeGenArk if (defined($genArkAsm{$asmId})); ++$shouldBeUcsc if (defined($rrGcaGcfList{$asmId})); if (defined ($skipPartialGenome{$asmId})) { - printf STDERR "# skipping genArk %s because skipPartialGenome\n", $asmId if (defined($genArkAsm{$asmId})); - next; + next if (!defined($genArkAsm{$asmId})); } if (defined ($asmSuppressed{$asmId})) { - printf STDERR "# skipping genArk %s because asmSuppressed\n", $asmId if (defined($genArkAsm{$asmId})); - next; + next if (!defined($genArkAsm{$asmId})); } next if (defined ($alreadyDone{$asmId})); # something wrong with these two # GCA_900609255.1_Draft_mitochondrial_genome_of_wild_rice_W1683 # GCA_900609265.1_Draft_mitochondrial_genome_of_wild_rice_W1679 next if ($asmId =~ m/GCA_900609255.1|GCA_900609265.1/); # verify this asmId will pass the asmSize limit if (defined($metaInfo{$asmId})) { my ($asmSize, $asmContigCount, $n50Size, $n50Count, $n50ContigSize, $n50ContigCount, $n50ScaffoldSize, $n50ScaffoldCount) = split('\t', $metaInfo{$asmId}); # if asmSize is below the minimum, don't use it if ($asmSize < $minimalGenomeSize{$clade}) { printf STDERR "# %s underSized 0 %d %s %s < %s\n", $clade, ++$underSized{$clade}, $asmId, commify($asmSize), commify($minimalGenomeSize{$clade}); printf STDERR "# ACK would be genArk assembly %s\n", $asmId if (defined($genArkAsm{$asmId})); printf STDERR "# ACK would be UCSC RR %s\n", $asmId if (defined($rrGcaGcfList{$asmId})); printf STDERR "# ACK metaInfo: %s '%s'\n", $asmId, $metaInfo{$asmId}; @@ -741,48 +739,48 @@ # count all assemblies in all clades my $totalAssemblies = 0; foreach my $c (@clades) { $totalAssemblies += $cladeCounts{$c}; } printf "<!-- to get the pull-down menu items centered together -->\n"; printf "<div style='text-align: center;'><!-- this will cause the next div to center -->\n"; printf " <div style='display: inline-block'>\n"; printf "<div class='pullDownMenu'>\n"; printf " <span id='speciesSelectAnchor'>choose clades to view/hide ▼</span>\n"; printf " <div class='pullDownMenuContent'>\n"; printf " <ul id='checkBoxSpeciesSelect'>\n"; -printf " <li><label><input class='showAll' type='checkbox' onchange='gar.visCheckBox(this)' id='allCheckBox' value='all' checked><span class='showAllLabel'> show all</span></label></li>\n"; +printf " <li><label><input class='showAll' type='checkbox' onchange='gar.visCheckBox(this)' id='allCheckBox0' value='all' checked><span class='showAllLabel'> show all</span></label></li>\n"; printf " <li><label><input class='hideShow' type='checkbox' onchange='gar.visCheckBox(this)' id='primatesCheckBox' value='primates' checked><span id='primatesLabel'> primates</span></label></li>\n"; printf " <li><label><input class='hideShow' type='checkbox' onchange='gar.visCheckBox(this)' id='mammalsCheckBox' value='mammals' checked><span id='mammalsLabel'> mammals</span></label></li>\n"; printf " <li><label><input class='hideShow' type='checkbox' onchange='gar.visCheckBox(this)' id='birdsCheckBox' value='birds' checked><span id='birdsLabel'> birds</span></label></li>\n"; printf " <li><label><input class='hideShow' type='checkbox' onchange='gar.visCheckBox(this)' id='fishCheckBox' value='fish' checked><span id='fishLabel'> fish</span></label></li>\n"; printf " <li><label><input class='hideShow' type='checkbox' onchange='gar.visCheckBox(this)' id='vertebrateCheckBox' value='vertebrate' checked><span id='vertebrateLabel'> vertebrate</span></label></li>\n"; printf " <li><label><input class='hideShow' type='checkbox' onchange='gar.visCheckBox(this)' id='invertebratesCheckBox' value='invertebrates' checked><span id='invertebratesLabel'> invertebrates</span></label></li>\n"; -printf " <li><label><input class='hideShow' type='checkbox' onchange='gar.visCheckBox(this)' id='plantsCheckBox' value='plants' checked><span id='plantsLabel'> plants<span></label></li>\n"; +printf " <li><label><input class='hideShow' type='checkbox' onchange='gar.visCheckBox(this)' id='plantsCheckBox' value='plants' checked><span id='plantsLabel'> plants</span></label></li>\n"; printf " <li><label><input class='hideShow' type='checkbox' onchange='gar.visCheckBox(this)' id='fungiCheckBox' value='fungi' checked><span id='fungiLabel'> fungi</span></label></li>\n"; printf " </ul>\n"; printf " </div>\n"; printf "</div>\n"; printf "<div style='width: 260px;' class='pullDownMenu'>\n"; printf " <span style='text-align: center;' id='assemblyTypeAnchor'>select assembly type to display ▼</span>\n"; printf " <div class='pullDownMenuContent'>\n"; printf " <ul id='checkBoxAssemblyType'>\n"; -printf " <li><label><input class='showAll' type='checkbox' onchange='gar.visCheckBox(this)' id='allCheckBox' value='all' checked><span class='showAllLabel'> show all</span></label></li>\n"; +printf " <li><label><input class='showAll' type='checkbox' onchange='gar.visCheckBox(this)' id='allCheckBox1' value='all' checked><span class='showAllLabel'> show all</span></label></li>\n"; printf " <li><label><input class='hideShow' type='checkbox' onchange='gar.visCheckBox(this)' id='gakCheckBox' value='gak' checked><span id='gakLabel'> Existing browser</span></label></li>\n"; printf " <li><label><input class='hideShow' type='checkbox' onchange='gar.visCheckBox(this)' id='garCheckBox' value='gar' checked><span id='garLabel'> Request browser</span></label></li>\n"; printf " <li><label><input class='hideShow' type='checkbox' onchange='gar.visCheckBox(this)' id='gcaCheckBox' value='gca' checked><span id='gcaLabel'> GCA/GenBank</span></label></li>\n"; printf " <li><label><input class='hideShow' type='checkbox' onchange='gar.visCheckBox(this)' id='gcfCheckBox' value='gcf' checked><span id='gcfLabel'> GCF/RefSeq</span></label></li>\n"; printf " <li><label><input class='hideShow' type='checkbox' onchange='gar.visCheckBox(this)' id='iucnCheckBox' value='hasIucn' checked><span id='iucnLabel'> IUCN</span></label></li>\n"; printf " </ul>\n"; printf " </div>\n"; printf "</div>\n"; printf "<div style='width: 240px;' class='pullDownMenu'>\n"; printf " <span id='columnSelectAnchor'>show/hide columns ▼</span>\n"; printf " <div class='pullDownMenuContent'>\n"; printf " <ul id='checkBoxColumnSelect'>\n"; printf " <li><label><input class='columnCheckBox' type='checkbox' onchange='gar.resetColumnVis(this)' id='comNameCheckBox' value='comName' checked> English common name</label></li>\n"; printf " <li><label><input class='columnCheckBox' type='checkbox' onchange='gar.resetColumnVis(this)' id='sciNameCheckBox' value='sciName' checked> scientific name</label></li>\n"; @@ -804,35 +802,35 @@ printf " </div> <!-- display inline-block to be 'text' centered -->\n"; printf "</div> <!-- this parent div is text-align: center to center children -->\n\n"; printf "<table style='width: 100%%;' class='borderOne' id='loadingStripes'>\n"; printf "<caption><h2>. . . please wait while page loads . . .</h2></caption>\n"; printf "</table>\n\n"; printf "<div style='text-align: center;'><!-- this will cause the next div to center -->\n"; printf " <div style='display: inline-block'>\n\n"; printf "<h2 style='display: none;' id='counterDisplay'>%s total assemblies : use the selection menus to select subsets</h2>\n\n", commify($totalAssemblies); ############################################################################## ## begin single table output, start the table and the header ## -## table starts out as display: hide and will be reset to 'table' after +## table starts out as display: none and will be reset to 'table' after ## page load. Saves a lot of time for Chrome browsers, however the page ## is still not usable until much time later. ############################################################################## -printf "<table style='display: hide;' class='sortable borderOne cladeTable' id='dataTable'>\n"; +printf "<table style='display: none;' class='sortable borderOne cladeTable' id='dataTable'>\n"; printf "<colgroup id='colDefinitions'>\n"; printf "<col id='viewReq' span='1' class=colGViewReq>\n"; printf "<col id='comName' span='1' class=colGComName>\n"; printf "<col id='sciName' span='1' class=colGSciName>\n"; printf "<col id='asmId' span='1' class=colGAsmId>\n"; printf "<col id='asmSize' span='1' class=colGAsmSize>\n"; printf "<col id='seqCount' span='1' class=colGAsmSeqCount>\n"; printf "<col id='scafN50' span='1' class=colGScafN50>\n"; printf "<col id='ctgN50' span='1' class=colGContigN50>\n"; printf "<col id='IUCN' span='1' class=colGIUCN>\n"; printf "<col id='taxId' span='1' class=colGTaxId>\n"; printf "<col id='asmDate' span='1' class=colGAsmDate>\n"; printf "<col id='bioSample' span='1' class=colGBioSample>\n"; printf "<col id='bioProject' span='1' class=colGBioProject>\n"; @@ -1068,31 +1066,31 @@ } } ### can override CSS settings here ### $rowClass = " class='gar' style='display: none;'"; # experiment with hiding all rows over 500 count to see if that helps # chrom browser initial loading performance # try out the table with out any count, just get the row started if (length($statusColor)) { my $statusClass = sprintf(" style='color:%s;", $statusColor); # let's see what nostatus looks like $statusClass = ""; if ($asmCountInTable > 500) { printf "<tr%s%s style='display:none;'>", $rowClass, $statusClass; } else { - printf "<tr%s%s'>", $rowClass, $statusClass; + printf "<tr%s%s>", $rowClass, $statusClass; } } else { if ($asmCountInTable > 500) { printf "<tr%s style='display:none;'>", $rowClass; } else { printf "<tr%s>", $rowClass; } } ############# trying out a first column that is just the button or link ############# first column, common name link to browser or request button ## if (defined($comName{$asmId})) { printf "<th style='text-align:center;'><a href='%s' target=_blank>view</a></th>", $browserUrl; printf PC "\tview"; # output to clade.tableData.tsv printf "<th style='text-align:left;'>%s</th>", $commonName; @@ -1178,41 +1176,41 @@ ############# tenth column, assembly date ################ if (defined($asmDate{$asmId})) { printf "<td style='display:none;'>%s</td>", $asmDate{$asmId}; printf PC "\t%s", $asmDate{$asmId}; # output to clade.tableData.txt } else { printf "<td style='display:none;'>n/a</td>"; printf PC "\t%s", "n/a"; # output to clade.tableData.txt } ############# eleventh column, bioSample ################ if (length($bioSample) && $bioSample !~ m#n/a#) { printf "<td style='display:none; text-align:left;'><a href='https://www.ncbi.nlm.nih.gov/biosample/?term=%s' target=_blank>%s</a></td>", $bioSample, $bioSample; printf PC "\t%s", $bioSample; # output to clade.tableData.txt } else { - printf "<td style='display:none; text-align=left;'> </td>"; + printf "<td style='display:none; text-align:left;'> </td>"; printf PC "\t%s", "n/a"; # output to clade.tableData.txt } ############# twelveth column, bioProject ################ if (length($bioProject) && $bioProject !~ m#n/a#) { printf "<td style='display:none; text-align:left;'><a href='https://www.ncbi.nlm.nih.gov/bioproject/?term=%s' target=_blank>%s</a></td>", $bioProject, $bioProject; printf PC "\t%s", $bioProject; # output to clade.tableData.txt } else { - printf "<td style='display:none; text-align=left;'> </td>"; + printf "<td style='display:none; text-align:left;'> </td>"; printf PC "\t%s", "n/a"; # output to clade.tableData.txt } ############# eleventh column, submitter ################ $asmUrl = "https://www.ncbi.nlm.nih.gov/assembly/$accessionId"; if (defined($asmSubmitter{$asmId})) { my $submitterSortKey = lc($asmSubmitter{$asmId}); $submitterSortKey =~ s/ //g; $submitterSortKey =~ s/[^a-z0-9]//ig; printf "<td sorttable_customkey='%s' style='display:none;'>%s</td>", substr($submitterSortKey,0,20), $asmSubmitter{$asmId}; printf PC "\t%s", $asmSubmitter{$asmId}; # output to clade.tableData.txt } else { printf "<td sorttable_customkey='n/a' style='display:none;'>n/a</td>"; printf PC "\t%s", "n/a"; # output to clade.tableData.txt }