From 10e5ebdbc081b235bdedd47ceb6634cd736e9f92 Mon Sep 17 00:00:00 2001 From: MercierC Date: Tue, 16 Mar 2021 15:09:28 +1300 Subject: [PATCH] ngsfilter: fixed critical bug where barcodes shorter than the forward primer would be missed --- python/obitools3/commands/ngsfilter.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/obitools3/commands/ngsfilter.pyx b/python/obitools3/commands/ngsfilter.pyx index 959210f..9ffc7c6 100644 --- a/python/obitools3/commands/ngsfilter.pyx +++ b/python/obitools3/commands/ngsfilter.pyx @@ -322,7 +322,7 @@ cdef tuple annotate(sequences, infos, no_tags, verbose=False): sequences[0] = sequences[0][directmatch[1][2]:] else: sequences[1] = sequences[1][directmatch[1][2]:] - sequences[0][REVERSE_SEQUENCE_COLUMN] = sequences[1].seq # used by alignpairedend tool + sequences[0][REVERSE_SEQUENCE_COLUMN] = sequences[1].seq # used by alignpairedend tool sequences[0][REVERSE_QUALITY_COLUMN] = sequences[1].quality # used by alignpairedend tool if directmatch[0].forward: @@ -369,7 +369,7 @@ cdef tuple annotate(sequences, infos, no_tags, verbose=False): sequences[0] = sequences[0][:r[1]] else: sequences[1] = sequences[1][:r[1]] - sequences[0][REVERSE_SEQUENCE_COLUMN] = sequences[1].seq # used by alignpairedend tool + sequences[0][REVERSE_SEQUENCE_COLUMN] = sequences[1].seq # used by alignpairedend tool sequences[0][REVERSE_QUALITY_COLUMN] = sequences[1].quality # used by alignpairedend tool # do the same on the other seq if first_match_first_seq: @@ -394,7 +394,7 @@ cdef tuple annotate(sequences, infos, no_tags, verbose=False): seq_to_match = sequences[0] reversematch = [] # Compute begin - begin=directmatch[1][2]+1 # end of match + 1 on the same sequence + #begin=directmatch[1][2]+1 # end of match + 1 on the same sequence -- No, already cut out forward primer # Try reverse matching on the other sequence: new_seq = True pattern = 0 @@ -408,7 +408,7 @@ cdef tuple annotate(sequences, infos, no_tags, verbose=False): primer=p # Saving original primer as 4th member of the tuple to serve as correct key in infos dict even if it might have been reversed complemented # (3rd member already used by directmatch) - reversematch.append((primer, primer(seq_to_match, same_sequence=not new_seq, pattern=pattern, begin=begin), None, p)) + reversematch.append((primer, primer(seq_to_match, same_sequence=not new_seq, pattern=pattern, begin=0), None, p)) new_seq = False pattern+=1 # Choose match closer to the end of the sequence