Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProMod3
Manage
Activity
Members
Plan
Jira
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
ProMod3
Commits
1975720f
Commit
1975720f
authored
8 years ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
Allow to optimize subrotamers when FRM rotamer model is used in Reconstruct
parent
8a6a2bbf
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
sidechain/pymod/_reconstruct_sidechains.py
+53
-4
53 additions, 4 deletions
sidechain/pymod/_reconstruct_sidechains.py
with
53 additions
and
4 deletions
sidechain/pymod/_reconstruct_sidechains.py
+
53
−
4
View file @
1975720f
...
@@ -348,14 +348,43 @@ def _GetDisulfidBridges(frame_residues, cystein_indices, res_list, rotamer_libra
...
@@ -348,14 +348,43 @@ def _GetDisulfidBridges(frame_residues, cystein_indices, res_list, rotamer_libra
disulfid_rotamers
.
append
(
cystein_rot_groups
[
a
[
1
]][
b
[
1
]])
disulfid_rotamers
.
append
(
cystein_rot_groups
[
a
[
1
]][
b
[
1
]])
return
disulfid_indices
,
disulfid_rotamers
return
disulfid_indices
,
disulfid_rotamers
def
RefineFRMRotamerGroups
(
solution
,
frm_rotamer_groups
,
graph_max_complexity
=
100000000
,
graph_initial_epsilon
=
0.02
):
rrm_rotamer_groups
=
list
()
for
i
,
rg
in
enumerate
(
frm_rotamer_groups
):
frm_rotamer
=
rg
[
solution
[
i
]]
rrm_rotamers
=
list
()
original_active_subrotamer
=
frm_rotamer
.
GetActiveSubrotamer
()
for
j
in
range
(
frm_rotamer
.
GetNumSubrotamers
()):
frm_rotamer
.
SetActiveSubrotamer
(
j
)
new_rrm_rotamer
=
frm_rotamer
.
ToRRMRotamer
()
if
(
j
!=
original_active_subrotamer
):
new_rrm_rotamer
.
SetInternalEnergy
(
0.0
)
else
:
new_rrm_rotamer
.
SetInternalEnergy
(
-
0.5
)
rrm_rotamers
.
append
(
new_rrm_rotamer
)
new_rotamer_group
=
sidechain
.
RRMRotamerGroup
(
rrm_rotamers
,
0
)
rrm_rotamer_groups
.
append
(
new_rotamer_group
)
graph
=
sidechain
.
RotamerGraph
.
CreateFromRRMList
(
rrm_rotamer_groups
)
solution
=
graph
.
TreeSolve
(
max_complexity
=
graph_max_complexity
,
initial_epsilon
=
graph_initial_epsilon
)[
0
]
return
(
solution
,
rrm_rotamer_groups
)
###############################################################################
###############################################################################
def
Reconstruct
(
ent
,
keep_sidechains
=
False
,
build_disulfids
=
True
,
def
Reconstruct
(
ent
,
keep_sidechains
=
False
,
build_disulfids
=
True
,
rotamer_model
=
"
frm
"
,
consider_ligands
=
True
,
rotamer_model
=
"
frm
"
,
consider_ligands
=
True
,
rotamer_library
=
None
,
graph_max_complexity
=
100000000
,
rotamer_library
=
None
,
optimize_subrotamers
=
False
,
graph_intial_epsilon
=
0.02
):
graph_max_complexity
=
100000000
,
graph_in
i
tial_epsilon
=
0.02
):
'''
Reconstruct sidechains for the given structure.
'''
Reconstruct sidechains for the given structure.
:param ent: Structure for sidechain reconstruction. Note, that the sidechain
:param ent: Structure for sidechain reconstruction. Note, that the sidechain
...
@@ -385,6 +414,20 @@ def Reconstruct(ent, keep_sidechains=False, build_disulfids=True,
...
@@ -385,6 +414,20 @@ def Reconstruct(ent, keep_sidechains=False, build_disulfids=True,
library.
library.
:type rotamer_library: :class:`BBDepRotamerLib` / :class:`RotamerLib`
:type rotamer_library: :class:`BBDepRotamerLib` / :class:`RotamerLib`
:param optimize_subrotamers: Only considered when **rotamer_model**
is
"
frm
"
.
If set to True, the FRM solution undergoes
some postprocessing. The final FRM rotamers get
turned into :class:`RRMRotamerGroup` objects
and fed into a second run of graph solving to
find the optimal subrotamers from the FRM
model. This mainly improves the reconstruction
performance of bulky sidechains such as
PHE/TYR/TRP. Internal energies of the
:class:`RRMRotamer` objects are set to 0.0,
-0.5 if they represent the active subrotamer
in the :class:`FRMRotamer`.
:param graph_max_complexity: Max. complexity for
:param graph_max_complexity: Max. complexity for
:meth:`RotamerGraph.TreeSolve`.
:meth:`RotamerGraph.TreeSolve`.
:type graph_max_complexity: :class:`int`
:type graph_max_complexity: :class:`int`
...
@@ -474,7 +517,13 @@ def Reconstruct(ent, keep_sidechains=False, build_disulfids=True,
...
@@ -474,7 +517,13 @@ def Reconstruct(ent, keep_sidechains=False, build_disulfids=True,
graph
=
sidechain
.
RotamerGraph
.
CreateFromRRMList
(
rotamer_groups
)
graph
=
sidechain
.
RotamerGraph
.
CreateFromRRMList
(
rotamer_groups
)
solution
=
graph
.
TreeSolve
(
max_complexity
=
graph_max_complexity
,
solution
=
graph
.
TreeSolve
(
max_complexity
=
graph_max_complexity
,
initial_epsilon
=
graph_intial_epsilon
)[
0
]
initial_epsilon
=
graph_initial_epsilon
)[
0
]
if
use_frm
and
optimize_subrotamers
:
solution
,
rotamer_groups
=
RefineFRMRotamerGroups
(
solution
,
rotamer_groups
,
graph_max_complexity
,
graph_initial_epsilon
)
# update structure
# update structure
for
i
,
rot_group
,
sol
in
zip
(
residues_with_rotamer_group
,
rotamer_groups
,
for
i
,
rot_group
,
sol
in
zip
(
residues_with_rotamer_group
,
rotamer_groups
,
...
...
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