def prefix_filter_flowgrams(flowgrams, squeeze=False):
 if squeeze:
  seqs = imap((lambda f: (f.Name, squeeze_seq(str(f.toSeq(truncate=True))))), flowgrams)
 else:
  seqs = imap((lambda f: (f.Name, str(f.toSeq(truncate=True)))), flowgrams)
 mapping = build_prefix_map(seqs)
 l = len(mapping)
 orig_l = (sum([len(a) for a in mapping.values()]) + l)
 return (l, orig_l, mapping)

def prefix_filter_flowgrams ( flowgrams , squeeze = False ) : if squeeze : seqs = imap ( ( lambda f : ( f . Name , squeeze_seq ( str ( f . toSeq ( truncate = True ) ) ) ) ) , flowgrams ) else : seqs = imap ( ( lambda f : ( f . Name , str ( f . toSeq ( truncate = True ) ) ) ) , flowgrams ) mapping = build_prefix_map ( seqs ) l = len ( mapping ) orig_l = ( sum ( [ len ( a ) for a in mapping . values ( ) ] ) + l ) return ( l , orig_l , mapping )
filters flowgrams by common prefixes .