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
e546d5a5
Commit
e546d5a5
authored
Aug 03, 2015
by
peastman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #102 from peastman/addedbonds
Fixed error when _addAtomsToTopology() added bonds but not atoms
parents
e1f65bf5
75b20c6e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletions
+20
-1
pdbfixer/pdbfixer.py
+20
-1
No files found.
pdbfixer/pdbfixer.py
View file @
e546d5a5
...
...
@@ -776,7 +776,26 @@ class PDBFixer(object):
# Create a Topology that 1) adds missing atoms, 2) removes all hydrogens, and 3) removes unknown molecules.
(
newTopology
,
newPositions
,
newAtoms
,
existingAtomMap
)
=
self
.
_addAtomsToTopology
(
True
,
True
)
if
len
(
newAtoms
)
>
0
:
if
len
(
newAtoms
)
==
0
:
# No atoms were added, but new bonds might have been created.
newBonds
=
set
(
newTopology
.
bonds
())
for
atom1
,
atom2
in
self
.
topology
.
bonds
():
if
atom1
in
existingAtomMap
and
atom2
in
existingAtomMap
:
a1
=
existingAtomMap
[
atom1
]
a2
=
existingAtomMap
[
atom2
]
if
(
a1
,
a2
)
in
newBonds
:
newBonds
.
remove
((
a1
,
a2
))
elif
(
a2
,
a1
)
in
newBonds
:
newBonds
.
remove
((
a2
,
a1
))
# Add the new bonds to the original Topology.
inverseAtomMap
=
dict
((
y
,
x
)
for
(
x
,
y
)
in
existingAtomMap
.
items
())
for
atom1
,
atom2
in
newTopology
.
bonds
():
self
.
topology
.
addBond
(
inverseAtomMap
[
atom1
],
inverseAtomMap
[
atom2
])
else
:
# Create a System for energy minimizing it.
...
...
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