From ed9549acfbddddde29fb28a39040dfd2395bd8a2 Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Mon, 13 Jul 2020 15:56:40 +0200 Subject: [PATCH] ngsfilter: unidentified sequences are now stored untrimmed --- python/obitools3/commands/ngsfilter.pyx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/python/obitools3/commands/ngsfilter.pyx b/python/obitools3/commands/ngsfilter.pyx index 7f4598f..89371e0 100644 --- a/python/obitools3/commands/ngsfilter.pyx +++ b/python/obitools3/commands/ngsfilter.pyx @@ -58,7 +58,7 @@ def addOptions(parser): metavar="", type=str, default=None, - help="URI to the view used to store the sequences unassigned to any sample") + help="URI to the view used to store the sequences unassigned to any sample. Those sequences are untrimmed.") group.add_argument('--no-tags', action="store_true", dest="ngsfilter:notags", @@ -646,7 +646,13 @@ def run(config): o_view[g].set(oseq.id, oseq.seq, definition=oseq.definition, quality=oseq.quality, tags=oseq) g+=1 elif unidentified is not None: - unidentified[u].set(oseq.id, oseq.seq, definition=oseq.definition, quality=oseq.quality, tags=oseq) + # Untrim sequences (put original back) + if len(modseq) > 1: + oseq[REVERSE_SEQUENCE_COLUMN] = reverse[i].seq + oseq[REVERSE_QUALITY_COLUMN] = reverse[i].quality + unidentified[u].set(oseq.id, forward[i].seq, definition=oseq.definition, quality=forward[i].quality, tags=oseq) + else: + unidentified[u].set(oseq.id, entries[i].seq, definition=oseq.definition, quality=entries[i].quality, tags=oseq) u+=1 except Exception, e: if unidentified is not None: