src/hg/utils/automation/Encode.pm 1.56

1.56 2010/03/15 04:20:12 kate
Update DAF version to 2.0, freeze to June 2010, assemblies to hg19 and mm9, table/file name prefix to 'enc'. Add warning for beta testing.
Index: src/hg/utils/automation/Encode.pm
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/utils/automation/Encode.pm,v
retrieving revision 1.55
retrieving revision 1.56
diff -b -B -U 4 -r1.55 -r1.56
--- src/hg/utils/automation/Encode.pm	23 Dec 2009 05:00:53 -0000	1.55
+++ src/hg/utils/automation/Encode.pm	15 Mar 2010 04:20:12 -0000	1.56
@@ -24,10 +24,14 @@
 our $unloadFile = "unload.ra";
 our $trackFile = "trackDb.ra";
 our $fileDbFile = "fileDb.ra";
 our $pushQFile = "pushQ.sql";
-our $dafVersion = "1.1";
-#our $dafPrevVersion = "0.2.2";
+#our $dafVersion = "0.2.2";
+#our $dafVersion = "1.1";
+our $dafVersion = "2.0";
+
+# Prefix for table and filenames (was 'wgEncode' in v1 pipeline)
+our $compositePrefix = "enc";
 
 our $fieldConfigFile = "fields.ra";
 our $vocabConfigFile = "cv.ra";
 our $grantConfigFile = "labs.ra";
@@ -37,9 +41,10 @@
 our $restrictedMonths = 9;
 
 # change this for each freeze
 #our $dataVersion = "ENCODE Sep 2009 Freeze";
-our $dataVersion = "ENCODE Jan 2010 Freeze";
+#our $dataVersion = "ENCODE Jan 2010 Freeze";
+our $dataVersion = "ENCODE June 2010 Freeze";
 
 our $tempDir = "/data/tmp";	# place to put the big temporary files generated by sort etc.
 
 our $sqlCreate = "/cluster/bin/sqlCreate";
@@ -86,9 +91,9 @@
 
 
 sub validateFieldList {
 # validate the entries in a RA record or DDF header using fields.ra
-# $file s/d be 'ddf' or 'dafHeader'
+# $file s/d be 'ddf' or 'dafHeader' or 'dafList'
 # Returns list of any errors that are found.
     my ($fields, $schema, $file) = @_;
     my %hash = map {$_ => 1} @{$fields};
     my @errors;
@@ -243,10 +248,10 @@
 }
 
 sub validateAssembly {
     my ($val) = @_;
-    if($val ne 'hg18' && $val ne 'mm9') {
-        return "Assembly '$val' is invalid (must be 'hg18 or mm9')";
+    if($val ne 'hg19' && $val ne 'mm9') {
+        return "Assembly '$val' is invalid (must be 'hg19 or mm9')";
     } else {
         return ();
     }
 }
@@ -258,9 +263,9 @@
 # the track list at the end of the DAF file; e.g.:
 # (lab => 'Myers', TRACKS => {'Alignments => {}, Signal => {}})
     my ($submitDir, $grants, $fields) = @_;
 
-    # Read info from Project Information File.  Verify required fields
+    # Verify required fields
     # are present and that the project is marked active.
     my $wd = cwd();
     chdir($submitDir);
     my @glob = glob "*.DAF";
@@ -324,16 +329,24 @@
             $daf{$key} = $val;
         }
     }
 
+    # Validate DAF version, and return immediately if not current (production)
+    # OR:  During beta test, provide notice about this instead of error
+
+    if($daf{dafVersion} ne $dafVersion) {
+        die "NOTICE:\n\n" .
+                "ENCODE pipeline 2.0 beta testing is in progress." . 
+                "Your wrangler will complete this submission and provide you" .
+                " with a version 2.0 DAF file to use future submissions.";
+        #die "ERROR(s) in DAF '$dafFile':\n\n" .
+                #"DAF version '$daf{dafVersion}' does not match current version: $dafVersion\n");
+    }
+
     # Validate fields
     my @tmp = grep(!/^TRACKS$/, keys %daf);
     my @errors = validateFieldList(\@tmp, $fields, 'dafHeader');
 
-    #if($daf{dafVersion} ne $dafVersion && $daf{dafVersion} ne $dafPrevVersion) {
-    if($daf{dafVersion} ne $dafVersion) {
-        push(@errors, "dafVersion '$daf{dafVersion}' does not match current version: $dafVersion");
-    }
     if(!keys(%{$daf{TRACKS}})) {
         push(@errors, "no views defined for project \'$daf{project}\' in DAF '$dafFile'");
     }
     if(!defined($grants->{$daf{grant}})) {
@@ -372,13 +385,9 @@
 
 sub compositeTrackName
 {
     my ($daf) = @_;
-    ### The following is being backed out because it creates additional naming conflicts.  Tim will deal with it when he gets back
-    #if($daf->{grant} eq "Crawford") {
-    #    return "wgEncodeChromatinMap";
-    #}
-    return "wgEncode" . ucfirst(lc($daf->{lab})) . $daf->{dataType};
+    return $compositePrefix . $daf->{compositeSuffix};
 }
 
 sub downloadDir
 {