compute_score.py 354 Bytes
Newer Older
Lucas Bourneuf's avatar
Lucas Bourneuf committed
1 2 3 4 5 6 7 8 9 10 11

from itertools import combinations

NAME = "Ranker"
OUTPUTS = "score/3"

def run_on(models, *, multiplier:float=2):
    for model in models:
        for (geneA, valA), (geneB, valB) in combinations(model.get('gene', ()), r=2):
            score = abs(float(valA) - float(valB)) * float(multiplier)
            yield f'score({geneA},{geneB},"{score}").'