def _read_pfm(handle):
 alphabet = dna
 counts = {}
 letters = 'ACGT'
 for (letter, line) in zip(letters, handle):
  words = line.split()
  if (words[0] == letter):
   words = words[1:]
  counts[letter] = [float(x) for x in words]
 motif = Motif(matrix_id=None, name=None, alphabet=alphabet, counts=counts)
 motif.mask = ('*' * motif.length)
 record = Record()
 record.append(motif)
 return record

def _read_pfm ( handle ) : alphabet = dna counts = { } letters = 'ACGT' for ( letter , line ) in zip ( letters , handle ) : words = line . split ( ) if ( words [ 0 ] == letter ) : words = words [ 1 : ] counts [ letter ] = [ float ( x ) for x in words ] motif = Motif ( matrix_id = None , name = None , alphabet = alphabet , counts = counts ) motif . mask = ( '*' * motif . length ) record = Record ( ) record . append ( motif ) return record
read the motif from a jaspar .