Initial port to python3
[htsworkflow.git] / htsworkflow / pipelines / test / simulate_runfolder.py
index afa2edfe003736605761cdb459c5ba875240ae68..b94b91d22b7216fc246d08e2d2717317593356ab 100644 (file)
@@ -7,8 +7,8 @@ import shutil
 
 TEST_CODE_DIR = os.path.split(__file__)[0]
 TESTDATA_DIR = os.path.join(TEST_CODE_DIR, 'testdata')
-LANE_LIST = range(1,9)
-TILE_LIST = range(1,101)
+LANE_LIST = list(range(1,9))
+TILE_LIST = list(range(1,101))
 HISEQ_TILE_LIST = [1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108,
                    1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208,
                    2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108,
@@ -100,6 +100,17 @@ def make_unaligned_config_1_12(unaligned_dir):
     ]
     for src, dest in demultiplex_pairs:
         shutil.copy(src, dest)
+        
+def make_unaligned_status_1_12(unaligned_dir, flowcell_id):
+    basecall_status = ['All.htm', 'Demultiplex_Stats.htm', 'IVC.htm']
+    test_data_root = os.path.join(TESTDATA_DIR, '1_12', 'basecall_stats')
+    basecall_stats = os.path.join(unaligned_dir, 
+                                  'Basecall_Stats_{0}'.format(flowcell_id))
+    os.mkdir(basecall_stats)
+    for filename in basecall_status:
+        source = os.path.join(test_data_root, filename)
+        destination = os.path.join(basecall_stats, filename)
+        shutil.copy(source, destination)
 
 def make_rta_intensities_1460(data_dir, version='1.4.6.0'):
     """
@@ -642,15 +653,15 @@ class DemultiplexedPaths(object):
         return pathname
 
     def dump(self):
-        print ('index seq: {0}'.format(self.index_seq))
+        print(('index seq: {0}'.format(self.index_seq)))
 
-        print ('project dir: {0}'.format(self.project_dir))
-        print ('sample dir: {0}'.format(self.sample_dir))
-        print ('rootname: {0}'.format(self.rootname))
-        print ('path: {0}'.format(
+        print(('project dir: {0}'.format(self.project_dir)))
+        print(('sample dir: {0}'.format(self.sample_dir)))
+        print(('rootname: {0}'.format(self.rootname)))
+        print(('path: {0}'.format(
             os.path.join(self.project_dir,
                          self.sample_dir,
-                         self.rootname+'R1_001.fastq.gz')))
+                         self.rootname+'R1_001.fastq.gz'))))
 
 
 def get_unaligned_sample_fastq_data(flowcell_id, lane, index_seq):
@@ -686,7 +697,7 @@ def print_ls_tree(root):
     """
     for dirpath, dirnames, filenames in os.walk(root):
         for filename in filenames:
-            print os.path.join(dirpath, filename)
+            print(os.path.join(dirpath, filename))
 
 
 class BaseCallInfo(object):