def _read_sites(handle):
 alphabet = dna
 instances = []
 for line in handle:
  if (not line.startswith('>')):
   break
  line = next(handle)
  instance = ''
  for c in line.strip():
   if (c == c.upper()):
    instance += c
  instance = Seq(instance, alphabet)
  instances.append(instance)
 instances = motifs.Instances(instances, alphabet)
 motif = Motif(matrix_id=None, name=None, alphabet=alphabet, instances=instances)
 motif.mask = ('*' * motif.length)
 record = Record()
 record.append(motif)
 return record

def _read_sites ( handle ) : alphabet = dna instances = [ ] for line in handle : if ( not line . startswith ( '>' ) ) : break line = next ( handle ) instance = '' for c in line . strip ( ) : if ( c == c . upper ( ) ) : instance += c instance = Seq ( instance , alphabet ) instances . append ( instance ) instances = motifs . Instances ( instances , alphabet ) motif = Motif ( matrix_id = None , name = None , alphabet = alphabet , instances = instances ) motif . mask = ( '*' * motif . length ) record = Record ( ) record . append ( motif ) return record
read the motif from jaspar .