Support multiple having an eland file split into multiple fragments.
[htsworkflow.git] / htsworkflow / pipelines / runfolder.py
index 0fce8f840f49cd5c6ca3aea92e203051ff40d45f..0013a86429e3add3ac2bbfbe7f21c2d7c94b9a75 100644 (file)
@@ -506,29 +506,29 @@ def compress_eland_results(gerald_object, cycle_dir, num_jobs=1):
 
     for lanes_dictionary in gerald_object.eland_results.results:
         for eland_lane in lanes_dictionary.values():
-            source_name = eland_lane.pathname
-            if source_name is None:
-              LOGGER.info(
-                "Lane ID %s does not have a filename." % (eland_lane.lane_id,))
-            else:
-              path, name = os.path.split(source_name)
-              dest_name = os.path.join(cycle_dir, name)
-              LOGGER.info("Saving eland file %s to %s" % \
-                         (source_name, dest_name))
-
-              if is_compressed(name):
-                LOGGER.info('Already compressed, Saving to %s' % (dest_name,))
-                shutil.copy(source_name, dest_name)
-              else:
-                # not compressed
-                dest_name += '.bz2'
-                args = ['bzip2', '-9', '-c', source_name, '>', dest_name ]
-                bz_commands.append(" ".join(args))
-                #LOGGER.info('Running: %s' % ( " ".join(args) ))
-                #bzip_dest = open(dest_name, 'w')
-                #bzip = subprocess.Popen(args, stdout=bzip_dest)
-                #LOGGER.info('Saving to %s' % (dest_name, ))
-                #bzip.wait()
+            for source_name in eland_lane.pathnames:
+                if source_name is None:
+                  LOGGER.info(
+                    "Lane ID %s does not have a filename." % (eland_lane.lane_id,))
+                else:
+                  path, name = os.path.split(source_name)
+                  dest_name = os.path.join(cycle_dir, name)
+                  LOGGER.info("Saving eland file %s to %s" % \
+                             (source_name, dest_name))
+
+                  if is_compressed(name):
+                    LOGGER.info('Already compressed, Saving to %s' % (dest_name,))
+                    shutil.copy(source_name, dest_name)
+                  else:
+                    # not compressed
+                    dest_name += '.bz2'
+                    args = ['bzip2', '-9', '-c', source_name, '>', dest_name ]
+                    bz_commands.append(" ".join(args))
+                    #LOGGER.info('Running: %s' % ( " ".join(args) ))
+                    #bzip_dest = open(dest_name, 'w')
+                    #bzip = subprocess.Popen(args, stdout=bzip_dest)
+                    #LOGGER.info('Saving to %s' % (dest_name, ))
+                    #bzip.wait()
 
     if len(bz_commands) > 0:
       q = QueueCommands(bz_commands, num_jobs)