def nt_search(seq, subseq):
 pattern = ''
 for nt in subseq:
  value = IUPACData.ambiguous_dna_values[nt]
  if (len(value) == 1):
   pattern += value
  else:
   pattern += ('[%s]' % value)
 pos = (-1)
 result = [pattern]
 l = len(seq)
 while True:
  pos += 1
  s = seq[pos:]
  m = re.search(pattern, s)
  if (not m):
   break
  pos += int(m.start(0))
  result.append(pos)
 return result

def nt_search ( seq , subseq ) : pattern = '' for nt in subseq : value = IUPACData . ambiguous_dna_values [ nt ] if ( len ( value ) == 1 ) : pattern += value else : pattern += ( '[%s]' % value ) pos = ( - 1 ) result = [ pattern ] l = len ( seq ) while True : pos += 1 s = seq [ pos : ] m = re . search ( pattern , s ) if ( not m ) : break pos += int ( m . start ( 0 ) ) result . append ( pos ) return result
search for a dna subseq in sequence .