Author: bugman Date: Sun Nov 5 09:11:38 2006 New Revision: 2748 URL: http://svn.gna.org/viewcvs/relax?rev=2748&view=rev Log: Added the function 'self.get_chemical_name()'. This returns the chemical name corresponding to the supplied hetID string. Modified: branches/tensor_pdb/generic_fns/pdb.py Modified: branches/tensor_pdb/generic_fns/pdb.py URL: http://svn.gna.org/viewcvs/relax/branches/tensor_pdb/generic_fns/pdb.py?rev=2748&r1=2747&r2=2748&view=diff ============================================================================== --- branches/tensor_pdb/generic_fns/pdb.py (original) +++ branches/tensor_pdb/generic_fns/pdb.py Sun Nov 5 09:11:38 2006 @@ -397,6 +397,48 @@ tensor_pdb_file.close() + def get_chemical_name(self, hetID): + """Function for returning the chemical name corresponding to the given residue ID. + + The following names are currently returned: + ________________________________________________ + | | | + | hetID | Chemical name | + |________|_____________________________________| + | | | + | TNS | Tensor | + | COM | Centre of mass | + | AXS | Tensor axes | + | SIM | Monte Carlo simulation tensor axes | + |________|_____________________________________| + + + @param res: The residue ID. + @type res: str + @return: The chemical name. + @rtype: str + """ + + # Tensor. + if hetID == 'TNS': + return 'Tensor' + + # Centre of mass. + if hetID == 'COM': + return 'Centre of mass' + + # Tensor axes. + if hetID == 'AXS': + return 'Tensor axes' + + # Monte Carlo simulation tensor axes. + if hetID == 'SIM': + return 'Monte Carlo simulation tensor axes' + + # Unknown hetID. + raise RelaxError, "The residue ID (hetID) " + `hetID` + " is not recognised." + + def load_structures(self): """Function for loading the structures from the PDB file.""" @@ -986,7 +1028,7 @@ - @type file: string + @type file: str @param file: The PDB file name. @return: None """