Commit cc920d6a authored by Rafal P. Wiewiora's avatar Rafal P. Wiewiora
Browse files

clean up extraParticleIdentifier None

parent adb707e5
...@@ -798,8 +798,6 @@ class Atom(object): ...@@ -798,8 +798,6 @@ class Atom(object):
# figure out atom element # figure out atom element
if self.element_symbol == extraParticleIdentifier: if self.element_symbol == extraParticleIdentifier:
self.element = 'EP' self.element = 'EP'
elif not self.element_symbol and extraParticleIdentifier is None:
self.element = 'EP'
else: else:
try: try:
# Try to find a sensible element symbol from columns 76-77 # Try to find a sensible element symbol from columns 76-77
......
...@@ -239,7 +239,7 @@ class PDBFile(object): ...@@ -239,7 +239,7 @@ class PDBFile(object):
map[atom.attrib[id]] = name map[atom.attrib[id]] = name
@staticmethod @staticmethod
def writeFile(topology, positions, file=sys.stdout, keepIds=False, extraParticleIdentifier='EP'): def writeFile(topology, positions, file=sys.stdout, keepIds=False, extraParticleIdentifier=' '):
"""Write a PDB file containing a single model. """Write a PDB file containing a single model.
Parameters Parameters
...@@ -280,7 +280,7 @@ class PDBFile(object): ...@@ -280,7 +280,7 @@ class PDBFile(object):
a*10, b*10, c*10, alpha*RAD_TO_DEG, beta*RAD_TO_DEG, gamma*RAD_TO_DEG), file=file) a*10, b*10, c*10, alpha*RAD_TO_DEG, beta*RAD_TO_DEG, gamma*RAD_TO_DEG), file=file)
@staticmethod @staticmethod
def writeModel(topology, positions, file=sys.stdout, modelIndex=None, keepIds=False, extraParticleIdentifier='EP'): def writeModel(topology, positions, file=sys.stdout, modelIndex=None, keepIds=False, extraParticleIdentifier=' '):
"""Write out a model to a PDB file. """Write out a model to a PDB file.
Parameters Parameters
...@@ -331,10 +331,8 @@ class PDBFile(object): ...@@ -331,10 +331,8 @@ class PDBFile(object):
for atom in res.atoms(): for atom in res.atoms():
if atom.element is not None: if atom.element is not None:
symbol = atom.element.symbol symbol = atom.element.symbol
elif atom.element is None and extraParticleIdentifier is not None:
symbol = extraParticleIdentifier
else: else:
symbol = ' ' symbol = extraParticleIdentifier
if len(atom.name) < 4 and atom.name[:1].isalpha() and len(symbol) < 2: if len(atom.name) < 4 and atom.name[:1].isalpha() and len(symbol) < 2:
atomName = ' '+atom.name atomName = ' '+atom.name
elif len(atom.name) > 4: elif len(atom.name) > 4:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment