code: def _scan_smaller(self, seq, threshold=''):
          
          ll = self.ll #Shortcut for Log-likelihood matrix
          matches   = []
          endpoints = []
          scores    = []
          w         = self.width
          oseq      = seq
          seq       = seq.upper()
          for offset in range(self.width-len(seq)+1):    #Check if +/-1 needed
              maximum = 0
              for i in range(len(seq)):
                  maximum = maximum + max(ll[i+offset].values())
              if not threshold: threshold = 0.8 * maximum
              total_f = 0
              total_r = 0
              for i in range(len(seq)):
                  total_f = total_f + ll[i+offset      ][        seq[i] ]
                  total_r = total_r + ll[w-(i+offset)-1][revcomp[seq[i]]]
              if 0:
                  print "\t\t%s vs %s: F=%6.2f R=%6.2f %6.2f %4.2f"%(oseq, self.oneletter[offset:offset+len(seq)],
                                                                     total_f, total_r,  maximum,
                                                                     max([total_f,total_r])/self.maxscore)
              if total_f > threshold and total_f > total_r:
                  endpoints.append( (offset,offset+self.width-1) )
                  scores.append(total_f)
                  matches.append(oseq[offset:offset+self.width])
              elif total_r > threshold:
                  endpoints.append( (offset,offset+self.width-1) )
                  scores.append(total_r)
                  matches.append(oseq[offset:offset+self.width])
          return(matches,endpoints,scores)
docs: m._scan_smaller(seq, threshold='') -- Internal utility function for performing sequence scans
  
          The sequence is smaller than the PSSM.  Are there
          good matches to regions of the PSSM?