Author: bugman Date: Tue Jan 21 10:30:24 2014 New Revision: 22034 URL: http://svn.gna.org/viewcvs/relax?rev=22034&view=rev Log: Fix for bug #21522 (https://gna.org/bugs/?21522) and bug #21520 (https://gna.org/bugs/?21520). These bugs are the structure.write_pdb user function creating an incorrect MASTER record and the failure of the structure.write_pdb user function when creating the MASTER record due to too many ATOM and HETATM records being present. The counts for the ATOM, HETATM, and TER records are now only for a single model, rather than being the sum for all models together. Modified: trunk/lib/structure/internal/object.py Modified: trunk/lib/structure/internal/object.py URL: http://svn.gna.org/viewcvs/relax/trunk/lib/structure/internal/object.py?rev=22034&r1=22033&r2=22034&view=diff ============================================================================== --- trunk/lib/structure/internal/object.py (original) +++ trunk/lib/structure/internal/object.py Tue Jan 21 10:30:24 2014 @@ -2358,12 +2358,6 @@ # Validate the structural data. self.validate() - # Initialise record counts. - num_hetatm = 0 - num_atom = 0 - num_ter = 0 - num_conect = 0 - # Print out. print("\nCreating the PDB records\n") @@ -2562,6 +2556,11 @@ # Loop over the models. for model in self.model_loop(model_num): + # Initialise record counts. + num_hetatm = 0 + num_atom = 0 + num_ter = 0 + # MODEL record, for multiple models. #################################### @@ -2650,6 +2649,9 @@ # Print out. print("CONECT") + # Initialise record counts. + num_conect = 0 + # Loop over the molecules of the first model. for mol in self.structural_data[0].mol: # Loop over the atoms.