Author: bugman Date: Fri Dec 12 16:06:47 2014 New Revision: 27110 URL: http://svn.gna.org/viewcvs/relax?rev=27110&view=rev Log: Expanded the displace_id argument for the structure.align user function. This can now be a list of atom IDs, so that any atoms can be rotated together with the structure being aligned. This is useful if the molecules argument is supplied. Modified: trunk/pipe_control/structure/main.py trunk/user_functions/structure.py Modified: trunk/pipe_control/structure/main.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/structure/main.py?rev=27110&r1=27109&r2=27110&view=diff ============================================================================== --- trunk/pipe_control/structure/main.py (original) +++ trunk/pipe_control/structure/main.py Fri Dec 12 16:06:47 2014 @@ -117,8 +117,8 @@ @type molecules: None or list of str @keyword atom_id: The molecule, residue, and atom identifier string. This matches the spin ID string format. @type atom_id: str or None - @keyword displace_id: The atom ID string for restricting the displacement to a subset of all atoms. If not set, then all atoms will be translated and rotated. - @type displace_id: str or None + @keyword displace_id: The atom ID string for restricting the displacement to a subset of all atoms. If not set, then all atoms will be translated and rotated. This can be a list of atom IDs with each element corresponding to one of the structures. + @type displace_id: None, str, or list of str @keyword method: The superimposition method. It must be one of 'fit to mean' or 'fit to first'. @type method: str @keyword centre_type: The type of centre to superimpose over. This can either be the standard centroid superimposition or the CoM could be used instead. @@ -153,15 +153,24 @@ # Loop over all pipes, models, and molecules. i = 0 for pipe_index, model_num, mol_name in structure_loop(pipes=pipes, molecules=molecules, models=models, atom_id=atom_id): + # The current displacement ID. + curr_displace_id = None + if isinstance(displace_id, str): + curr_displace_id = displace_id + elif isinstance(displace_id, list): + if len(displace_id) <= i: + raise RelaxError("Not enough displacement ID strings have been provided.") + curr_displace_id = displace_id[i] + # Add the molecule name to the displacement ID if required. - id = displace_id + id = curr_displace_id if molecules != None: - if displace_id == None: + if curr_displace_id == None: id = '#%s' % mol_name - elif search('#', displace_id): - id = displace_id + elif search('#', curr_displace_id): + id = curr_displace_id else: - id = '#%s%s' % (mol_name, displace_id) + id = '#%s%s' % (mol_name, curr_displace_id) # Translate the molecule first (the rotational pivot is defined in the first model). translate(T=T[i], model=model_num, pipe_name=pipes[pipe_index], atom_id=id) Modified: trunk/user_functions/structure.py URL: http://svn.gna.org/viewcvs/relax/trunk/user_functions/structure.py?rev=27110&r1=27109&r2=27110&view=diff ============================================================================== --- trunk/user_functions/structure.py (original) +++ trunk/user_functions/structure.py Fri Dec 12 16:06:47 2014 @@ -197,9 +197,9 @@ ) uf.add_keyarg( name = "displace_id", - py_type = "str", - desc_short = "displacement ID string", - desc = "The atom identification string for restricting the displacement to a subset of all atoms. If not set, then all atoms will be translated and rotated.", + py_type = "str_or_str_list", + desc_short = "displacement ID string(s)", + desc = "The atom identification string for restricting the displacement to a subset of all atoms. If not set, then all atoms will be translated and rotated. If supplied as a list of IDs, then the number of items must match the number of structures.", can_be_none = True ) uf.add_keyarg(