2c720ad5f45b1111583f17a95b58cc9750f4c5c5 hiram Tue Aug 6 09:44:15 2019 -0700 fixup links to hgdownload for AGP and JPG image refs #23734 diff --git src/hg/utils/automation/asmHubGatewayPage.pl src/hg/utils/automation/asmHubGatewayPage.pl index 0d4eca3..5f0d543 100755 --- src/hg/utils/automation/asmHubGatewayPage.pl +++ src/hg/utils/automation/asmHubGatewayPage.pl @@ -144,36 +144,39 @@ if ( -s $jpgImage ) { $imageSize = `identify $jpgImage | awk '{print \$3}'`; chomp $imageSize; ($imageWidth, $imageHeight) = split('x', $imageSize); $imageName = basename($jpgImage); } } # transform this path name into a chrom.sizes reference my $thisDir = `pwd`; chomp $thisDir; printf STDERR "# thisDir $thisDir\n"; my $ftpName = dirname($thisDir); my $asmId = basename($ftpName);; +my ($gcXPrefix, $accession, $rest) = split('_', $asmId, 3); +my $newStyleUrl = sprintf("%s/%s/%s/%s/%s", $gcXPrefix, substr($accession,0,3), + substr($accession,3,3), substr($accession,6,3), $asmId); $ftpName =~ s#/hive/data/outside/ncbi/##; $ftpName =~ s#/hive/data/inside/ncbi/##; $ftpName =~ s#/hive/data/genomes/asmHubs/##; printf STDERR "# ftpName $ftpName\n"; -my $urlDirectory = `basename $ftpName`; -chomp $urlDirectory; +# my $urlDirectory = `basename $ftpName`; +# chomp $urlDirectory; my $speciesSubgroup = $ftpName; my $asmType = "genbank"; $asmType = "refseq" if ( $speciesSubgroup =~ m#refseq/#); $speciesSubgroup =~ s#genomes/$asmType/##;; $speciesSubgroup =~ s#/.*##;; my %taxIdCommonName; # key is taxId, value is common name # from NCBI taxonomy database dump open (FH, "<$ENV{'HOME'}/kent/src/hg/utils/automation/genbank/taxId.comName.tab") or die "can not read taxId.comName.tab"; while (my $line = ) { chomp $line; my ($taxId, $comName) = split('\t', $line); $taxIdCommonName{$taxId} = $comName; } close (FH); @@ -265,81 +268,81 @@ 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, $asmId, $imageName, $imageWidth, $imageHeight, $commonName, $orgName, $photoCreditURL, $photoCreditName; +\n", $imageWidth+$imageWidthBorder, $imageHeight, $asmAccession, $sourceServer, $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, - $asmLevel, $bioSample, $bioSample, $asmAccession, $asmAccession, $urlDirectory, $urlDirectory; + $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/
 
   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\" \\
-       http://$sourceServer/hubs/VGP/genomes/$asmId/
+       https://$sourceServer/hubs/VGP/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
 genomesFile $asmId.genomes.txt
 email yourEmail\@yourdomain.edu
 descriptionUrl html/$asmId.description.html