src/hg/utils/automation/makeGenomeDb.pl 1.20

1.20 2009/03/06 23:33:26 hiram
add -noGoldGapSplit option
Index: src/hg/utils/automation/makeGenomeDb.pl
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/utils/automation/makeGenomeDb.pl,v
retrieving revision 1.19
retrieving revision 1.20
diff -b -B -U 4 -r1.19 -r1.20
--- src/hg/utils/automation/makeGenomeDb.pl	4 Feb 2009 18:34:25 -0000	1.19
+++ src/hg/utils/automation/makeGenomeDb.pl	6 Mar 2009 23:33:26 -0000	1.20
@@ -42,8 +42,12 @@
   print STDERR $stepper->getOptionHelp();
   print STDERR &HgAutomate::getCommonOptionHelp('dbHost' => $dbHost,
 						'workhorse' => '',
 					        'fileServer' => '');
+print STDERR <<_EOF_
+    -noGoldGapSplit       do not split the gold/gap tables even when chrom based
+_EOF_
+  ;
   print STDERR "
 Automates the first steps of building a genome database:
     seq:     Translates fasta into /hive/data/genomes/\$db/\$db.unmasked.2bit .
     agp:     Checks consistency of fasta and AGP (or runs hgFakeAgp).
@@ -163,8 +167,13 @@
 my $CONFIG;
 # Command line option vars:
 use vars @HgAutomate::commonOptionVars;
 use vars @HgStepManager::optionVars;
+# specific command line options
+use vars qw/
+    $opt_noGoldGapSplit
+    /;
+
 # Required config parameters:
 my ($db, $scientificName, $assemblyDate, $assemblyLabel, $orderKey,
     $mitoAcc, $fastaFiles, $dbDbSpeciesDir, $taxId);
 # Conditionally required config parameters:
@@ -179,8 +188,9 @@
 sub checkOptions {
   # Make sure command line options are valid/supported.
   my $ok = GetOptions(@HgStepManager::optionSpec,
 		      @HgAutomate::commonOptionSpec,
+		      "noGoldGapSplit",
 		     );
   &usage(1) if (!$ok);
   &usage(0, 1) if ($opt_help);
   &HgAutomate::processCommonOptions();
@@ -663,11 +673,15 @@
   awk '\$1 == "'\$chr'" {print;}' $allAgp > \$c/\$chr.agp
 end
 sort -u chrom.lst.tmp > chrom.lst
 rm chrom.lst.tmp
-hgGoldGapGl -noGl -chromLst=chrom.lst $db $topDir .
 _EOF_
     );
+    if ($opt_noGoldGapSplit) {
+      $bossScript->add("hgGoldGapGl -noGl $db $allAgp\n");
+    } else {
+      $bossScript->add("hgGoldGapGl -noGl -chromLst=chrom.lst $db $topDir .\n");
+    }
   } else {
     $bossScript->add("hgGoldGapGl -noGl $db $allAgp\n");
   }
 
@@ -679,9 +693,9 @@
     # smallest bin that starts at 0.  The smallest bin is 128k bases, which
     # should always cover the entire mitochondrial genome (typically ~16k).
     my $bin = 585;
     my $mitoGold = ($mitoAcc =~ /^\d+$/) ? "gi|$mitoAcc" : $mitoAcc;
-    if ($chromBased || $opt_debug) {
+    if (!$opt_noGoldGapSplit && ($chromBased || $opt_debug)) {
       my $defaultChrom = `head -1 $topDir/chrom.sizes | cut -f 1`;
       chomp $defaultChrom;
       $bossScript->add(<<_EOF_