From 684493646e51126521837c4b832aa9f4bf3fb6e8 Mon Sep 17 00:00:00 2001 From: Adam Cribbs Date: Thu, 27 Jul 2023 20:48:10 +0100 Subject: [PATCH] Update correct_10xbarcode.py Added function to see if umi is only conists of Ts and do not save if it is --- tallytrin/python/correct_10xbarcode.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tallytrin/python/correct_10xbarcode.py b/tallytrin/python/correct_10xbarcode.py index 6bebccd..8df5a99 100644 --- a/tallytrin/python/correct_10xbarcode.py +++ b/tallytrin/python/correct_10xbarcode.py @@ -57,6 +57,8 @@ for key, count in lists: barcode_lists.append(key) +def is_only_Ts(input_string): + return all(char == 'T' for char in input_string) def closest_match(input_string, string_list): closest_match = None @@ -91,7 +93,8 @@ def closest_match(input_string, string_list): else: pass - outf.write("@%s\n%s\n+\n%s\n" % (name + "_" + barcode + "_" + umi, record.sequence, record.quality)) + if not is_only_Ts(umi): + outf.write("@%s\n%s\n+\n%s\n" % (name + "_" + barcode + "_" + umi, record.sequence, record.quality)) outf.close()