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
35d8ef84
Commit
35d8ef84
authored
Mar 16, 2016
by
Gerardo Tauriello
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix: ring-punch-fix was struggling with unclosed gaps.
parent
c5224b22
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
modelling/pymod/_closegaps.py
+8
-8
8 additions, 8 deletions
modelling/pymod/_closegaps.py
modelling/pymod/_pipeline.py
+12
-5
12 additions, 5 deletions
modelling/pymod/_pipeline.py
with
20 additions
and
13 deletions
modelling/pymod/_closegaps.py
+
8
−
8
View file @
35d8ef84
...
...
@@ -387,6 +387,9 @@ def MergeGapsByDistance(mhandle, distance):
stretch of original gaps and the deleted region. Original gaps will be
removed. Stem residues count to the gap, so **A-A-A** has a distance of 0.
IMPORTANT: we assume here that *mhandle* stores gaps sequentially.
An exception can be raised otherwise!
.. literalinclude:: ../../../tests/doc/scripts/modelling_merge_gaps_by_distance.py
:param mhandle: Modelling handle on which to apply change.
...
...
@@ -395,8 +398,6 @@ def MergeGapsByDistance(mhandle, distance):
merge happens.
:type distance: :class:`int`
'''
# IMPORTANT: the assumption is that ModellingHandle stores gaps
# sequentially
if
len
(
mhandle
.
gaps
)
>
1
:
ost
.
LogInfo
(
"
Trying to merge %d gap(s) with distance %d.
"
%
\
...
...
@@ -838,8 +839,7 @@ def ModelTermini(mhandle, scorer, torsion_sampler, fragger_handle=None,
for
g
in
terminal_gaps
:
# work on copy of gap
gap_orig
=
g
.
Copy
()
actual_gap
=
gap_orig
actual_gap
=
g
.
Copy
()
# extract info
if
actual_gap
.
IsNTerminal
():
...
...
@@ -911,7 +911,7 @@ def ModelTermini(mhandle, scorer, torsion_sampler, fragger_handle=None,
min_score
=
score
ost
.
LogVerbose
(
"
Gap %s - %d candidates, best (min) score %g
"
%
(
str
(
gap_orig
),
len
(
candidates
),
min_score
))
(
str
(
actual_gap
),
len
(
candidates
),
min_score
))
# finally resolve loop
if
optimal_candidate
is
not
None
:
...
...
@@ -920,11 +920,11 @@ def ModelTermini(mhandle, scorer, torsion_sampler, fragger_handle=None,
bb_list
.
InsertInto
(
actual_chain
,
start_resnum
)
# update scorer
scorer
.
SetEnvironment
(
bb_list
,
start_resnum
,
actual_chain_idx
)
ost
.
LogInfo
(
"
Resolved
%s by filling
%s (%d candidates)
"
%
\
(
str
(
gap_orig
),
str
(
actual_gap
),
len
(
candidates
)))
ost
.
LogInfo
(
"
Resolved
terminal gap
%s (%d candidates)
"
%
\
(
str
(
actual_gap
),
len
(
candidates
)))
ClearGaps
(
mhandle
,
actual_gap
)
else
:
ost
.
LogInfo
(
"
Failed
at loop insertion
(%s)
"
%
str
(
actual_gap
))
ost
.
LogInfo
(
"
Failed
to model terminal gap
(%s)
"
%
str
(
actual_gap
))
def
CloseLargeDeletions
(
mhandle
,
scorer
,
structure_db
,
linker_length
=
8
,
...
...
This diff is collapsed.
Click to expand it.
modelling/pymod/_pipeline.py
+
12
−
5
View file @
35d8ef84
...
...
@@ -52,13 +52,16 @@ def BuildSidechains(mhandle, merge_distance=4, scorer=None, fragment_db=None,
# check for ring punches
rings
=
GetRings
(
mhandle
.
model
)
ring_punches
=
GetRingPunches
(
rings
,
mhandle
.
model
)
# add gaps to mhandle
for
res
in
ring_punches
:
mygap
=
StructuralGap
(
res
.
prev
,
res
.
next
,
res
.
one_letter_code
)
mhandle
.
gaps
.
append
(
mygap
)
# try to fix them
if
len
(
ring_punches
)
>
0
:
ost
.
LogInfo
(
"
Trying to fix %d ring punch(es).
"
%
len
(
ring_punches
))
# backup old gaps
old_gaps
=
[
g
.
Copy
()
for
g
in
mhandle
.
gaps
]
# new gaps for mhandle
mhandle
.
gaps
=
StructuralGapList
()
for
res
in
ring_punches
:
mygap
=
StructuralGap
(
res
.
prev
,
res
.
next
,
res
.
one_letter_code
)
mhandle
.
gaps
.
append
(
mygap
)
# load stuff if needed
if
scorer
is
None
:
scorer
=
SetupBackboneScorer
(
mhandle
)
...
...
@@ -74,6 +77,10 @@ def BuildSidechains(mhandle, merge_distance=4, scorer=None, fragment_db=None,
torsion_sampler
,
ring_punch_detection
=
2
)
# re-build sidechains
sidechain
.
Reconstruct
(
mhandle
.
model
,
keep_sidechains
=
True
)
# restore gaps
mhandle
.
gaps
=
StructuralGapList
()
for
g
in
old_gaps
:
mhandle
.
gaps
.
append
(
g
)
def
MinimizeModelEnergy
(
mhandle
,
max_iterations
=
3
,
max_iter_sd
=
30
,
...
...
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