Skip to content

Commit 069e1b7

Browse files
committed
fixed output filenames
1 parent 7d7f5ac commit 069e1b7

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

preprocessing/preprocess.new.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33

44
__author__ = 'Francesco Asnicar (f.asnicar@unitn.it)'
5-
__version__ = '0.1.11'
6-
__date__ = '29 November 2018'
5+
__version__ = '0.2.1'
6+
__date__ = '6 January 2019'
77

88

99
import os
@@ -339,9 +339,15 @@ def split_and_sort(input_dir, screened_r1_r2, keep_intermediate, nproc=1, dry_ru
339339

340340
R1, R2 = screened_r1_r2
341341
out = R1[:R1.find('.')]
342-
put = R1[R1.rfind('R1'):R1.rfind('.')].replace('R1', '')
343-
344-
if (out != R2[:R2.find('.')]) or (put != R2[R2.rfind('R2'):R2.rfind('.')].replace('R2', '')):
342+
put = '_'.join(for a in
343+
[R1[R1.rfind('R1'):R1.rfind('.')].replace('R1', '').replace('trimmed', '').replace('phiX174', '').replace('hg19', '')
344+
if a])
345+
outR2 = R2[:R2.find('.')]
346+
putR2 = '_'.join(for a in
347+
[R2[R2.rfind('R2'):R2.rfind('.')].replace('R2', '').replace('trimmed', '').replace('phiX174', '').replace('hg19', '')
348+
if a])
349+
350+
if (out != outR2) or (put != putR2):
345351
error('split_and_sort() ::: cannot finds common filename!\n R1: {}\n R2: {}\n out: {}\n put: {}'
346352
.format(R1, R2, out, put), exit=True)
347353

0 commit comments

Comments
 (0)