Author: bugman Date: Wed Feb 11 10:48:24 2015 New Revision: 27626 URL: http://svn.gna.org/viewcvs/relax?rev=27626&view=rev Log: Modified the structure.read_pdb user function backend to skip water molecules. All residues with the name 'HOH' are now skipped when loading PDB files. This is implemented in the MolContainer.fill_object_from_pdb() method, and a RelaxWarning is printed listing the residue numbers of all skipped waters. Modified: trunk/lib/structure/internal/molecules.py Modified: trunk/lib/structure/internal/molecules.py URL: http://svn.gna.org/viewcvs/relax/trunk/lib/structure/internal/molecules.py?rev=27626&r1=27625&r2=27626&view=diff ============================================================================== --- trunk/lib/structure/internal/molecules.py (original) +++ trunk/lib/structure/internal/molecules.py Wed Feb 11 10:48:24 2015 @@ -388,6 +388,7 @@ """ # Loop over the records. + water = [] for record in records: # Nothing to do. if not record or record == '\n': @@ -401,6 +402,11 @@ if record[:6] == 'HETATM': record_type, serial, name, alt_loc, res_name, chain_id, res_seq, icode, x, y, z, occupancy, temp_factor, element, charge = pdb_read.hetatm(record) + # Skip waters. + if res_name == 'HOH': + water.append(res_seq) + continue + # Handle the alternate locations. if alt_loc != None: # Don't know what to do. @@ -435,6 +441,9 @@ # Make the connection. self.atom_connect(index1=self._atom_index(serial), index2=self._atom_index(bonded)) + + if len(water): + warn(RelaxWarning("Skipping the water molecules HOH %s." % water)) def fill_object_from_xyz(self, records):