From f036ecd2ff490d0a22109fbc14ee7ed600aa2da4 Mon Sep 17 00:00:00 2001 From: "William P. Bricker" Date: Tue, 23 Jul 2019 20:49:13 -0400 Subject: [PATCH 1/2] Added 'TER' signifier to end of chains --- src/pdbgen/pdbgen.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pdbgen/pdbgen.py b/src/pdbgen/pdbgen.py index e181d6b..a91ca08 100644 --- a/src/pdbgen/pdbgen.py +++ b/src/pdbgen/pdbgen.py @@ -990,9 +990,7 @@ def pdbgen(filename,abtype,natype,inputdir,outputdir,log): # Check if the base is 5'-end if baseup == -1: # Multi-model PDB starts new model here - f = open(outputdir + filename + '-multimodel.pdb', 'a') - f.write('MODEL' + '{0:>9s}'.format(str(chainnum + 1)) + '\n') - f.close() + fmm.write('MODEL' + '{0:>9s}'.format(str(chainnum + 1)) + '\n') #print sslength, sslast, baseid @@ -1446,9 +1444,16 @@ def pdbgen(filename,abtype,natype,inputdir,outputdir,log): # Iterate residue indexing resnum += 1 if basedown == -1: + + # Standard PDB end chain + if chainnum < 62: + fpdb.write('TER\n') + + # Chain segment PDB end chain + fseg.write('TER\n') # Multi-model PDB ends model here - fmm.write('ENDMDL\n') + fmm.write('TER\nENDMDL\n') # Iterate chainnum and return mmatomnum to 1 chainnum += 1 From 0460f2f956f71c868a575721bea2b27f725c69d1 Mon Sep 17 00:00:00 2001 From: "William P. Bricker" Date: Tue, 23 Jul 2019 20:52:16 -0400 Subject: [PATCH 2/2] Update pdbgen.py --- src/pdbgen/pdbgen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pdbgen/pdbgen.py b/src/pdbgen/pdbgen.py index a91ca08..f8419e3 100644 --- a/src/pdbgen/pdbgen.py +++ b/src/pdbgen/pdbgen.py @@ -1446,7 +1446,7 @@ def pdbgen(filename,abtype,natype,inputdir,outputdir,log): if basedown == -1: # Standard PDB end chain - if chainnum < 62: + if numchains <= 63: fpdb.write('TER\n') # Chain segment PDB end chain