Commit 830d6c7f by Peter Eastman

Improved handling of nonstandard nucleotides

parent 8d902d07
......@@ -273,8 +273,12 @@ class PDBFixer(object):
for structChain, topChain in zip(self.structureChains, self.topology.chains()):
for structResidue, topResidue in zip(structChain.iter_residues(), topChain.residues()):
key = (structChain.chain_id, structResidue.number, structResidue.name)
if key in modres and modres[key] in self.templates:
nonstandard[topResidue] = modres[key]
if key in modres:
replacement = modres[key]
if replacement == 'DU':
replacement = 'DT'
if replacement in self.templates:
nonstandard[topResidue] = replacement
self.nonstandardResidues = [(r, nonstandard[r]) for r in sorted(nonstandard, key=lambda r: r.index)]
def replaceNonstandardResidues(self):
......
......@@ -134,10 +134,15 @@ def displayConvertResiduesPage():
for structResidue, topResidue in zip(structChain.iter_residues(), topChain.residues()):
indexInChain[topResidue] = structResidue.number
table = ''
nucleotides = ['DA', 'DC', 'DG', 'DT', 'A', 'C', 'G', 'T']
for i in range(len(fixer.nonstandardResidues)):
residue, replaceWith = fixer.nonstandardResidues[i]
if replaceWith in proteinResidues:
replacements = proteinResidues
else:
replacements = nucleotides
options = ''
for res in proteinResidues:
for res in replacements:
selected = ''
if res == replaceWith:
selected = ' selected'
......
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