<jupyter_start><jupyter_text>Plot weight against LOR<jupyter_code>from seffnet.default_predictor import predictor
from seffnet.constants import DEFAULT_WEIGHTED_FULLGRAPH_PICKLE
import pybel
import networkx as nx
from tqdm import tqdm_notebook as tqdm
graph = pybel.from_pickle(DEFAULT_WEIGHTED_FULLGRAPH_PICKLE)
info = {}
for edge in tqdm(graph.edges()):
    if edge[0].namespace == 'pubchem.compound':
        if edge[1].namespace != 'uniprot':
            continue 
        r = predictor.find_new_relation(
        source_curie=edge[0].namespace+':'+edge[0].identifier,
        target_curie=edge[1].namespace+':'+edge[1].identifier,
        )
        for iden, edge_d in graph[edge[0]][edge[1]].items():
            weight = edge_d['weight']
        lor = r['lor']
        info[edge] = (weight, lor)
len(info.keys())
weights = [w for w, lor in info.values()]
lors = [lor for w, lor in info.values()]
len(lors)
import matplotlib.pyplot as plt
plt.plot(lors, weights, 'bo')
plt.ylabel('weights')
plt.xlabel('lors')
plt.show()<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup