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
9ddc4b1c
Verified
Commit
9ddc4b1c
authored
1 year ago
by
Xavier Robin
Browse files
Options
Downloads
Patches
Plain Diff
fix: compute chain mapping only once
parent
b5ec0d9e
Branches
Branches containing commit
Tags
Tags containing commit
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
+9
-2
9 additions, 2 deletions
modules/mol/alg/pymod/ligand_scoring.py
with
9 additions
and
2 deletions
modules/mol/alg/pymod/ligand_scoring.py
+
9
−
2
View file @
9ddc4b1c
...
...
@@ -278,6 +278,7 @@ class LigandScorer:
# lazily precomputed variables
self
.
_binding_sites
=
{}
self
.
__model_mapping
=
None
@property
def
chain_mapper
(
self
):
...
...
@@ -291,6 +292,13 @@ class LigandScorer:
resnum_alignments
=
self
.
resnum_alignments
)
return
self
.
_chain_mapper
@property
def
_model_mapping
(
self
):
"""
Get the global chain mapping for the model.
"""
if
self
.
__model_mapping
is
None
:
self
.
__model_mapping
=
self
.
chain_mapper
.
GetMapping
(
self
.
model
)
return
self
.
__model_mapping
@staticmethod
def
_extract_ligands
(
entity
):
"""
Extract ligands from entity. Return a list of residues.
...
...
@@ -453,10 +461,9 @@ class LigandScorer:
# Find the representations
if
self
.
global_chain_mapping
:
mapping_res
=
self
.
chain_mapper
.
GetMapping
(
self
.
model
)
self
.
_binding_sites
[
ligand
.
hash_code
]
=
self
.
chain_mapper
.
GetRepr
(
ref_bs
,
self
.
model
,
inclusion_radius
=
self
.
lddt_lp_radius
,
global_mapping
=
mapping
_res
)
global_mapping
=
self
.
_model_
mapping
)
else
:
self
.
_binding_sites
[
ligand
.
hash_code
]
=
self
.
chain_mapper
.
GetRepr
(
ref_bs
,
self
.
model
,
inclusion_radius
=
self
.
lddt_lp_radius
,
...
...
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