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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
ProMod3
Commits
587014e9
Commit
587014e9
authored
Nov 21, 2016
by
Gerardo Tauriello
Browse files
Options
Downloads
Patches
Plain Diff
Added parametrized graph.TreeSolve params for sidechain.Reconstruct
parent
09267d58
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sidechain/pymod/_reconstruct_sidechains.py
+24
-16
24 additions, 16 deletions
sidechain/pymod/_reconstruct_sidechains.py
sidechain/pymod/export_graph.cc
+12
-6
12 additions, 6 deletions
sidechain/pymod/export_graph.cc
with
36 additions
and
22 deletions
sidechain/pymod/_reconstruct_sidechains.py
+
24
−
16
View file @
587014e9
...
...
@@ -376,43 +376,48 @@ def _GetDisulfidBridges(frame_residues, cystein_indices, res_list, rotamer_libra
def
Reconstruct
(
ent
,
keep_sidechains
=
False
,
build_disulfids
=
True
,
rotamer_model
=
"
frm
"
,
consider_ligands
=
True
,
rotamer_library
=
None
):
rotamer_library
=
None
,
graph_max_complexity
=
100000000
,
graph_intial_epsilon
=
0.02
):
'''
Reconstruct sidechains for the given structure.
:param ent:
Structure for sidechain reconstruction. Note, that the
sidechain
reconstruction gets directly applied on the
structure itself.
:param ent: Structure for sidechain reconstruction. Note, that the
sidechain
reconstruction gets directly applied on the
structure itself.
:type ent: :class:`ost.mol.EntityHandle`
:param keep_sidechains: Flag, whether complete sidechains in *ent* (i.e.
containing all required atoms) should be kept rigid
and directly be added to the frame.
:type keep_sidechains: :class:`bool`
:param build_disulfids: Flag, whether possible disulfid bonds should be
searched. If a disulfid bond is found, the two
participating cysteins are fixed and added to
the frame.
:type build_disulfids: :class:`bool`
:param rotamer_model: Rotamer model to be used, can either be
"
frm
"
or
"
rrm
"
:type rotamer_model: :class:`str`
:param consider_hbonds: Flag, whether hbonds should be evaluated in the
energy function. If set to False, no hydrogens will
be built when building rotamers and frame.
:type consider_hbonds: :class:`bool`
:param consider_ligands: Flag, whether to add ligands (anything in chain
'
_
'
) as static objects.
:type consider_ligands: :class:`bool`
:param rotamer_library: A rotamer library to extract the rotamers from. The
default is the :meth:`Dunbrack <LoadDunbrackLib>`
library.
:type ent: :class:`ost.mol.EntityHandle`
:type keep_sidechains: :class:`bool`
:type build_disulfids: :class:`bool`
:type rotamer_model: :class:`str`
:type consider_hbonds: :class:`bool`
:type consider_ligands: :class:`bool`
:type rotamer_library: :class:`BBDepRotamerLib` / :class:`RotamerLib`
:param graph_max_complexity: Max. complexity for
:meth:`RotamerGraph.TreeSolve`.
:type graph_max_complexity: :class:`int`
:param graph_intial_epsilon: Initial epsilon for
:meth:`RotamerGraph.TreeSolve`.
:type graph_intial_epsilon: :class:`float`
'''
prof_name
=
'
sidechain::Reconstruct
'
prof
=
core
.
StaticRuntimeProfiler
.
StartScoped
(
prof_name
)
...
...
@@ -495,16 +500,19 @@ def Reconstruct(ent, keep_sidechains=False, build_disulfids=True,
else
:
graph
=
sidechain
.
RotamerGraph
.
CreateFromRRMList
(
rotamer_groups
)
solution
=
graph
.
TreeSolve
(
100000000
,
0.02
)[
0
]
solution
=
graph
.
TreeSolve
(
max_complexity
=
graph_max_complexity
,
initial_epsilon
=
graph_intial_epsilon
)[
0
]
# update structure
for
i
,
rot_group
,
sol
in
zip
(
residues_with_rotamer_group
,
rotamer_groups
,
solution
):
for
i
,
rot_group
,
sol
in
zip
(
residues_with_rotamer_group
,
rotamer_groups
,
solution
):
try
:
res_handle
=
prot
.
residues
[
i
].
handle
rot_group
[
sol
].
ApplyOnResidue
(
res_handle
,
consider_hydrogens
=
False
)
sidechain
.
ConnectSidechain
(
res_handle
,
rotamer_ids
[
i
])
except
:
print
"
there is a backbone atom missing...
"
,
res_handle
.
GetQualifiedName
()
print
"
there is a backbone atom missing...
"
,
\
res_handle
.
GetQualifiedName
()
# these methods will be exported into module
__all__
=
(
'
Reconstruct
'
,)
This diff is collapsed.
Click to expand it.
sidechain/pymod/export_graph.cc
+
12
−
6
View file @
587014e9
...
...
@@ -60,16 +60,22 @@ boost::python::tuple WrapAStarSolve(RotamerGraphPtr graph,
void
export_Graph
()
{
class_
<
RotamerGraph
,
boost
::
noncopyable
>
(
"RotamerGraph"
,
no_init
)
.
def
(
"CreateFromRRMList"
,
&
WrapRRMList
,(
arg
(
"rotamer_groups"
))).
staticmethod
(
"CreateFromRRMList"
)
.
def
(
"CreateFromFRMList"
,
&
WrapFRMList
,(
arg
(
"rotamer_groups"
))).
staticmethod
(
"CreateFromFRMList"
)
.
def
(
"Prune"
,
&
RotamerGraph
::
Prune
,(
arg
(
"epsilon"
),
arg
(
"e_cut"
)
=
0.0
,
arg
(
"consider_all_nodes"
)
=
false
))
.
def
(
"CreateFromRRMList"
,
&
WrapRRMList
,
(
arg
(
"rotamer_groups"
)))
.
staticmethod
(
"CreateFromRRMList"
)
.
def
(
"CreateFromFRMList"
,
&
WrapFRMList
,
(
arg
(
"rotamer_groups"
)))
.
staticmethod
(
"CreateFromFRMList"
)
.
def
(
"Prune"
,
&
RotamerGraph
::
Prune
,
(
arg
(
"epsilon"
),
arg
(
"e_cut"
)
=
0.0
,
arg
(
"consider_all_nodes"
)
=
false
))
.
def
(
"Reset"
,
&
RotamerGraph
::
Reset
)
.
def
(
"GetNumNodes"
,
&
RotamerGraph
::
GetNumNodes
)
.
def
(
"GetNumEdges"
,
&
RotamerGraph
::
GetNumEdges
)
.
def
(
"GetNumActiveNodes"
,
&
RotamerGraph
::
GetNumActiveNodes
)
.
def
(
"GetNumActiveEdges"
,
&
RotamerGraph
::
GetNumActiveEdges
)
.
def
(
"TreeSolve"
,
&
WrapTreeSolve
,(
arg
(
"max_complexity"
)
=
std
::
numeric_limits
<
uint64_t
>::
max
(),
arg
(
"initial_epsilon"
)
=
0.02
))
.
def
(
"AStarSolve"
,
&
WrapAStarSolve
,(
arg
(
"e_thresh"
),
arg
(
"max_n"
)
=
100
,
arg
(
"max_visited_nodes"
)
=
100000000
))
.
def
(
"TreeSolve"
,
&
WrapTreeSolve
,
(
arg
(
"max_complexity"
)
=
std
::
numeric_limits
<
uint64_t
>::
max
(),
arg
(
"initial_epsilon"
)
=
0.02
))
.
def
(
"AStarSolve"
,
&
WrapAStarSolve
,
(
arg
(
"e_thresh"
),
arg
(
"max_n"
)
=
100
,
arg
(
"max_visited_nodes"
)
=
100000000
))
;
register_ptr_to_python
<
RotamerGraphPtr
>
();
...
...
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
sign in
to comment