From 81a179239cdb4af25231c9e937ef524c6c4cface Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Tue, 10 Dec 2019 18:13:27 +0100 Subject: [PATCH] ngsfilter: fixed sequence cut bug on aligned sequences. Still exists for unaligned sequences --- python/obitools3/commands/ngsfilter.pyx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/obitools3/commands/ngsfilter.pyx b/python/obitools3/commands/ngsfilter.pyx index c7ea1e9..7f1fc3d 100644 --- a/python/obitools3/commands/ngsfilter.pyx +++ b/python/obitools3/commands/ngsfilter.pyx @@ -409,7 +409,7 @@ cdef tuple annotate(sequences, infos, no_tags, verbose=False): match = match.reverse_complement if not not_aligned or id(second_matched_seq) == id(sequenceF): - final_sequence = final_sequence[0:reversematch[1][1]] + final_sequence = final_sequence[0:(reversematch[1][1] - directmatch[1][2])] else: cut_seq = sequenceR[reversematch[1][2]:] if not directmatch[0].forward: @@ -578,8 +578,9 @@ def run(config): Column.new_column(o_view, REVERSE_SEQ_COLUMN_NAME, OBI_SEQ) Column.new_column(o_view, REVERSE_QUALITY_COLUMN_NAME, OBI_QUAL, associated_column_name=REVERSE_SEQ_COLUMN_NAME, associated_column_version=o_view[REVERSE_SEQ_COLUMN_NAME].version) - Column.new_column(unidentified, REVERSE_SEQ_COLUMN_NAME, OBI_SEQ) - Column.new_column(unidentified, REVERSE_QUALITY_COLUMN_NAME, OBI_QUAL, associated_column_name=REVERSE_SEQ_COLUMN_NAME, associated_column_version=unidentified[REVERSE_SEQ_COLUMN_NAME].version) + if unidentified is not None: + Column.new_column(unidentified, REVERSE_SEQ_COLUMN_NAME, OBI_SEQ) + Column.new_column(unidentified, REVERSE_QUALITY_COLUMN_NAME, OBI_QUAL, associated_column_name=REVERSE_SEQ_COLUMN_NAME, associated_column_version=unidentified[REVERSE_SEQ_COLUMN_NAME].version) g = 0 u = 0