dcc09e71de2cb1f61a19f0526e0595ceb8277bb3 hiram Fri Feb 25 10:43:00 2022 -0800 adding cell background coloring for the IUCN column and tri-state indication on the hideAll buttons refs #28930 diff --git src/hg/gar/garTable.pl src/hg/gar/garTable.pl index 3592cfa..627318a 100755 --- src/hg/gar/garTable.pl +++ src/hg/gar/garTable.pl @@ -159,30 +159,33 @@ # Giraffa camelopardalis antiquorum -> Giraffa camelopardalis # Giraffa camelopardalis rothschildi -> Giraffa camelopardalis printf STDERR "### reading iucnToNcbiEquivalent.txt\n"; open (FH, "<../iucnToNcbiEquivalent.txt") or die "can not read iucnToNcbiEquivalent.txt"; while (my $line = ) { chomp $line; my ($ncbiName, $iucnName) = split('\t', $line); $ncbiToIucnNames{$ncbiName} = $iucnName; } close (FH); my $criticalColor = "#ff0000"; my $endangeredColor = "#dd6600"; my $vulnerableColor = "#663300"; +$criticalColor = "#ee3333"; +$endangeredColor = "#333388"; +$vulnerableColor = "#88aaaa"; my %statusColors = ( "CR" => $criticalColor, "EN" => $endangeredColor, "VU" => $vulnerableColor, ); my %iucnCR; # key is scientific name, value is 1 == Critically Endangered my %iucnEN; # key is scientific name, value is 1 == Endangered my %iucnVU; # key is scientific name, value is 1 == Vulnerable my %iucnSciNames; # key is scientific name, value is IUCN code CR EN VU my $iucnSpeciesCount = 0; my $iucnCount = 0; printf STDERR "### reading iucn/IUCN.CR.txt\n"; @@ -786,42 +789,42 @@ printf "\n"; printf "\n"; printf "\n"; printf "\n"; printf "\n"; printf "\n"; printf "\n"; printf "\n"; printf "\n"; printf "\n"; printf "\n"; printf "\n"; printf "\n"; printf "\n"; -printf "
common nameLinks to an existing assembly browser, Button opens an assembly request form.
\n"; -printf "
scientific name (count)Links to Google image search. Count shows the number of assemblies available for this orgnism.
\n"; -printf "
NCBI assemblyLinks to NCBI resource record.
\n"; -printf "
assembly
sizeNumber of nucleotides in the assembly.
\n"; -printf "
sequence
countThe number of sequences in this assembly.
\n"; -printf "
scaffold N50
length (L50)N50 (L50) length.
\n"; -printf "
contig N50
length (L50)N50 (L50) length.
\n"; -printf "
IUCNLinks to IUCN Red List of Threatened Species (version 2021-3) CR - Critical / EN - Endangered / VU - Vulnerable
\n", $statusColors{"CR"}, $statusColors{"EN"}, $statusColors{"VU"}; -printf "
NCBI taxIDLinks to NCBI Taxonomy database.
\n"; -printf "
assembly
dateDate submitted to NCBI assembly database.
\n"; -printf "
Assembly submitterPerson or group who submitted to <NCBI Assembly database.
\n"; -printf "
cladeClade of this organism. Note: the invertebrate clade is a catch all category that includes organisims not typically classified as invertebrate
\n"; +printf "
common nameLinks to an existing assembly browser, Button opens an assembly request form.
\n"; +printf "
scientific name (count)Links to Google image search. Count shows the number of assemblies available for this orgnism.
\n"; +printf "
NCBI assemblyLinks to NCBI resource record.
\n"; +printf "
assembly
sizeNumber of nucleotides in the assembly.
\n"; +printf "
sequence
countThe number of sequences in this assembly.
\n"; +printf "
scaffold N50
length (L50)N50 (L50) length.
\n"; +printf "
contig N50
length (L50)N50 (L50) length.
\n"; +printf "
IUCNLinks to IUCN Red List of Threatened Species (version 2021-3) CR - Critical / EN - Endangered / VU - Vulnerable
\n", $statusColors{"CR"}, $statusColors{"EN"}, $statusColors{"VU"}; +printf "
NCBI taxIDLinks to NCBI Taxonomy database.
\n"; +printf "
assembly
dateDate submitted to NCBI assembly database.
\n"; +printf "
Assembly submitterPerson or group who submitted to NCBI Assembly database.
\n"; +printf "
cladeClade of this organism. Note: the invertebrate clade is a catch all category that includes organisims not typically classified as invertebrate
\n"; printf "\n"; printf "\n"; my %equivalentNamesUsed; # key is NCBI sciName, value is IUCN sciName my $pageSectionCount = 0; my %checkDupAsmId; # key is asmId, value is count of times seen my %cladeSciNameCounts; # key is clade, value is number of different # scientific names my %gcfGcaCounts; # key is GCF or GCA, value is count of each my $asmCountInTable = 0; # counting the rows output my %statusCounts; # key is status: CR EN VU, value is count my $totalAssemblySize = 0; # sum of all assembly sizes @@ -1017,34 +1020,37 @@ ### can override CSS settings here ### $rowClass = " class='gar' style='display: none;'"; ############# obsolete first column, a running count, and establish row color ### if ( 0 == 1 ) { if (length($statusColor)) { printf "%d", $rowClass, $statusColor, $asmCountInTable; } else { printf "%d", $rowClass, $asmCountInTable; } } # 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 "", $rowClass, $statusColor; + printf "", $rowClass, $statusClass; } else { - printf "", $rowClass, $statusColor; + printf "", $rowClass, $statusClass; } } else { if ($asmCountInTable > 500) { printf "", $rowClass; } else { printf "", $rowClass; } } ############# first column, common name link to browser or request button ## if (defined($comName{$asmId})) { printf "%s", $browserUrl, $commonName; } else { if (length($ucscDb)) { printf "%s", $browserUrl, $commonName; } else { @@ -1092,33 +1098,33 @@ } else { printf " "; printf PC "\t%s", "n/a"; # output to clade.tableData.txt } ############# sixth, seventh columns, N50 for scaffold, contig ############## if ($n50ScaffoldSize > 0 ) { n50Cell($n50ScaffoldSize, $n50ScaffoldCount, \*PC); } else { # substitute assembly N50 when no scaffold N50 available n50Cell($n50Size, $n50Count, \*PC); } n50Cell($n50ContigSize, $n50ContigCount, \*PC); ############# eighth column, IUCN status and link ################ if (length($iucnLink) > 0) { - printf "%s", $iucnLink, $iucnStatus; + printf "%s", $iucnStatus, $iucnLink, $iucnStatus; } else { - printf "%s", $iucnStatus; + printf "%s", $iucnStatus; } printf PC "\t%s", $iucnStatus; # output to clade.tableData.txt ############# ninth column, taxId and link to NCBI ################ if (defined($asmTaxId{$asmId})) { my $taxUrl = "https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=$asmTaxId{$asmId}"; printf "%s", $taxUrl, $asmTaxId{$asmId}; printf PC "\t%s", $asmTaxId{$asmId}; # output to clade.tableData.txt } else { printf "n/a"; printf PC "\t%s", "n/a"; # output to clade.tableData.txt } ############# tenth column, assembly date ################ if (defined($asmDate{$asmId})) {