def Tm_Wallace(seq, check=True, strict=True):
 seq = str(seq)
 if check:
  seq = _check(seq, 'Tm_Wallace')
 melting_temp = ((2 * sum(map(seq.count, ('A', 'T', 'W')))) + (4 * sum(map(seq.count, ('C', 'G', 'S')))))
 tmp = (((3 * sum(map(seq.count, ('K', 'M', 'N', 'R', 'Y')))) + ((10 / 3.0) * sum(map(seq.count, ('B', 'V'))))) + ((8 / 3.0) * sum(map(seq.count, ('D', 'H')))))
 if (strict and tmp):
  raise ValueError(('ambiguous bases B, D, H, K, M, N, R, V, Y not ' + 'allowed when strict=True'))
 else:
  melting_temp += tmp
 return melting_temp

def Tm_Wallace ( seq , check = True , strict = True ) : seq = str ( seq ) if check : seq = _check ( seq , 'Tm_Wallace' ) melting_temp = ( ( 2 * sum ( map ( seq . count , ( 'A' , 'T' , 'W' ) ) ) ) + ( 4 * sum ( map ( seq . count , ( 'C' , 'G' , 'S' ) ) ) ) ) tmp = ( ( ( 3 * sum ( map ( seq . count , ( 'K' , 'M' , 'N' , 'R' , 'Y' ) ) ) ) + ( ( 10 / 3.0 ) * sum ( map ( seq . count , ( 'B' , 'V' ) ) ) ) ) + ( ( 8 / 3.0 ) * sum ( map ( seq . count , ( 'D' , 'H' ) ) ) ) ) if ( strict and tmp ) : raise ValueError ( ( 'ambiguous bases B, D, H, K, M, N, R, V, Y not ' + 'allowed when strict=True' ) ) else : melting_temp += tmp return melting_temp
calculate and return the tm using the wallace rule .