Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
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
schwede
openstructure
Commits
13c8ab8e
Commit
13c8ab8e
authored
2 years ago
by
Xavier Robin
Browse files
Options
Downloads
Patches
Plain Diff
refactor: SCHWED-5783 defer assignment
parent
ca81bec6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/mol/alg/pymod/ligand_scoring.py
+8
-6
8 additions, 6 deletions
modules/mol/alg/pymod/ligand_scoring.py
with
8 additions
and
6 deletions
modules/mol/alg/pymod/ligand_scoring.py
+
8
−
6
View file @
13c8ab8e
...
@@ -381,9 +381,9 @@ class LigandScorer:
...
@@ -381,9 +381,9 @@ class LigandScorer:
def
_compute_scores
(
self
):
def
_compute_scores
(
self
):
""""""
""""""
# Create the matrix
# Create the matrix
self
.
_
rmsd_full_matrix
=
np
.
empty
(
rmsd_full_matrix
=
np
.
empty
(
(
len
(
self
.
target_ligands
),
len
(
self
.
model_ligands
)),
dtype
=
dict
)
(
len
(
self
.
target_ligands
),
len
(
self
.
model_ligands
)),
dtype
=
dict
)
self
.
_
lddt_pli_full_matrix
=
np
.
empty
(
lddt_pli_full_matrix
=
np
.
empty
(
(
len
(
self
.
target_ligands
),
len
(
self
.
model_ligands
)),
dtype
=
dict
)
(
len
(
self
.
target_ligands
),
len
(
self
.
model_ligands
)),
dtype
=
dict
)
for
target_i
,
target_ligand
in
enumerate
(
self
.
target_ligands
):
for
target_i
,
target_ligand
in
enumerate
(
self
.
target_ligands
):
LogVerbose
(
"
Analyzing target ligand %s
"
%
target_ligand
)
LogVerbose
(
"
Analyzing target ligand %s
"
%
target_ligand
)
...
@@ -427,7 +427,7 @@ class LigandScorer:
...
@@ -427,7 +427,7 @@ class LigandScorer:
rmsd
=
SCRMSD
(
model_ligand
,
target_ligand
,
rmsd
=
SCRMSD
(
model_ligand
,
target_ligand
,
transformation
=
binding_site
.
transform
,
transformation
=
binding_site
.
transform
,
substructure_match
=
self
.
substructure_match
)
substructure_match
=
self
.
substructure_match
)
self
.
_
rmsd_full_matrix
[
target_i
,
model_i
]
=
{
rmsd_full_matrix
[
target_i
,
model_i
]
=
{
"
rmsd
"
:
rmsd
,
"
rmsd
"
:
rmsd
,
"
chain_mapping
"
:
binding_site
.
GetFlatChainMapping
(),
"
chain_mapping
"
:
binding_site
.
GetFlatChainMapping
(),
"
lddt_bs
"
:
binding_site
.
lDDT
,
"
lddt_bs
"
:
binding_site
.
lDDT
,
...
@@ -451,7 +451,7 @@ class LigandScorer:
...
@@ -451,7 +451,7 @@ class LigandScorer:
# LogWarning("Can't calculate backbone RMSD: %s"
# LogWarning("Can't calculate backbone RMSD: %s"
# " - setting to Infinity" % str(err))
# " - setting to Infinity" % str(err))
# bb_rmsd = float("inf")
# bb_rmsd = float("inf")
self
.
_
lddt_pli_full_matrix
[
target_i
,
model_i
]
=
{
lddt_pli_full_matrix
[
target_i
,
model_i
]
=
{
"
lddt_pli
"
:
0
,
"
lddt_pli
"
:
0
,
"
lddt_pli_n_contacts
"
:
None
,
"
lddt_pli_n_contacts
"
:
None
,
"
rmsd
"
:
rmsd
,
"
rmsd
"
:
rmsd
,
...
@@ -485,13 +485,15 @@ class LigandScorer:
...
@@ -485,13 +485,15 @@ class LigandScorer:
check_resnames
=
self
.
check_resnames
)
check_resnames
=
self
.
check_resnames
)
# Save results?
# Save results?
best_lddt
=
self
.
_
lddt_pli_full_matrix
[
best_lddt
=
lddt_pli_full_matrix
[
target_i
,
model_i
][
"
lddt_pli
"
]
target_i
,
model_i
][
"
lddt_pli
"
]
if
global_lddt
>
best_lddt
:
if
global_lddt
>
best_lddt
:
self
.
_
lddt_pli_full_matrix
[
target_i
,
model_i
].
update
({
lddt_pli_full_matrix
[
target_i
,
model_i
].
update
({
"
lddt_pli
"
:
global_lddt
,
"
lddt_pli
"
:
global_lddt
,
"
lddt_pli_n_contacts
"
:
lddt_tot
,
"
lddt_pli_n_contacts
"
:
lddt_tot
,
})
})
self
.
_rmsd_full_matrix
=
rmsd_full_matrix
self
.
_lddt_pli_full_matrix
=
lddt_pli_full_matrix
@staticmethod
@staticmethod
def
_find_ligand_assignment
(
mat1
,
mat2
):
def
_find_ligand_assignment
(
mat1
,
mat2
):
...
...
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