Commits

Anton Goloborodko  committed da79fb9

mapping.py: bugfix

  • Participants
  • Parent commits b5c3937

Comments (0)

Files changed (1)

File src/hiclib/mapping.py

     reading_process.terminate()
 
     if kwargs.get('first_iteration', True):
+        has_old_files = False
         for path in sorted(glob.glob(out_sam_path+'.*')):
             try:
                 mapped_len = int(path[len(out_sam_path)+1:])
                 if ((mapped_len - min_seq_len) % len_step != 0) and (mapped_len != raw_seq_len):
-                    raise Exception(
-                        'The output folder contains a SAM file mapped '
-                        'to a different length range. '
-                        'Most likely, this is an artifact of previous mappings.'
-                        )
+                    has_old_files = True
             except:
                 pass
 
+        if has_old_files:
+            raise Exception(
+                'The output folder contains a SAM file mapped '
+                'to a different length range. '
+                'Most likely, this is an artifact of previous mappings.')
 
     if (seq_start < 0
         or seq_start > raw_seq_len