From 4af60a3ea74a1f9f06bb09e58be4a7538674645e Mon Sep 17 00:00:00 2001 From: Brendan Wee Date: Wed, 17 Nov 2021 15:45:31 -0800 Subject: [PATCH] Read mate pair index from last item of split filename. Allows for filenames with underscores. --- src/coptr/read_mapper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coptr/read_mapper.py b/src/coptr/read_mapper.py index df5a645..a15ee3d 100644 --- a/src/coptr/read_mapper.py +++ b/src/coptr/read_mapper.py @@ -277,9 +277,9 @@ def map(self, index, inputf, outfolder, paired, threads, bt2_k): f_split = f.split("_") if f_split[0] not in read_pairs: read_pairs[f_split[0]] = [f] - elif f_split[0] in read_pairs and f_split[1][0] == "2": + elif f_split[0] in read_pairs and f_split[-1][0] == "2": read_pairs[f_split[0]].append(f) - elif f_split[0] in read_pairs and f_split[1][0] == "1": + elif f_split[0] in read_pairs and f_split[-1][0] == "1": read_pairs[f_split[0]] = [f, read_pairs[f_split[0]][0]] # now map paired end reads