Author: bugman Date: Mon Apr 7 13:49:36 2008 New Revision: 5346 URL: http://svn.gna.org/viewcvs/relax?rev=5346&view=rev Log: Made one of the methods private by renaming to __get_chemical_name(). Modified: 1.3/generic_fns/structure/internal_pdb.py Modified: 1.3/generic_fns/structure/internal_pdb.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/internal_pdb.py?rev=5346&r1=5345&r2=5346&view=diff ============================================================================== --- 1.3/generic_fns/structure/internal_pdb.py (original) +++ 1.3/generic_fns/structure/internal_pdb.py Mon Apr 7 13:49:36 2008 @@ -51,6 +51,60 @@ # Identification string. id = 'internal pdb' + + + def __get_chemical_name(self, hetID): + """Method 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' + + # Pivot point. + if hetID == 'PIV': + return 'Pivot point' + + # Cone object. + if hetID == 'CON': + return 'Cone' + + # Average vector. + if hetID == 'AVE': + return 'Average vector' + + # Unknown hetID. + raise RelaxError, "The residue ID (hetID) " + `hetID` + " is not recognised." def atom_add(self, atom_id=None, record_name='', atom_name='', res_name='', chain_id='', res_num=None, pos=[None, None, None], segment_id='', element=''): @@ -131,60 +185,6 @@ self.structural_data[bonded_id].append(atom_num) - def get_chemical_name(self, hetID): - """Method 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' - - # Pivot point. - if hetID == 'PIV': - return 'Pivot point' - - # Cone object. - if hetID == 'CON': - return 'Cone' - - # Average vector. - if hetID == 'AVE': - return 'Average vector' - - # Unknown hetID. - raise RelaxError, "The residue ID (hetID) " + `hetID` + " is not recognised." - - def terminate(self, atom_id_ext='', res_num=None): """Method for terminating the chain by adding a TER record to the structral data object. @@ -301,7 +301,7 @@ residues.append(het[1]) # Get the chemical name. - chemical_name = get_chemical_name(het[1]) + chemical_name = self.__get_chemical_name(het[1]) # Write the HETNAM records. file.write("%-6s %2s %3s %-55s\n" % ('HETNAM', '', het[1], chemical_name))