430076e29a82930d89c6290946436fd6781e18f2
hiram
  Thu Mar 17 10:05:04 2022 -0700
adding bpt indexes for 2bit files and correct copy of 2bit file and gfidx files and fixup group titles refs #28961

diff --git src/hg/makeDb/doc/asmHubs/mkGenomes.pl src/hg/makeDb/doc/asmHubs/mkGenomes.pl
index 122303d..b497bb0 100755
--- src/hg/makeDb/doc/asmHubs/mkGenomes.pl
+++ src/hg/makeDb/doc/asmHubs/mkGenomes.pl
@@ -12,59 +12,61 @@
   printf STDERR "the name list is found in \$HOME/kent/src/hg/makeDb/doc/asmHubs/\n";
   printf STDERR "\nthe two columns are 1: asmId (accessionId_assemblyName)\n";
   printf STDERR "column 2: common name for species, columns separated by tab\n";
   printf STDERR "result will write a local asmId.genomes.txt file for each hub\n";
   printf STDERR "and a local asmId.hub.txt file for each hub\n";
   printf STDERR "and a local asmId.groups.txt file for each hub\n";
   printf STDERR "and the output to stdout will be the overall genomes.txt\n";
   printf STDERR "index file for all genomes in the given list\n";
   exit 255;
 }
 
 my $downloadHost = "hgwdev";
 my @blatHosts = qw( dynablat-01 dynablat-01 );
 my @blatPorts = qw( 4040 4040 );
 my $blatHostDomain = ".soe.ucsc.edu";
