From 79c3c85bf95850b46c0885dd9541a475122f0363 Mon Sep 17 00:00:00 2001 From: Tobias Schmidt <tobias.schmidt@unibas.ch> Date: Tue, 13 Dec 2011 11:39:05 +0100 Subject: [PATCH] make tmalign/tmtools work with charmm style pdb files write out charmm style pdb format if chain name or residue name is too long for standard pdb format --- modules/bindings/pymod/tmtools.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/bindings/pymod/tmtools.py b/modules/bindings/pymod/tmtools.py index 2f53fcb35..3c53b9975 100644 --- a/modules/bindings/pymod/tmtools.py +++ b/modules/bindings/pymod/tmtools.py @@ -34,8 +34,17 @@ from ost import settings, io, geom, seq def _SetupFiles(models): # create temporary directory tmp_dir_name=tempfile.mkdtemp() + dia = 'PDB' for index, model in enumerate(models): - io.SavePDB(model, os.path.join(tmp_dir_name, 'model%02d.pdb' % (index+1))) + for chain in model.chains: + if len(chain.name) > 1: + dia = 'CHARMM' + break; + for res in chain.residues: + if len(res.name) > 3: + dia = 'CHARMM' + break; + io.SavePDB(model, os.path.join(tmp_dir_name, 'model%02d.pdb' % (index+1)), dialect=dia) return tmp_dir_name def _CleanupFiles(dir_name): -- GitLab