Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Carlos GO
RNAmigos_server
Commits
0443717d
Commit
0443717d
authored
Jun 17, 2020
by
Carlos GO
Browse files
read user graph
parent
fb9dda3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
rnamigos_launcher.py
View file @
0443717d
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"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment