Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pdbfixer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pdbfixer
Commits
08c22124
Commit
08c22124
authored
May 14, 2014
by
Kyle Beauchamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give nicer error when index not found.
parent
33d2d841
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
pdbfixer/pdbfixer.py
+3
-0
tests/test_mutate.py
+8
-0
No files found.
pdbfixer/pdbfixer.py
View file @
08c22124
...
...
@@ -592,6 +592,9 @@ class PDBFixer(object):
old_name
,
index
,
new_name
=
mut_str
.
split
(
"-"
)
index
=
int
(
index
)
if
index
not
in
index_to_old_name
:
raise
(
KeyError
(
"Cannot find index
%
d in system!"
%
index
))
if
index_to_old_name
[
index
]
!=
old_name
:
raise
(
ValueError
(
"You asked to mutate
%
s
%
d, but that residue is actually
%
s!"
%
(
old_name
,
index
,
index_to_old_name
[
index
])))
...
...
tests/test_mutate.py
View file @
08c22124
...
...
@@ -30,3 +30,11 @@ def test_mutate_4_fails():
fixer
.
applyMutations
([
"ALA-16-WTF"
,
"SER-15-ALA"
])
fixer
.
addMissingHydrogens
(
7.0
)
app
.
PDBFile
.
writeFile
(
fixer
.
topology
,
fixer
.
positions
,
tempfile
.
TemporaryFile
())
@raises
(
KeyError
)
def
test_mutate_5_fails
():
fixer
=
pdbfixer
.
PDBFixer
(
pdbid
=
'1VII'
)
fixer
.
applyMutations
([
"ALA-1000-GLY"
,
"SER-15-ALA"
])
fixer
.
addMissingHydrogens
(
7.0
)
app
.
PDBFile
.
writeFile
(
fixer
.
topology
,
fixer
.
positions
,
tempfile
.
TemporaryFile
())
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment