src/hg/encode/encodeLoad/doEncodeLoad.pl 1.59

1.59 2009/03/16 22:28:00 mikep
added an option to not do downloads (and implicitly not do table load) so that I could regenerate pushq and whatever else gets done, because I loaded 16 GB of data and got a mysql error on the trackDb step immediaetly after the load was complete.
Index: src/hg/encode/encodeLoad/doEncodeLoad.pl
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/encode/encodeLoad/doEncodeLoad.pl,v
retrieving revision 1.58
retrieving revision 1.59
diff -b -B -U 4 -r1.58 -r1.59
--- src/hg/encode/encodeLoad/doEncodeLoad.pl	13 Mar 2009 19:04:15 -0000	1.58
+++ src/hg/encode/encodeLoad/doEncodeLoad.pl	16 Mar 2009 22:28:00 -0000	1.59
@@ -27,9 +27,9 @@
 use RAFile;
 use SafePipe;
 use HgDb;
 
-use vars qw/$opt_configDir $opt_noEmail $opt_outDir $opt_verbose $opt_debug $opt_skipLoad/;
+use vars qw/$opt_configDir $opt_noEmail $opt_outDir $opt_verbose $opt_debug $opt_skipLoad $opt_skipDownload/;
 
 my $loadRa = "out/$Encode::loadFile";
 my $unloadRa = "out/$Encode::unloadFile";
 my $trackDb = "out/trackDb.ra";
@@ -57,8 +57,12 @@
     -outDir dir         Path of output directory, for validation files
                         (default: submission-dir/out)
     -skipLoad           Skip table loading (useful if you just want to generate other
                         side-effects, like re-populating the download directory)
+    -skipDownload       Skip setting up download files (useful if you want to skip
+                        the data loading and table loading and just do the final
+                        PushQ entries etc. 
+                        (implies -skipLoad so that loaded data is not unloaded)
 END
 }
 
 sub dieFile
@@ -231,12 +235,13 @@
 # Main
 
 my $wd = cwd();
 
-GetOptions("configDir=s", "noEmail", "outDir=s", "verbose=i", "debug", "skipLoad") || usage();
+GetOptions("configDir=s", "noEmail", "outDir=s", "verbose=i", "debug", "skipLoad", "skipDownload") || usage();
 $opt_verbose = 1 if (!defined $opt_verbose);
 $opt_noEmail = 0 if (!defined $opt_noEmail);
 $opt_debug = 0 if (!defined $opt_debug);
+$opt_skipLoad = 1 if $opt_skipDownload; # dont unload tables if not doing downloads
 if($opt_outDir) {
     $loadRa = "$opt_outDir/$Encode::loadFile";
     $unloadRa = "$opt_outDir/$Encode::unloadFile";
 }
@@ -336,9 +341,9 @@
 HgAutomate::verbose(2, "loadRa ($loadRa) has: " . scalar(keys %ra) . " records\n");
 
 my $compositeTrack = Encode::compositeTrackName($daf);
 my $downloadDir = Encode::downloadDir($daf);
-if(!(-d $downloadDir)) {
+if(!$opt_skipDownload and !(-d $downloadDir)) {
     # Change of plans: simlink to /cluster/data/encode/pipeline/downloads
     if(!(-d "/cluster/data/encode/pipeline/downloads/$compositeTrack")) {
         mkdir "/cluster/data/encode/pipeline/downloads/$compositeTrack" || die ("Can't create download directory (error: '$!'); please contact your wrangler at: $email\n");
     }
@@ -399,9 +404,9 @@
     } else {
         die "ERROR: unknown type: $type in $Encode::loadFile ($PROG)\n";
     }
     HgAutomate::verbose(2, "Done loading. Now making links and copies. hgdownload=[$hgdownload]\n");
-    if($hgdownload) {
+    if(!$opt_skipDownload and $hgdownload) {
         # soft link file(s) into download dir - gzip files as appropriate
         my $target = "$downloadDir/$tablename.$type.gz";
         $target =~ s/ //g;  # removes space in ".bed 6.gz" for example
         unlink($target);
@@ -439,9 +444,9 @@
         # XXXX add to FILES list and then copy files to unloadFiles.txt
     }
 }
 
-if(!$opt_skipLoad) {
+if(!$opt_skipDownload and !$opt_skipLoad) {
     # Send "data is ready" email to email contact assigned to $daf{lab}
     if($email) {
         if(!$opt_noEmail) {
             `echo "dir: $submitPath" | /bin/mail -s "ENCODE data from $daf->{grant}/$daf->{lab} lab is ready" $email`;