def calc_consistency(models, nloci, dcutoff=200): combines = list(combinations(models, 2)) parts = [0 for _ in xrange(nloci)] for pm in consistency_wrapper([models[m]['x'] for m in models], [models[m]['y'] for m in models], [models[m]['z'] for m in models], nloci, dcutoff, range(len(models)), len(models)): for i, p in enumerate(pm): parts[i] += p return [float(p)/len(combines) * 100 for p in parts]
def calc_consistency(models, nloci, zeros, dcutoff=200): combines = list(combinations(models, 2)) parts = [0 for _ in xrange(nloci)] for pm in consistency_wrapper([model['x'] for model in models], [model['y'] for model in models], [model['z'] for model in models], zeros, nloci, dcutoff, range(len(models)), len(models)): for i, p in enumerate(pm): parts[i] += p return [float(p) / len(combines) * 100 for p in parts]