Author: bugman Date: Tue Jul 1 12:42:41 2014 New Revision: 24373 URL: http://svn.gna.org/viewcvs/relax?rev=24373&view=rev Log: The motional pivots for the frame order models are now labelled in the geometric representation. The pivot points are now added as a new molecule called 'pivots' in the frame_order.pdb_model user function. The atoms all belong to the PIV residue. The pymol.frame_order user function now selects this residue, hides its atoms, and then shows the atom name 'Piv' as the label. For the double rotor model, the atom names 'Piv1' and 'Piv2' are used to differentiate the pivots. Modified: branches/frame_order_cleanup/pipe_control/pymol_control.py branches/frame_order_cleanup/specific_analyses/frame_order/geometric.py Modified: branches/frame_order_cleanup/pipe_control/pymol_control.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/pipe_control/pymol_control.py?rev=24373&r1=24372&r2=24373&view=diff ============================================================================== --- branches/frame_order_cleanup/pipe_control/pymol_control.py (original) +++ branches/frame_order_cleanup/pipe_control/pymol_control.py Tue Jul 1 12:42:41 2014 @@ -381,6 +381,9 @@ # The object ID. id = file_root(file) + # Set up the pivot points. + represent_pivots(id=id) + # Set up the rotor objects. represent_rotor_object(id=id) @@ -618,6 +621,30 @@ pymol_obj.exec_cmd("cmd.delete('sele')") +def represent_pivots(id=None): + """Set up the PyMOL pivot object representation. + + @keyword id: The PyMOL object ID. + @type id: str + """ + + # Sanity check. + if id == None: + raise RelaxError("The PyMOL object ID must be supplied.") + + # Select the PIV residues. + pymol_obj.exec_cmd("select (%s & resn PIV)" % id) + + # Hide the atom. + pymol_obj.exec_cmd("hide ('sele')") + + # Label using the atom name. + pymol_obj.exec_cmd("cmd.label(\"sele\",\"name\")") + + # Remove the selection. + pymol_obj.exec_cmd("cmd.delete('sele')") + + def represent_rotor_object(id=None): """Set up the PyMOL rotor object representation. Modified: branches/frame_order_cleanup/specific_analyses/frame_order/geometric.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/specific_analyses/frame_order/geometric.py?rev=24373&r1=24372&r2=24373&view=diff ============================================================================== --- branches/frame_order_cleanup/specific_analyses/frame_order/geometric.py (original) +++ branches/frame_order_cleanup/specific_analyses/frame_order/geometric.py Tue Jul 1 12:42:41 2014 @@ -227,6 +227,31 @@ cone(mol=mol_neg, cone_obj=cone_obj, start_res=1, apex=pivot, R=R_neg, inc=inc, distribution='regular', axis_flag=False) +def add_pivots(structure=None): + """Add the pivots for the current frame order model to the structural object. + + @keyword structure: The internal structural object to add the rotor objects to. + @type structure: lib.structure.internal.object.Internal instance + """ + + # The pivot point. + pivot1 = generate_pivot(order=1) + pivot2 = generate_pivot(order=2) + + # Create the molecule. + mol_name = 'pivots' + structure.add_molecule(name=mol_name) + + # Add the pivots for the double motion models. + if cdp.model in ['double rotor']: + structure.add_atom(mol_name=mol_name, pdb_record='HETATM', atom_num=1, atom_name='Piv1', res_name='PIV', res_num=1, pos=pivot1, element='C') + structure.add_atom(mol_name=mol_name, pdb_record='HETATM', atom_num=2, atom_name='Piv2', res_name='PIV', res_num=1, pos=pivot2, element='C') + + # Add the pivot for the single motion models. + else: + structure.add_atom(mol_name=mol_name, pdb_record='HETATM', atom_num=1, atom_name='Piv', res_name='PIV', res_num=1, pos=pivot1, element='C') + + def add_rotors(structure=None): """Add all rotor objects for the current frame order model to the structural object. @@ -401,6 +426,9 @@ if cdp.model not in ['rotor', 'free rotor', 'double rotor']: model_neg = structure.add_model(model=2) + # Add the pivots. + add_pivots(structure=structure) + # Add all rotor objects. add_rotors(structure=structure)