Merge branch 'master' of mus.cacr.caltech.edu:htsworkflow
[htsworkflow.git] / htsworkflow / pipelines / srf.py
index ef724f1dd36ec2a1b44739e1bfacff01a11e7de4..c313efe76e303db6a3508342204f482e87736a72 100644 (file)
@@ -4,6 +4,8 @@ import os
 
 from htsworkflow.util import queuecommands
 
+LOGGER = logging.getLogger(__name__)
+
 SOLEXA2SRF = 0
 ILLUMINA2SRF10 = 1
 ILLUMINA2SRF11 = 2
@@ -46,7 +48,7 @@ def make_srf_commands(run_name, bustard_dir, lanes, site_name, destdir, cmdlevel
   destdir - where to write all the srf files
   """
   # clean up pathname
-  logging.info("run_name %s" % (run_name,))
+  LOGGER.info("run_name %s" % (run_name,))
 
   cmd_list = []
   for lane in lanes:
@@ -75,7 +77,7 @@ def make_srf_commands(run_name, bustard_dir, lanes, site_name, destdir, cmdlevel
     else:
         raise ValueError("Unrecognized run level %d" % (cmdlevel,))
 
-    logging.info("Generated command: " + " ".join(cmd))
+    LOGGER.info("Generated command: " + " ".join(cmd))
     cmd_list.append(" ".join(cmd))
   return cmd_list
 
@@ -126,7 +128,7 @@ def make_qseq_commands(run_name, bustard_dir, lanes, site_name, destdir, cmdleve
   destdir - where to write all the srf files
   """
   # clean up pathname
-  logging.info("run_name %s" % (run_name,))
+  LOGGER.info("run_name %s" % (run_name,))
 
   cmd_list = []
   for lane in lanes:
@@ -143,13 +145,13 @@ def make_qseq_commands(run_name, bustard_dir, lanes, site_name, destdir, cmdleve
         dest_path = os.path.join(destdir, destname)
 
       cmd = " ".join(['tar', 'cjf', dest_path, pattern % (lane,) ])
-      logging.info("Generated command: " + cmd)
+      LOGGER.info("Generated command: " + cmd)
       cmd_list.append(cmd)
 
   return cmd_list
 
 def run_commands(new_dir, cmd_list, num_jobs):
-    logging.info("chdir to %s" % (new_dir,))
+    LOGGER.info("chdir to %s" % (new_dir,))
     curdir = os.getcwd()
     os.chdir(new_dir)
     q = queuecommands.QueueCommands(cmd_list, num_jobs)
@@ -170,7 +172,7 @@ def make_md5_commands(destdir):
 
   for f in file_list:
       cmd = " ".join(['md5sum', f, '>', f + '.md5'])
-      logging.info('generated command: ' + cmd)
+      LOGGER.info('generated command: ' + cmd)
       cmd_list.append(cmd)
 
   return cmd_list