d902053614e1eeeb5e84d4acf1dc4a2abb7120f8 hiram Fri Jan 3 13:47:38 2020 -0800 get the gateway page a bit more generic with argument to specify refs #20137 diff --git src/hg/utils/automation/asmHubGatewayPage.pl src/hg/utils/automation/asmHubGatewayPage.pl index 5f0d543..b1e9087 100755 --- src/hg/utils/automation/asmHubGatewayPage.pl +++ src/hg/utils/automation/asmHubGatewayPage.pl @@ -1,30 +1,30 @@ #!/usr/bin/env perl use strict; use warnings; use FindBin qw($Bin); use lib "$Bin"; use AsmHub; use File::Basename; my $sourceServer = "hgdownload.soe.ucsc.edu"; my @months = qw( 0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ); sub usage() { - printf STDERR "usage: asmHubGatewayPage.pl /*assembly_report.txt /asmId.chrom.sizes /image.jpg /photoCredits.txt\n"; + printf STDERR "usage: asmHubGatewayPage.pl /*assembly_report.txt /asmId.chrom.sizes /image.jpg /photoCredits.txt\n"; printf STDERR "output is to stdout, redirect to file: > description.html\n"; printf STDERR "photoCredits.txt is a two line tagstring file:\n"; printf STDERR "tags: photoCreditURL and photoCreditName\n"; printf STDERR "use string 'noPhoto' for image and credits when no photo\n"; exit 255; } sub chromSizes($) { my ($sizeFile) = @_; if ( -s $sizeFile ) { printf STDERR "# reading chrom.sizes file:\n#\t'%s\'\n", $sizeFile; my $ix = 0; my $contigCount = 0; my %sizes; # key is contigName, value is size @@ -81,35 +81,35 @@ } } else { printf STDERR "# error: can not find chrom.sizes file:\n#\t'%s\'\n", $sizeFile; } } # typical reference: # ${inside}/scripts/gatewayPage.pl ${outside}/${asmReport} \ # > "${inside}/${D}/${B}.description.html" \ # 2> "${inside}/${D}/${B}.names.tab" my $argc = scalar(@ARGV); -if ($argc != 4) { +if ($argc != 5) { usage; } -my ($asmReport, $chromSizes, $jpgImage, $photoCredits) = @ARGV; +my ($asmHubName, $asmReport, $chromSizes, $jpgImage, $photoCredits) = @ARGV; if ( ! -s $asmReport ) { printf STDERR "ERROR: can not find '$asmReport'\n"; usage; } if ( ! -s $chromSizes ) { printf STDERR "ERROR: can not find '$chromSizes'\n"; usage; } if ($jpgImage ne "noPhoto") { if ( ! -s $jpgImage ) { printf STDERR "ERROR: can not find '$jpgImage'\n"; usage; } if ( ! -s $photoCredits ) { printf STDERR "ERROR: can not find '$photoCredits'\n"; @@ -268,93 +268,94 @@ printf STDERR "%s\t", $asmName; printf STDERR "%s\t", $orgName; printf STDERR "%s\t", $bioSample; printf STDERR "%s\t", $descrAsmType; printf STDERR "%s\t", $asmLevel; printf STDERR "%s\t", $asmDate; printf STDERR "%s\n", $asmAccession; # printf "\n", $asmId; if (length($imageName)) { printf "
- \"%s\" + \"%s\"
%s
(Photo courtesy of %s)
-\n", $imageWidth+$imageWidthBorder, $imageHeight, $asmAccession, $sourceServer, $asmId, $imageName, $imageWidth, $imageHeight, $commonName, $orgName, $photoCreditURL, $photoCreditName; +\n", $imageWidth+$imageWidthBorder, $imageHeight, $asmAccession, $sourceServer, $asmHubName, $asmId, $imageName, $imageWidth, $imageHeight, $commonName, $orgName, $photoCreditURL, $photoCreditName; } my $sciNameUnderscore = $orgName; $sciNameUnderscore =~ s/ /_/g; $sciNameUnderscore = "Strigops_habroptilus" if ($orgName =~ m/Strigops habroptila/); printf "

Common name: %s
Taxonomic name: %s, taxonomy ID: %s
Sequencing/Assembly provider ID: %s
-Vertebrate Genomes Project information: %s
Assembly date: %s
Assembly type: %s
Assembly level: %s
Biosample: %s
Assembly accession ID: %s
Assembly FTP location: %s
-\n", $commonName, $orgName, $taxId, $taxId, $submitter, $sciNameUnderscore, $orgName, $asmDate, $descrAsmType, +\n", $commonName, $orgName, $taxId, $taxId, $submitter, $asmDate, $descrAsmType, $asmLevel, $bioSample, $bioSample, $asmAccession, $asmAccession, $newStyleUrl, $newStyleUrl; chromSizes($chromSizes); printf "

\n

Download files for this assembly hub:
To use the data from this assembly for a local hub instance at your institution, download these data as indicated by these instructions.
See also: track hub help documentation.

To download this assembly data, use this rsync command:

-  rsync -a -P rsync://$sourceServer/hubs/VGP/genomes/$asmId/ ./$asmId/
+  rsync -a -P \\
+    rsync://$sourceServer/hubs/$asmHubName/genomes/$asmId/ \\
+      ./$asmId/
 
   which creates the local directory: ./$asmId/
 
or this wget command:
   wget --timestamping -m -nH -x --cut-dirs=4 -e robots=off -np -k \\
     --reject \"index.html*\" -P \"$asmId\" \\
-       https://$sourceServer/hubs/VGP/genomes/$asmId/
+       https://$sourceServer/hubs/$asmHubName/genomes/$asmId/
 
   which creates a local directory: ./$asmId/
 

There is an included $asmId.genomes.txt file in that download data to use for your local track hub instance.
You will need to add a hub.txt file to point to this genomes.txt file.
Something like:
 hub myLocalHub
 shortLabel myLocalHub
-longLabel genomes from Vertebrate Genomes Project assemblies
+longLabel genome assembly $asmId
 genomesFile $asmId.genomes.txt
 email yourEmail\@yourdomain.edu
 descriptionUrl html/$asmId.description.html
 
The html/$asmId.description.html page is information for your users to describe this assembly. This WEB page with these instructions is an instance of html/$asmId.description.html file.

\n"; printf "

To operate a blat server on this assembly, in the directory where you have the $asmId.2bit file:

 gfServer -log=%s.gfServer.trans.log -ipLog -canStop start \\