Author: bugman Date: Tue Jul 1 11:59:05 2014 New Revision: 24370 URL: http://svn.gna.org/viewcvs/relax?rev=24370&view=rev Log: Improvements to the internal structural object _get_chemical_name() method. This now uses a translation table to convert the hetID or residue name into a description, for example as used in the PDB HETNAM records to give a human readable description of the residue inside the PDB file itself. The new rotor RTX and RTB residue names have been added to the table as well. Modified: branches/frame_order_cleanup/lib/structure/internal/object.py Modified: branches/frame_order_cleanup/lib/structure/internal/object.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/lib/structure/internal/object.py?rev=24370&r1=24369&r2=24370&view=diff ============================================================================== --- branches/frame_order_cleanup/lib/structure/internal/object.py (original) +++ branches/frame_order_cleanup/lib/structure/internal/object.py Tue Jul 1 11:59:05 2014 @@ -189,19 +189,21 @@ """Return 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 | - | PIV | Pivot point | - | CON | Cone object | - | AVE | Average vector | - |________|_____________________________________| + ___________________________________________________________ + | | | + | hetID | Chemical name | + |________|________________________________________________| + | | | + | TNS | Tensor | + | COM | Centre of mass | + | AXS | Tensor axes | + | SIM | Monte Carlo simulation tensor axes | + | PIV | Pivot point | + | CON | Cone object | + | AVE | Average vector | + | RTX | Axis of the rotor geometric object | + | RTB | Propeller blades of the rotor geometric object | + |________|________________________________________________| For any other residues, no description is returned. @@ -211,33 +213,22 @@ @rtype: str or None """ - # 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' + # Translation table. + table = { + "TNS": "Tensor", + "COM": "Centre of mass", + "AXS": "Tensor axes", + "SIM": "Monte Carlo simulation tensor axes", + "PIV": "Pivot point", + "CON": "Cone object", + "AVE": "Average vector", + "RTX": "Axis of the rotor geometric object", + "RTB": "Propeller blades of the rotor geometric object" + } + + # Return the description, if one exists. + if hetID in table: + return table[hetID] def _parse_models_gaussian(self, file_path, verbosity=1):