Commit 0443717d authored by Carlos GO's avatar Carlos GO
Browse files

read user graph

parent fb9dda3a
import os
import pickle
import json
import networkx as nx
......@@ -9,22 +10,34 @@ from fp2lig import *
def launch(pdb_path, library_path, n_hits=30, run='rnamigos-ismb'):
"""
MASTER launcher.
"""
,_ext = os.path.splittext(pdb_path)
if ext == '.cif':
print(f"launcher path {pdb_path}")
G = get_graph(pdb_path)
elif ext == '.json':
with open(pdb_path) as f:
data = json.load(f)
G = nx.node_link_data(data)
else:
raise ValueError, "Invalid input file type."
print(f"launcher path {pdb_path}")
G = get_graph(pdb_path)
# G = nx.read_gpickle(os.path.join("static", "samples", "1aju_arg.nx"))
print("LOADING MODEL")
run = 'ismb-tune_0'
model, meta = load_model(run)
fp_pred,_ = inference_on_graph(model, G, meta['edge_map'])
print("LOADING LIBRARY")
library = pickle.load(open(os.path.join("static", "libraries", "pdb_rna.p"), 'rb'))
# library = pickle.load(open(os.path.join("static", "libraries", "pdb_rna.p"), 'rb'))
# if library_path is None:
# library = pickle.load(open(os.path.join("static", "library", "all_rna_pdb.p"), 'rb'))
# else:
# library = smiles_to_library(library_path)
if library_path is None:
library = pickle.load(open(os.path.join("static", "library", "all_rna_pdb.p"), 'rb'))
else:
library = smiles_to_library(library_path)
fp_pred = fp_pred.detach().numpy() > 0.5
print("SCREENING LIBRARY")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment