From 15ee282d4cdc1fef5e0ba39a3870c6a15eee6c4e Mon Sep 17 00:00:00 2001 From: Tao Zhu Date: Sat, 12 Oct 2019 11:48:43 +0800 Subject: [PATCH] Fix Santalucia_NN_Tm when where is ambigous bases --- primerserver2/core/Santalucia_NN_Tm.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/primerserver2/core/Santalucia_NN_Tm.py b/primerserver2/core/Santalucia_NN_Tm.py index b8030d0..061087b 100644 --- a/primerserver2/core/Santalucia_NN_Tm.py +++ b/primerserver2/core/Santalucia_NN_Tm.py @@ -136,8 +136,13 @@ def rev_complement(seq): '-':'-', 'N':'N'} letters = list(seq) - letters = [basecomplement[base] for base in letters] - complement = (''.join(letters)) #gives the complement of the bases in list letters + newletters = [] + for base in letters: + if base in basecomplement: + newletters.append(basecomplement[base]) + else: + newletters.append('N') + complement = (''.join(newletters)) #gives the complement of the bases in list letters return complement[::-1] #gives the reverse of the compliment def complement(seq): @@ -149,8 +154,13 @@ def complement(seq): '-':'-', 'N':'N'} letters = list(seq) - letters = [basecomplement[base] for base in letters] - complement = (''.join(letters)) #gives the complement of the bases in list letters + newletters = [] + for base in letters: + if base in basecomplement: + newletters.append(basecomplement[base]) + else: + newletters.append('N') + complement = (''.join(newletters)) #gives the complement of the bases in list letters return complement ### FUNCTION TO QC INPUT OLIGO SEQUENCES. (covert the input seq to uppercase, remove any whitespace and characters other than 'A','C','G','T','N','-')