def cor(ent1, ent2): ls1 = [] ls2 = [] for elm in utils_distance.get_elements(ent1, ent2): if elm in ent2 and elm in ent1: ls1.append(ent1[elm]) ls2.append(ent2[elm]) #elif elm in ent1: # ls1.append(ent1[elm]) # ls2.append(float(0)) #else: # ls1.append(float(0)) # ls2.append(ent2[elm]) return utils_stats.pcc(ls1, ls2)
import utils, utils_plot, utils_distance d = {'web':utils.get_seq2count_dict('results/human.website.elm.elmdict', float(.01)), 'regex':utils.get_seq2count_dict('results/hprd_new.regex.elms.elmdict', float(.01))} elms = utils_distance.get_elements(d['web'], d['regex']) for elm in elms: utils_plot.elm_host_barplot(d, elm, 'plots/hprd/' + elm + '.png')