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
2e45d526
Commit
2e45d526
authored
4 years ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
Better error handling in superposition dialog to avoid crashing the GUI
parent
c6ff3211
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/gui/pymod/dng/menu.py
+4
-0
4 additions, 0 deletions
modules/gui/pymod/dng/menu.py
modules/gui/pymod/dng/superpositiondialog.py
+11
-5
11 additions, 5 deletions
modules/gui/pymod/dng/superpositiondialog.py
with
15 additions
and
5 deletions
modules/gui/pymod/dng/menu.py
+
4
−
0
View file @
2e45d526
...
@@ -212,6 +212,10 @@ class SceneMenu(QMenu):
...
@@ -212,6 +212,10 @@ class SceneMenu(QMenu):
gfx_ent_1
.
UpdatePositions
()
gfx_ent_1
.
UpdatePositions
()
gfx
.
Scene
().
CenterOn
(
gfx_ent_2
)
gfx
.
Scene
().
CenterOn
(
gfx_ent_2
)
LogScript
(
'
RMSD: %.3f
'
%
sd
.
rmsd
)
LogScript
(
'
RMSD: %.3f
'
%
sd
.
rmsd
)
elif
sd
.
superposition_error
!=
None
:
LogScript
(
'
Superposition Failed:
'
+
sd
.
superposition_error
)
else
:
LogScript
(
'
Superposition Failed!
'
)
class
WindowMenu
(
QMenu
):
class
WindowMenu
(
QMenu
):
def
__init__
(
self
,
parent
=
None
):
def
__init__
(
self
,
parent
=
None
):
...
...
This diff is collapsed.
Click to expand it.
modules/gui/pymod/dng/superpositiondialog.py
+
11
−
5
View file @
2e45d526
...
@@ -122,6 +122,7 @@ class SuperpositionDialog(QtWidgets.QDialog):
...
@@ -122,6 +122,7 @@ class SuperpositionDialog(QtWidgets.QDialog):
self
.
rmsd_superposed_atoms
=
None
self
.
rmsd_superposed_atoms
=
None
self
.
rmsd
=
None
self
.
rmsd
=
None
self
.
fraction_superposed
=
None
self
.
fraction_superposed
=
None
self
.
superposition_error
=
None
self
.
_mmethod_dict
=
{
'
number
'
:
'
number
'
,
self
.
_mmethod_dict
=
{
'
number
'
:
'
number
'
,
'
index
'
:
'
index
'
,
'
index
'
:
'
index
'
,
'
local alignment
'
:
'
local-aln
'
,
'
local alignment
'
:
'
local-aln
'
,
...
@@ -223,11 +224,16 @@ class SuperpositionDialog(QtWidgets.QDialog):
...
@@ -223,11 +224,16 @@ class SuperpositionDialog(QtWidgets.QDialog):
view_one
=
self
.
_chain_one
.
selected_chain
view_one
=
self
.
_chain_one
.
selected_chain
view_two
=
self
.
_chain_two
.
selected_chain
view_two
=
self
.
_chain_two
.
selected_chain
atoms
=
self
.
_GetAtomSelection
()
atoms
=
self
.
_GetAtomSelection
()
sp
=
Superpose
(
view_two
,
view_one
,
try
:
self
.
_mmethod_dict
[
str
(
self
.
_methods
.
currentText
())],
sp
=
Superpose
(
view_two
,
view_one
,
atoms
,
iterative
=
self
.
_iterative
,
self
.
_mmethod_dict
[
str
(
self
.
_methods
.
currentText
())],
max_iterations
=
self
.
_it_in
.
value
(),
atoms
,
iterative
=
self
.
_iterative
,
distance_threshold
=
self
.
_dist_in
.
value
())
max_iterations
=
self
.
_it_in
.
value
(),
distance_threshold
=
self
.
_dist_in
.
value
())
except
Exception
as
e
:
# mark as failed by setting superposition_error and let caller handle it
self
.
superposition_error
=
str
(
e
)
return
self
.
rmsd
=
sp
.
rmsd
self
.
rmsd
=
sp
.
rmsd
if
self
.
_iterative
:
if
self
.
_iterative
:
self
.
rmsd_superposed_atoms
=
sp
.
rmsd_superposed_atoms
self
.
rmsd_superposed_atoms
=
sp
.
rmsd_superposed_atoms
...
...
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