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
6c1caa96
Unverified
Commit
6c1caa96
authored
May 22, 2018
by
peastman
Committed by
GitHub
May 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #168 from peastman/single
Fixed error when a file contains only one residue
parents
733dc3ae
13a801ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
22 deletions
+24
-22
pdbfixer/pdbfixer.py
+20
-19
pdbfixer/tests/test_mutate.py
+4
-3
No files found.
pdbfixer/pdbfixer.py
View file @
6c1caa96
...
...
@@ -928,25 +928,26 @@ class PDBFixer(object):
context
.
setPositions
(
newPositions
)
mm
.
LocalEnergyMinimizer
.
minimize
(
context
)
state
=
context
.
getState
(
getPositions
=
True
)
nearest
=
self
.
_findNearestDistance
(
context
,
newTopology
,
newAtoms
)
if
nearest
<
0.13
:
# Some atoms are very close together. Run some dynamics while slowly increasing the strength of the
# repulsive interaction to try to improve the result.
for
i
in
range
(
10
):
context
.
setParameter
(
'C'
,
0.15
*
(
i
+
1
))
integrator
.
step
(
200
)
d
=
self
.
_findNearestDistance
(
context
,
newTopology
,
newAtoms
)
if
d
>
nearest
:
nearest
=
d
state
=
context
.
getState
(
getPositions
=
True
)
if
nearest
>=
0.13
:
break
context
.
setState
(
state
)
context
.
setParameter
(
'C'
,
1.0
)
mm
.
LocalEnergyMinimizer
.
minimize
(
context
)
state
=
context
.
getState
(
getPositions
=
True
)
if
newTopology
.
getNumResidues
()
>
1
:
nearest
=
self
.
_findNearestDistance
(
context
,
newTopology
,
newAtoms
)
if
nearest
<
0.13
:
# Some atoms are very close together. Run some dynamics while slowly increasing the strength of the
# repulsive interaction to try to improve the result.
for
i
in
range
(
10
):
context
.
setParameter
(
'C'
,
0.15
*
(
i
+
1
))
integrator
.
step
(
200
)
d
=
self
.
_findNearestDistance
(
context
,
newTopology
,
newAtoms
)
if
d
>
nearest
:
nearest
=
d
state
=
context
.
getState
(
getPositions
=
True
)
if
nearest
>=
0.13
:
break
context
.
setState
(
state
)
context
.
setParameter
(
'C'
,
1.0
)
mm
.
LocalEnergyMinimizer
.
minimize
(
context
)
state
=
context
.
getState
(
getPositions
=
True
)
# Now create a new Topology, including all atoms from the original one and adding the missing atoms.
...
...
pdbfixer/tests/test_mutate.py
View file @
6c1caa96
...
...
@@ -10,9 +10,10 @@ def test_mutate_1():
fixer
.
findMissingAtoms
()
fixer
.
addMissingAtoms
()
fixer
.
addMissingHydrogens
(
7.0
)
temp_pdb
=
tempfile
.
NamedTemporaryFile
(
mode
=
'w+'
)
app
.
PDBFile
.
writeFile
(
fixer
.
topology
,
fixer
.
positions
,
temp_pdb
)
pdb
=
app
.
PDBFile
(
temp_pdb
.
name
)
with
tempfile
.
NamedTemporaryFile
(
mode
=
'w+'
)
as
temp_pdb
:
app
.
PDBFile
.
writeFile
(
fixer
.
topology
,
fixer
.
positions
,
temp_pdb
)
temp_pdb
.
flush
()
pdb
=
app
.
PDBFile
(
temp_pdb
.
name
)
new_residue57
=
list
(
fixer
.
topology
.
residues
())[
16
]
assert
new_residue57
.
name
==
"GLY"
,
"Name of mutated residue did not change correctly!"
...
...
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