Added a Stanford CollectReads compatibility mode.
authorBrandon King <kingb@caltech.edu>
Thu, 7 Aug 2008 21:19:19 +0000 (21:19 +0000)
committerBrandon King <kingb@caltech.edu>
Thu, 7 Aug 2008 21:19:19 +0000 (21:19 +0000)
 * Use --compat_mode with --extract-results to trigger this new mdoe.

htswdataprod/scripts/runfolder

index fc4e50b2279b97b5a0e732dfabf0956ac2b7257d..475d78c7706a27f1a531c092e84c4ac2c2c5f265 100644 (file)
@@ -52,6 +52,10 @@ def make_parser():
     parser.add_option('--run-xml', dest='run_xml',
            default=None,
            help='specify a run_<FlowCell>.xml file for summary reports')
+    
+    parser.add_option('--compat_mode', dest='compat', action='store_true',
+                      default=False,
+                      help="Stanford CollectReads compatibility mode")
 
     return parser
 
@@ -77,7 +81,27 @@ def main(cmdlist=None):
         if opt.archive:
             runfolder.extract_run_parameters(runs)
         if opt.extract_results:
-            runfolder.extract_results(runs)
+            
+            # Caltech specific mode
+            if not opt.compat:
+                runfolder.extract_results(runs)
+                
+            # Stanford CollectReads compatibility mode
+            else:
+                
+                # Define directories to be used
+                run_dir = args[0]
+                cr_dir = os.path.join(run_dir, 'CollectReads')
+                base_dir = os.path.join(cr_dir, 'caltech')
+                
+                # Create directories if they do not exist
+                if not os.path.exists(cr_dir):
+                    os.mkdir(cr_dir)
+                if not os.path.exists(base_dir):
+                    os.mkdir(base_dir)
+                
+                # Run extract results
+                runfolder.extract_results(runs, base_dir)
 
     return 0