From e94d23f0b825233a9e4107c07b65b73a58001e32 Mon Sep 17 00:00:00 2001 From: cmfield Date: Fri, 22 Sep 2023 13:12:24 +0200 Subject: [PATCH] included adapter checks --- wish_tags_generator.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wish_tags_generator.py b/wish_tags_generator.py index 3857cc1..e1218ef 100644 --- a/wish_tags_generator.py +++ b/wish_tags_generator.py @@ -75,7 +75,9 @@ def check_tm(seq): def check_palindrome(seq): return(fast_rc(seq)!=seq) -def check_hairpins(seq): +def check_hairpins(seq, adapter=None): + if adapter is not None: + seq = adapter+seq trimers = [] rc_trimers = [] for offset in range(0,3): @@ -163,6 +165,8 @@ def gen_primers(l,n,pool): seqs = filter(check_palindrome, seqs) seqs = filter(check_runs, seqs) seqs = filter(check_hairpins, seqs) + seqs = filter(lambda x: check_hairpins(x, 'TCGTCGGCAGCGTCAGATGTGTATAAGAGACAG')) + seqs = filter(lambda x: check_hairpins(x, 'GTCTCGTGGGCTCGGAGATGTGTATAAGAGACAG')) seqs = list(dict.fromkeys(seqs)) sys.stdout.write("{} of {} random {}mers passed initial checks.\n".format(len(seqs), n, l)) aln = run_bwa(seqs)