Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Evry-Paris-Saclay
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
2024 Competition
Software Tools
Evry-Paris-Saclay
Commits
d7f24e04
Commit
d7f24e04
authored
5 months ago
by
paradoxe-tech
Browse files
Options
Downloads
Patches
Plain Diff
added src comparison to summary
parent
896fc561
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
model/Model.py
+33
-20
33 additions, 20 deletions
model/Model.py
with
33 additions
and
20 deletions
model/Model.py
+
33
−
20
View file @
d7f24e04
...
...
@@ -166,35 +166,28 @@ class Model:
write results in a summary file, along with all generated PDBs.
@return (Model): the instance of Model, for chainability purposes.
"""
# initialize the resulting summary TSV
summary
=
"
ID
\t
delta_G
\t
Kd
\t
mutations (AA)
\n
"
if
self
.
verbose
>
0
:
print
(
f
"
Now writing output files :
"
)
# initialize the resulting summary TSV
summary
=
"
ID
\t
delta_G
\t
Kd
\t
mutations (AA)
\n
"
for
b
in
range
(
self
.
_nbatch
()):
# source docking written in summary
src_mean_dg
,
src_mean_kd
=
self
.
_dock
(
os
.
path
.
join
(
self
.
outputdir
,
f
"
batch_
{
b
}
"
,
f
"
{
b
}
_orig_whole.pdb
"
),
os
.
path
.
join
(
self
.
outputdir
,
f
"
batch_
{
b
}
"
,
"
0.sdf
"
)
)
summary
+=
f
"
batch_
{
b
}
/src
\t
{
src_mean_dg
}
\t
{
src_mean_kd
}
\t
0
"
+
"
\n
"
for
i
in
range
(
self
.
size
):
receptor_path
=
os
.
path
.
join
(
self
.
outputdir
,
f
"
batch_
{
b
}
"
,
f
"
{
i
}
_whole.pdb
"
)
ligand_path
=
os
.
path
.
join
(
self
.
outputdir
,
f
"
batch_
{
b
}
"
,
f
"
{
i
}
.sdf
"
)
# compute the docking window around ligand
docking_box
=
compute_box
(
receptor_path
,
ligand_path
)
try
:
energies
=
docking
(
receptor_file
=
prepare
(
receptor_path
),
ligand_file
=
prepare
(
ligand_path
),
center
=
docking_box
[
"
center
"
],
box_size
=
docking_box
[
"
size
"
]
)
except
Exception
as
e
:
print
(
f
"
\t\t
error simulating docking:
{
e
}
"
)
energies
=
np
.
zeros
(
1
)
# calculates the mean Kd and deltaG
mean_kd
=
np
.
mean
([
kd
(
e
)
for
e
in
energies
])
mean_dg
=
np
.
mean
(
energies
)
mean_dg
,
mean_kd
=
self
.
_dock
(
receptor_path
,
ligand_path
)
# find the number of mutations (AA-level)
n_mutations
=
mutations
(
...
...
@@ -217,6 +210,26 @@ class Model:
return
self
def
_dock
(
self
,
receptor_path
,
ligand_path
):
# compute the docking window around ligand
docking_box
=
compute_box
(
receptor_path
,
ligand_path
)
try
:
energies
=
docking
(
receptor_file
=
prepare
(
receptor_path
),
ligand_file
=
prepare
(
ligand_path
),
center
=
docking_box
[
"
center
"
],
box_size
=
docking_box
[
"
size
"
]
)
except
Exception
as
e
:
print
(
f
"
\t\t
error simulating docking:
{
e
}
"
)
energies
=
np
.
zeros
(
1
)
# calculates the mean Kd and deltaG
return
np
.
mean
(
energies
),
np
.
mean
([
kd
(
e
)
for
e
in
energies
])
def
_nbatch
(
self
)
->
int
:
"""
returns the number of batches stored from now in the output directory
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment