Author: bugman Date: Thu Oct 2 15:41:18 2014 New Revision: 26140 URL: http://svn.gna.org/viewcvs/relax?rev=26140&view=rev Log: Merged revisions 26137 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r26137 | bugman | 2014-10-02 15:30:58 +0200 (Thu, 02 Oct 2014) | 7 lines Expanded the structure.com user function to accept the atom_id argument. This allows the centre of mass (CoM) calculation to be restricted to a certain subset of atoms. The backend already had support for this feature, but now it is exposed in the frontend. The user function docstring has been slightly modified as well. ........ Modified: branches/frame_order_cleanup/ (props changed) branches/frame_order_cleanup/pipe_control/structure/main.py branches/frame_order_cleanup/user_functions/structure.py Propchange: branches/frame_order_cleanup/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Thu Oct 2 15:41:18 2014 @@ -1 +1 @@ -/trunk:1-26133,26135-26136 +/trunk:1-26139 Modified: branches/frame_order_cleanup/pipe_control/structure/main.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/pipe_control/structure/main.py?rev=26140&r1=26139&r2=26140&view=diff ============================================================================== --- branches/frame_order_cleanup/pipe_control/structure/main.py (original) +++ branches/frame_order_cleanup/pipe_control/structure/main.py Thu Oct 2 15:41:18 2014 @@ -299,18 +299,23 @@ cdp.structure.connect_atom(index1=index1, index2=index2) -def com(model=None): - """Calculate the centre of mass of all structures. - - @keyword model: Only use a specific model. - @type model: int or None +def com(model=None, atom_id=None): + """Calculate the centre of mass (CoM) of all structures. + + The value will be stored in the current data pipe 'com' variable. + + + @keyword model: Only use a specific model. + @type model: int or None + @keyword atom_id: The molecule, residue, and atom identifier string. This matches the spin ID string format. If not given, then all structural data will be used for calculating the CoM. + @type atom_id: str or None """ # Test if the current data pipe exists. check_pipe() # Calculate and store the centre of mass. - cdp.com = pipe_centre_of_mass(model=model) + cdp.com = pipe_centre_of_mass(model=model, atom_id=atom_id) def create_diff_tensor_pdb(scale=1.8e-6, file=None, dir=None, force=False): Modified: branches/frame_order_cleanup/user_functions/structure.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/user_functions/structure.py?rev=26140&r1=26139&r2=26140&view=diff ============================================================================== --- branches/frame_order_cleanup/user_functions/structure.py (original) +++ branches/frame_order_cleanup/user_functions/structure.py Thu Oct 2 15:41:18 2014 @@ -233,13 +233,20 @@ # The structure.com user function. uf = uf_info.add_uf('structure.com') -uf.title = "Calculate the centre of mass for all structures." +uf.title = "Calculate the centre of mass (CoM) for all structures." uf.title_short = "Centre of mass calculation." uf.add_keyarg( name = "model", py_type = "int", desc_short = "model", desc = "The optional structural model number to restrict the calculation of the centre of mass to.", + can_be_none = True +) +uf.add_keyarg( + name = "atom_id", + py_type = "str", + desc_short = "atom ID string", + desc = "The atom identification string to restrict the CoM calculation to.", can_be_none = True ) # Description.