+ using correct interface now
[qpalma.git] / python / compute_donacc.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 import math
5 from numpy.matlib import zeros
6
7 def compute_donacc(donor_supp, acceptor_supp, d, a):
8
9 assert(len(donor_supp)==len(acceptor_supp))
10
11 donor = zeros(len(donor_supp))
12 acceptor= zeros(len(acceptor_supp))
13
14 for idx in range(len(donor_supp)):
15 if donor_supp[idx] == inf:
16 donor[idx] = donor_supp[idx];
17 else:
18 donor[idx] = penalty_lookup_new(d, donor_supp[idx])
19
20 if acceptor_supp[idx] == inf:
21 acceptor[idx] = acceptor_supp[idx]
22 else:
23 acceptor[idx] = penalty_lookup_new(a,acceptor_supp[idx])