Skip to content
Snippets Groups Projects
Commit 79c3c85b authored by Tobias Schmidt's avatar Tobias Schmidt
Browse files

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
parent a350ebb6
Branches
Tags
No related merge requests found
...@@ -34,8 +34,17 @@ from ost import settings, io, geom, seq ...@@ -34,8 +34,17 @@ from ost import settings, io, geom, seq
def _SetupFiles(models): def _SetupFiles(models):
# create temporary directory # create temporary directory
tmp_dir_name=tempfile.mkdtemp() tmp_dir_name=tempfile.mkdtemp()
dia = 'PDB'
for index, model in enumerate(models): 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 return tmp_dir_name
def _CleanupFiles(dir_name): def _CleanupFiles(dir_name):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment