Author: bugman Date: Wed Feb 25 14:16:04 2015 New Revision: 27721 URL: http://svn.gna.org/viewcvs/relax?rev=27721&view=rev Log: Added the new 'atom_id' argument to the frame_order.distribute user function. This uses the new inverse selection functionality recently introduced into the trunk to delete all structural data not matching the atom_id from the copy of the loaded structural data string prior to generating the distribution of structures. Modified: branches/frame_order_cleanup/specific_analyses/frame_order/uf.py branches/frame_order_cleanup/user_functions/frame_order.py Modified: branches/frame_order_cleanup/specific_analyses/frame_order/uf.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/specific_analyses/frame_order/uf.py?rev=27721&r1=27720&r2=27721&view=diff ============================================================================== --- branches/frame_order_cleanup/specific_analyses/frame_order/uf.py (original) +++ branches/frame_order_cleanup/specific_analyses/frame_order/uf.py Wed Feb 25 14:16:04 2015 @@ -47,13 +47,15 @@ from specific_analyses.frame_order.parameters import assemble_param_vector, update_model -def distribute(file="distribution.pdb.bz2", dir=None, total=1000, max_rotations=100000, model=1, force=True): +def distribute(file="distribution.pdb.bz2", dir=None, atom_id=None, total=1000, max_rotations=100000, model=1, force=True): """Create a uniform distribution of structures for the frame order motions. @keyword file: The PDB file for storing the frame order motional distribution. The compression is determined automatically by the file extensions '*.pdb', '*.pdb.gz', and '*.pdb.bz2'. @type file: str @keyword dir: The directory name to place the file into. @type dir: str or None + @keyword atom_id: The atom identification string to allow the distribution to be a subset of all atoms. + @type atom_id: None or str @keyword total: The total number of states/model/structures in the distribution. @type total: int @keyword max_rotations: The maximum number of rotations to generate the distribution from. This prevents an execution for an infinite amount of time when a frame order amplitude parameter is close to zero so that the subset of all rotations within the distribution is close to zero. @@ -108,6 +110,14 @@ # The motional eigenframe. frame = generate_axis_system() + + # Only work with a subset. + if atom_id: + # The inverted selection. + selection = structure.selection(atom_id=atom_id, inv=True) + + # Delete the data. + structure.delete(selection=selection, verbosity=0) # Create the distribution. uniform_distribution(file=file, model=cdp.model, structure=structure, parameters=params, eigenframe=frame, pivot=pivot, atom_id=domain_moving(), total=total, max_rotations=max_rotations) Modified: branches/frame_order_cleanup/user_functions/frame_order.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/user_functions/frame_order.py?rev=27721&r1=27720&r2=27721&view=diff ============================================================================== --- branches/frame_order_cleanup/user_functions/frame_order.py (original) +++ branches/frame_order_cleanup/user_functions/frame_order.py Wed Feb 25 14:16:04 2015 @@ -83,6 +83,13 @@ arg_type = "dir", desc_short = "directory name", desc = "The directory where the files are to be located.", + can_be_none = True +) +uf.add_keyarg( + name = "atom_id", + py_type = "str", + desc_short = "atom identification string", + desc = "The atom identification string to allow the distribution to be a subset of all atoms.", can_be_none = True ) uf.add_keyarg(