Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
DLA-Ranker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DLA-Ranker
DLA-Ranker
Commits
51214549
Commit
51214549
authored
Jun 06, 2022
by
Yasser Mohseni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates
parent
4634bc03
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
22 deletions
+56
-22
scr.py
Representation/scr.py
+41
-14
test.py
Test/test.py
+12
-7
tools.py
lib/tools.py
+3
-1
No files found.
Representation/scr.py
View file @
51214549
...
...
@@ -10,6 +10,7 @@ import re
import
os
import
sys
from
os
import
path
,
remove
import
glob
sys
.
path
.
insert
(
1
,
'../lib/'
)
import
tools
as
tl
...
...
@@ -178,13 +179,21 @@ def rimcoresup(rsa_rec,rsa_lig,rsa_complex):
return
rim
,
core
,
support
def
get_scr
(
rec
,
lig
,
com
,
name
):
#print('rec', path.basename(rec.replace('pdb', 'rsa')))
cmdcompl
=
tl
.
NACCESS_PATH
+
' '
+
com
os
.
system
(
cmdcompl
)
cmdrec
=
tl
.
NACCESS_PATH
+
' '
+
rec
os
.
system
(
cmdrec
)
cmdlig
=
tl
.
NACCESS_PATH
+
' '
+
lig
os
.
system
(
cmdlig
)
if
tl
.
USE_FREESASA
:
cmdcompl
=
tl
.
NACCESS_PATH
+
' --format=rsa '
+
com
+
' > '
+
path
.
basename
(
com
.
replace
(
'pdb'
,
'rsa'
))
os
.
system
(
cmdcompl
)
cmdrec
=
tl
.
NACCESS_PATH
+
' --format=rsa '
+
rec
+
' > '
+
path
.
basename
(
rec
.
replace
(
'pdb'
,
'rsa'
))
os
.
system
(
cmdrec
)
cmdlig
=
tl
.
NACCESS_PATH
+
' --format=rsa '
+
lig
+
' > '
+
path
.
basename
(
lig
.
replace
(
'pdb'
,
'rsa'
))
os
.
system
(
cmdlig
)
else
:
cmdcompl
=
tl
.
NACCESS_PATH
+
' '
+
com
os
.
system
(
cmdcompl
)
cmdrec
=
tl
.
NACCESS_PATH
+
' '
+
rec
os
.
system
(
cmdrec
)
cmdlig
=
tl
.
NACCESS_PATH
+
' '
+
lig
os
.
system
(
cmdlig
)
# ('GLN', 'B', '44', '55.7', 'receptor')
rim
,
core
,
support
=
rimcoresup
(
path
.
basename
(
rec
.
replace
(
'pdb'
,
'rsa'
)),
path
.
basename
(
lig
.
replace
(
'pdb'
,
'rsa'
)),
path
.
basename
(
com
.
replace
(
'pdb'
,
'rsa'
)))
...
...
@@ -198,15 +207,32 @@ def get_scr(rec, lig, com, name):
outprimcoresup
.
write
(
str
((
' '
.
join
(
map
(
str
,
elementsup
)))
+
" S"
)
+
"
\n
"
)
#Support
outprimcoresup
.
close
()
remove
(
path
.
basename
(
rec
.
replace
(
'pdb'
,
'rsa'
)))
remove
(
path
.
basename
(
rec
.
replace
(
'pdb'
,
'asa'
)))
remove
(
path
.
basename
(
rec
.
replace
(
'pdb'
,
'log'
)))
remove
(
path
.
basename
(
lig
.
replace
(
'pdb'
,
'rsa'
)))
remove
(
path
.
basename
(
lig
.
replace
(
'pdb'
,
'asa'
)))
remove
(
path
.
basename
(
lig
.
replace
(
'pdb'
,
'log'
)))
for
f
in
glob
.
glob
(
"*.rsa"
):
try
:
remove
(
f
)
except
:
continue
for
f
in
glob
.
glob
(
"*.asa"
):
try
:
remove
(
f
)
except
:
continue
"""
remove(path.basename(rec.replace('pdb', 'rsa')))
remove(path.basename(lig.replace('pdb', 'rsa')))
remove(path.basename(com.replace('pdb', 'rsa')))
remove(path.basename(rec.replace('pdb', 'asa')))
remove(path.basename(lig.replace('pdb', 'asa')))
remove(path.basename(com.replace('pdb', 'asa')))
remove
(
path
.
basename
(
com
.
replace
(
'pdb'
,
'log'
)))
"""
try
:
remove
(
path
.
basename
(
rec
.
replace
(
'pdb'
,
'log'
)))
remove
(
path
.
basename
(
lig
.
replace
(
'pdb'
,
'log'
)))
remove
(
path
.
basename
(
com
.
replace
(
'pdb'
,
'log'
)))
except
:
pass
########################
\ No newline at end of file
Test/test.py
View file @
51214549
...
...
@@ -39,23 +39,26 @@ from sklearn.metrics import mean_squared_error, accuracy_score, roc_auc_score, r
from
sklearn.preprocessing
import
MinMaxScaler
import
pickle
sys
.
path
.
insert
(
1
,
'../lib/'
)
import
tools
as
tl
print
(
'Your python version: {}'
.
format
(
sys
.
version_info
.
major
))
USE_TENSORFLOW_AS_BACKEND
=
True
# IF YOU *DO* HAVE AN Nvidia GPU on your computer, or execute on Google COLAB, then change below to False!
FORCE_CPU
=
False
#False
if
USE_TENSORFLOW_AS_BACKEND
:
os
.
environ
[
'KERAS_BACKEND'
]
=
'tensorflow'
else
:
os
.
environ
[
'KERAS_BACKEND'
]
=
'theano'
if
FORCE_CPU
:
if
tl
.
FORCE_CPU
:
os
.
environ
[
"CUDA_DEVICE_ORDER"
]
=
"PCI_BUS_ID"
# see issue #152
os
.
environ
[
"CUDA_VISIBLE_DEVICES"
]
=
""
if
USE_TENSORFLOW_AS_BACKEND
==
True
:
import
tensorflow
as
tf
print
(
'Your tensorflow version: {}'
.
format
(
tf
.
__version__
))
print
(
"GPU : "
+
tf
.
test
.
gpu_device_name
())
physical_devices
=
tf
.
config
.
experimental
.
list_physical_devices
(
'GPU'
)
tf
.
config
.
experimental
.
set_memory_growth
(
physical_devices
[
0
],
True
)
if
not
tl
.
FORCE_CPU
:
print
(
"GPU : "
+
tf
.
test
.
gpu_device_name
())
physical_devices
=
tf
.
config
.
experimental
.
list_physical_devices
(
'GPU'
)
tf
.
config
.
experimental
.
set_memory_growth
(
physical_devices
[
0
],
True
)
else
:
import
theano
print
(
'Your theano version: {}'
.
format
(
theano
.
__version__
))
...
...
@@ -67,6 +70,7 @@ logging.Logger
seed
(
int
(
np
.
round
(
np
.
random
.
random
()
*
10
)))
#################################################################################################
"""
def save_obj(obj, name):
with open(name + '.pkl', 'wb') as f:
pickle.dump(obj, f, pickle.HIGHEST_PROTOCOL)
...
...
@@ -74,6 +78,7 @@ def save_obj(obj, name):
def load_obj(name):
with open(name + '.pkl', 'rb') as f:
return pickle.load(f)
"""
v_dim
=
24
...
...
@@ -93,7 +98,7 @@ def load_map(sample_path):
sample_path
],
stdout
=
sys
.
stdout
)
X_train
,
y_train
,
reg_type
,
res_pos
,
_
,
info
=
load_obj
(
sample_path
.
replace
(
'.pkl.lz4'
,
''
))
X_train
,
y_train
,
reg_type
,
res_pos
,
_
,
info
=
tl
.
load_obj
(
sample_path
.
replace
(
'.pkl.lz4'
,
''
))
remove
(
sample_path
.
replace
(
'.lz4'
,
''
))
return
X_train
,
y_train
,
reg_type
,
res_pos
,
info
...
...
lib/tools.py
View file @
51214549
...
...
@@ -24,8 +24,10 @@ import sys
import
gzip
#========================================================
#NACCESS
FORCE_CPU
=
False
# IF YOU *DO* HAVE AN Nvidia GPU on your computer, or execute on Google COLAB, then change this option to False!
USE_FREESASA
=
True
NACCESS_PATH
=
'naccess'
FreeSASA_PATH
=
'freesasa'
#========================================================
...
...
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