def _solve_conflict(list_c, s2p, n_cluster):
logger.debug("<STR_LIT>")<EOL>if parameters.decision_cluster == "<STR_LIT>":<EOL><INDENT>return decide_by_bayes(list_c, s2p)<EOL><DEDENT>loci_similarity = _calculate_similarity(list_c)<EOL>loci_similarity = sorted(loci_similarity.iteritems(), key=operator.itemgetter(<NUM_LIT:1>), reverse=True)<EOL>common = sum([score for p, score in loci_similarity])<EOL>while common > <NUM_LIT:0>:<EOL><INDENT>n_cluster += <NUM_LIT:1><EOL>logger.debug("<STR_LIT>" % loci_similarity)<EOL>pairs = loci_similarity[<NUM_LIT:0>][<NUM_LIT:0>]<EOL>score = loci_similarity[<NUM_LIT:0>][<NUM_LIT:1>]<EOL>logger.debug("<STR_LIT>" % (score, n_cluster))<EOL>if parameters.decision_cluster.startswith("<STR_LIT>"):<EOL><INDENT>list_c = _split_cluster_by_most_vote(list_c, pairs)<EOL><DEDENT>else:<EOL><INDENT>list_c = _split_cluster(list_c, pairs, n_cluster)<EOL><DEDENT>list_c = {k: v for k, v in list_c.iteritems() if len(v.loci2seq) > <NUM_LIT:0>}<EOL>loci_similarity = _calculate_similarity(list_c)<EOL>loci_similarity = sorted(loci_similarity.iteritems(), key=operator.itemgetter(<NUM_LIT:1>), reverse=True)<EOL>common = sum([score for p, score in loci_similarity])<EOL>logger.debug("<STR_LIT>" % len(list_c.keys()))<EOL><DEDENT>return list_c<EOL>
Make sure sequences are counts once.
Resolve by most-vote or exclussion

:params list_c: dict of objects cluster
:param s2p: dict of [loci].coverage = # num of seqs
:param n_cluster: number of clusters

return dict: new set of clusters