Esempio n. 1
0
def load_reactome_pairs(fname='reactome/homo_sapiens.interactions.txt'):
    rmlol = ut.load_lol(fname)
    rmall = pd.PairDict([])
    pd.pd_set_loi_sets(rmall, [[x[1].split(':')[1], x[4].split(':')[1], x[6]] for x in rmlol[1:] if x[1]<>'' and x[4]<>''])
    rmfilt = [(k,v) for k,v in rmall.d.items() if ("reaction" in v) and not ("indirect_complex" in v) and not ("direct_complex" in v)]
    rmfiltpairs = [k for k,v in rmfilt]    
    return rmfiltpairs
Esempio n. 2
0
def load_reactome_pairs_reactions(fname='reactome/homo_sapiens.interactions.txt'):
    rmlol = ut.load_lol(fname)
    rmpd = pd.PairDict([])
    pd.pd_set_loi_sets(rmpd, [[x[1].split(':')[1], x[4].split(':')[1], x[7]]
        for x in rmlol[1:] if x[1]<>'' and x[4]<>'' and x[6]=='reaction'])
    return rmpd