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

1.67 2009/07/15 01:42:51 mikep
removed deprecated warning and added check for raw directory
Index: src/hg/encode/encodeLoad/doEncodeLoad.pl
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/encode/encodeLoad/doEncodeLoad.pl,v
retrieving revision 1.66
retrieving revision 1.67
diff -b -B -U 4 -r1.66 -r1.67
--- src/hg/encode/encodeLoad/doEncodeLoad.pl	20 Jun 2009 16:05:14 -0000	1.66
+++ src/hg/encode/encodeLoad/doEncodeLoad.pl	15 Jul 2009 01:42:51 -0000	1.67
@@ -248,9 +248,10 @@
     if(!$opt_skipLoad) {
         if(!(-e "$Encode::sqlCreate/${sqlTable}.as")) {
             die "AutoSql schema '$Encode::sqlCreate/${sqlTable}.as' does not exist\n";
         }
-	if (scalar(split(" ", $fileList)) != 1) {
+        # 'perldoc perldata' says scalar val of list assignment is num elts on RHS of assignment
+        if ((() = split(" ", $fileList)) != 1) { 
 	    die "BigBed must be loaded with a single file but a list of files was supplied ($fileList)\n";
 	}
 	# Create bigBed binary file
         my @cmds = ( "/cluster/bin/x86_64/bedToBigBed -as=$Encode::sqlCreate/${sqlTable}.as $fileList $configPath/${assembly}_chromInfo.txt ${tableName}.bb");
@@ -469,8 +470,11 @@
         my $target = "$downloadDir/$tablename.$type.gz";
         # NOTE: We are now making the RawSignals but they are put in the subdirectory "raw"
         if(@files == 1 && $files[0] =~ /^$Encode::autoCreatedPrefix/) {
             $target = "$downloadDir/raw/$tablename.$type.gz";
+	    if (! -d "$downloadDir/raw") {
+		mkdir "$downloadDir/raw" or die "Could not create dir [$downloadDir/raw] error: [$!]\n";
+		}
         }
         $target =~ s/ //g;  # removes space in ".bed 6.gz" for example
         unlink($target);
         HgAutomate::verbose(2, "unlink($target)\n");