def import_ints(cyto_ppis_fname): cyto_ppis = [p[:4] for p in ut.load_lol(cyto_ppis_fname)[1:]] ppis_dupes = [(id1.split('_')[1],id2.split('_')[1],prob, 1 if corum in set(['gold','train']) else 0) for id1,id2,prob,corum in cyto_ppis] cxppis = pd.pd_lol(pd.PairDict(ppis_dupes)) return cxppis
def combine_pres_ppis(resa, resb): res = ut.struct_copy(resa) res.name = 'combined: %s, %s' % (resa.name, resb.name) res.ppis = pd.pd_lol(pd.pd_combine_ppis(pd.PairDict(resa.ppis), pd.PairDict(resb.ppis), combine_or)) res.ppis.sort(key=lambda x: x[2], reverse=True) return res
def combine_ppis(a,b): ppis = pd.pd_lol(pd.pd_combine_ppis(pd.PairDict(a), pd.PairDict(b), combine_or)) return ppis