def _select_loci(c):
loci_len = {k: len(v) for k, v in c.loci2seq.iteritems()}<EOL>logger.debug("<STR_LIT>" % len(c.loci2seq.keys()))<EOL>loci_len_sort = sorted(loci_len.iteritems(), key=operator.itemgetter(<NUM_LIT:1>), reverse=True)<EOL>max_size = loci_len_sort[<NUM_LIT:0>][<NUM_LIT:1>]<EOL>logger.debug("<STR_LIT>" % max_size)<EOL>loci_clean = {locus: c.loci2seq[locus] for locus, size in loci_len_sort if size > <NUM_LIT> * max_size}<EOL>c.loci2seq = loci_clean<EOL>removed = list(set(c.idmembers.keys()) - set(_get_seqs(c)))<EOL>c.add_id_member(removed, loci_len_sort[<NUM_LIT:0>][<NUM_LIT:0>])<EOL>logger.debug("<STR_LIT>" % len(c.loci2seq.keys()))<EOL>return c<EOL>
Select only loci with most abundant sequences