+my $groupsTxt = `cat ~/kent/src/hg/makeDb/doc/asmHubs/groups.txt`;
 
 ################### writing out hub.txt file, twice ##########################
 sub singleFileHub($$$$$$$$$$) {
   my ($fh1, $fh2, $accessionId, $orgName, $descr, $asmId, $defPos, $taxId, $trackDb, $accessionDir) = @_;
   my @fhN;
   push @fhN, $fh1;
   push @fhN, $fh2;
 
   my $fileCount = 0;
   my @tdbLines;
   open (TD, "<$trackDb") or die "can not read trackDb: $trackDb";
   while (my $tdbLine = <TD>) {
      chomp $tdbLine;
      push @tdbLines, $tdbLine;
   }
   close (TD);
   foreach my $fh (@fhN) {
     printf $fh "hub %s genome assembly\n", $accessionId;
     printf $fh "shortLabel %s\n", $orgName;
     printf $fh "longLabel %s/%s/%s genome assembly\n", $orgName, $descr, $asmId;
     printf $fh "useOneFile on\n";
     printf $fh "email hclawson\@ucsc.edu\n";
     printf $fh "descriptionUrl html/%s.description.html\n", $asmId;
     printf $fh "\n";
     printf $fh "genome %s\n", $accessionId;
     printf $fh "taxId %s\n", $taxId if (length($taxId) > 1);
     printf $fh "groups groups.txt\n";
     printf $fh "description %s\n", $orgName;
     printf $fh "twoBitPath %s.2bit\n", $accessionId;
+    printf $fh "twoBitBptUrl %s.2bit.bpt\n", $accessionId;
     printf $fh "chromSizes %s.chrom.sizes.txt\n", $accessionId;
     printf $fh "chromAlias %s.chromAlias.txt\n", $accessionId;
     printf $fh "organism %s\n", $descr;
     printf $fh "defaultPos %s\n", $defPos;
     printf $fh "scientificName %s\n", $descr;
     printf $fh "htmlPath html/%s.description.html\n", $asmId;
     # until blat server host is ready for hgdownload, avoid these lines
     if ($blatHosts[$fileCount] ne $downloadHost) {
       printf $fh "blat %s%s %s dynamic $accessionDir/$accessionId\n", $blatHosts[$fileCount], $blatHostDomain, $blatPorts[$fileCount];
       printf $fh "transBlat %s%s %s dynamic $accessionDir/$accessionId\n", $blatHosts[$fileCount], $blatHostDomain, $blatPorts[$fileCount];
       printf $fh "isPcr %s%s %s dynamic $accessionDir/$accessionId\n", $blatHosts[$fileCount], $blatHostDomain, $blatPorts[$fileCount];
     }
     printf $fh "\n";
     foreach my $tdbLine (@tdbLines) {
       printf $fh "%s\n", $tdbLine;
@@ -153,30 +155,31 @@
   chomp $taxId;
   my $descr=`grep -i "organism name:" $asmReport | head -1 | sed -e 's#.*organism name: *##i; s# (.*\$##;'`;
   chomp $descr;
   my $orgName=`grep -i "organism name:" $asmReport | head -1 | sed -e 's#.* name: .* (##; s#).*##;'`;
   chomp $orgName;
   if (defined($commonName{$asmId})) {
      $orgName = $commonName{$asmId};
   }
 
   printf "genome %s\n", $accessionId;
   printf "taxId %s\n", $taxId if (length($taxId) > 1);
   printf "trackDb ../%s/%s/trackDb.txt\n", $accessionDir, $accessionId;
   printf "groups groups.txt\n";
   printf "description %s\n", $orgName;
   printf "twoBitPath ../%s/%s/%s.2bit\n", $accessionDir, $accessionId, $accessionId;
+  printf "twoBitBptUrl ../%s/%s/%s.2bit.bpt\n", $accessionDir, $accessionId, $accessionId;
   printf "chromSizes ../%s/%s/%s.chrom.sizes.txt\n", $accessionDir, $accessionId, $accessionId;
   printf "chromAlias ../%s/%s/%s.chromAlias.txt\n", $accessionDir, $accessionId, $accessionId;
   printf "organism %s\n", $descr;
   my $chrName=`head -1 $buildDir/$asmId.chrom.sizes | awk '{print \$1}'`;
   chomp $chrName;
   my $bigChrom=`head -1 $buildDir/$asmId.chrom.sizes | awk '{print \$NF}'`;
   chomp $bigChrom;
   my $oneThird = int($bigChrom/3);
   my $tenK = $oneThird + 10000;
   $tenK = $bigChrom if ($tenK > $bigChrom);
   my $defPos="${chrName}:${oneThird}-${tenK}";
   if ( -s "$asmId/defaultPos.txt" ) {
     $defPos=`cat "$asmId/defaultPos.txt"`;
     chomp $defPos;
   }
@@ -210,90 +213,50 @@
   open (DL, ">$downloadHubTxt") or die "can not write to $downloadHubTxt";
   $localHubTxt = "$buildDir/${asmId}.singleFile.hub.txt";
   open (HT, ">$localHubTxt") or die "can not write to $localHubTxt";
 
   singleFileHub(\*HT, \*DL, $accessionId, $orgName, $descr, $asmId,
 	$defPos, $taxId, $trackDb, $accessionDir);
 
   my $localGenomesFile = "$buildDir/${asmId}.genomes.txt";
   open (GF, ">$localGenomesFile") or die "can not write to $localGenomesFile";
   printf GF "genome %s\n", $accessionId;
   printf GF "taxId %s\n", $taxId if (length($taxId) > 1);
   printf GF "trackDb trackDb.txt\n";
   printf GF "groups groups.txt\n";
   printf GF "description %s\n", $orgName;
   printf GF "twoBitPath %s.2bit\n", $accessionId;
+  printf GF "twoBitBptUrl %s.2bit.bpt\n", $accessionId;
   printf GF "chromSizes %s.chrom.sizes.txt\n", $accessionId;
   printf GF "chromAlias %s.chromAlias.txt\n", $accessionId;
   printf GF "organism %s\n", $descr;
   printf GF "defaultPos %s\n", $defPos;
   printf GF "scientificName %s\n", $descr;
   printf GF "htmlPath html/%s.description.html\n", $asmId;
   # until blat server host is ready for hgdownload, avoid these lines
   if ($blatHost ne $downloadHost) {
     if ( -s "${destDir}/$accessionId.trans.gfidx" ) {
       printf GF "blat $blatHost$blatHostDomain $blatPort dynamic $accessionDir/$accessionId\n";
       printf GF "transBlat $blatHost$blatHostDomain $blatPort dynamic $accessionDir/$accessionId\n";
      printf GF "isPcr $blatHost$blatHostDomain $blatPort dynamic $accessionDir/$accessionId\n";
     }
   }
   close (GF);
 
   my $localGroups = "$buildDir/${asmId}.groups.txt";
   open (GR, ">$localGroups") or die "can not write to $localGroups";
-  print GR <<_EOF_
-name user
-label Custom Tracks
-priority 1
-defaultIsClosed 1
-
-name map
-label Mapping and Sequencing
-priority 2
-defaultIsClosed 0
-
-name genes
-label Genes and Gene Predictions
-priority 3
-defaultIsClosed 0
-
-name rna
-label mRNA and EST
-priority 4
-defaultIsClosed 0
-
-name regulation
-label Regulation
-priority 5
-defaultIsClosed 0
-
-name compGeno
-label Comparative Genomics
-priority 6
-defaultIsClosed 0
-
-name varRep
-label Variation
-priority 7
-defaultIsClosed 0
-
-name x
-label Experimental
-priority 10
-defaultIsClosed 1
-_EOF_
-   ;
+  print GR "%s", $groupsTxt;
   close (GR);
 }
 
 __END__
 
 description Mastacembelus armatus
 twoBitPath GCA_900324485.2_fMasArm1.2/trackData/addMask/GCA_900324485.2_fMasArm1.2.masked.2bit
 organism Zig-Zag eel
 defaultPos LR535842.1:14552035-14572034
 orderKey 1
 scientificName Mastacembelus armatus
 htmlPath GCA_900324485.2_fMasArm1.2/html/GCA_900324485.2_fMasArm1.2.description.html
 
 # head -25 GCA_002180035.3_HG00514_prelim_3.0_assembly_report.txt