def get_seq_lengths(seq_lengths, bc_counts):
 all_seq_lengths = seq_lengths.values()
 all_seq_ids = set(seq_lengths.keys())
 bad_seq_ids = set(bc_counts[None]).union(set(bc_counts['#FAILED']))
 good_seq_ids = (all_seq_ids - bad_seq_ids)
 good_seq_lengths = map(seq_lengths.__getitem__, good_seq_ids)
 return (all_seq_lengths, good_seq_lengths)

def get_seq_lengths ( seq_lengths , bc_counts ) : all_seq_lengths = seq_lengths . values ( ) all_seq_ids = set ( seq_lengths . keys ( ) ) bad_seq_ids = set ( bc_counts [ None ] ) . union ( set ( bc_counts [ '#FAILED' ] ) ) good_seq_ids = ( all_seq_ids - bad_seq_ids ) good_seq_lengths = map ( seq_lengths . __getitem__ , good_seq_ids ) return ( all_seq_lengths , good_seq_lengths )
convenience wrapper for getting lengths of good and bad seqs .