Author: bugman Date: Tue Nov 27 16:40:21 2012 New Revision: 18039 URL: http://svn.gna.org/viewcvs/relax?rev=18039&view=rev Log: Merged revisions 18028,18031-18032 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r18028 | bugman | 2012-11-23 16:34:37 +0100 (Fri, 23 Nov 2012) | 3 lines The rdc.write and pcs.write user functions now skip deselected spins. ........ r18031 | bugman | 2012-11-26 12:21:05 +0100 (Mon, 26 Nov 2012) | 6 lines The axis for PDB geometric cone can now be turned off in the create_cone_pdb() function. The axis_flag keyword argument is now accepted and if False will cause the axis to be excluded. This is useful for the frame order cones for example as its own {x,y,z}-axis system is created. ........ r18032 | bugman | 2012-11-26 12:24:45 +0100 (Mon, 26 Nov 2012) | 3 lines Many docstring fixes for the functions of the generic_fns.structure.geometric module. ........ Modified: branches/cst/ (props changed) branches/cst/generic_fns/pcs.py branches/cst/generic_fns/rdc.py branches/cst/generic_fns/structure/geometric.py Propchange: branches/cst/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Tue Nov 27 16:40:21 2012 @@ -1,1 +1,1 @@ -/trunk:1-17998 +/trunk:1-18038 Modified: branches/cst/generic_fns/pcs.py URL: http://svn.gna.org/viewcvs/relax/branches/cst/generic_fns/pcs.py?rev=18039&r1=18038&r2=18039&view=diff ============================================================================== --- branches/cst/generic_fns/pcs.py (original) +++ branches/cst/generic_fns/pcs.py Tue Nov 27 16:40:21 2012 @@ -733,6 +733,10 @@ values = [] errors = [] for spin, mol_name, res_num, res_name in spin_loop(full_info=True): + # Skip deselected spins. + if not spin.select: + continue + # Skip spins with no PCSs. if not bc and (not hasattr(spin, 'pcs') or not align_id in spin.pcs.keys()): continue Modified: branches/cst/generic_fns/rdc.py URL: http://svn.gna.org/viewcvs/relax/branches/cst/generic_fns/rdc.py?rev=18039&r1=18038&r2=18039&view=diff ============================================================================== --- branches/cst/generic_fns/rdc.py (original) +++ branches/cst/generic_fns/rdc.py Tue Nov 27 16:40:21 2012 @@ -753,6 +753,10 @@ # Loop over the interatomic data containers and collect the data. data = [] for interatom in interatomic_loop(): + # Skip deselected containers. + if not interatom.select: + continue + # Skip containers with no RDCs. if not bc and (not hasattr(interatom, 'rdc') or align_id not in interatom.rdc.keys()): continue Modified: branches/cst/generic_fns/structure/geometric.py URL: http://svn.gna.org/viewcvs/relax/branches/cst/generic_fns/structure/geometric.py?rev=18039&r1=18038&r2=18039&view=diff ============================================================================== --- branches/cst/generic_fns/structure/geometric.py (original) +++ branches/cst/generic_fns/structure/geometric.py Tue Nov 27 16:40:21 2012 @@ -107,10 +107,10 @@ def autoscale_tensor(method='mass'): """Automatically determine an appropriate scaling factor for display of the diffusion tensor. - @param method: The method used to determine the scaling of the diffusion tensor object. - @type method: str - @return: The scaling factor. - @rtype: float + @keyword method: The method used to determine the scaling of the diffusion tensor object. + @type method: str + @return: The scaling factor. + @rtype: float """ # Centre of mass method. @@ -127,9 +127,7 @@ def cone_edge(mol=None, cone=None, res_name='CON', res_num=None, chain_id='', apex=None, axis=None, R=None, scale=None, inc=None, distribution='uniform', debug=False): """Add a residue to the atomic data representing a cone of the given angle. - A series of vectors totalling the number of increments and starting at the origin are equally - spaced around the cone axis. The atoms representing neighbouring vectors will be directly - bonded together. This will generate an object representing the outer edge of a cone. + A series of vectors totalling the number of increments and starting at the origin are equally spaced around the cone axis. The atoms representing neighbouring vectors will be directly bonded together. This will generate an object representing the outer edge of a cone. @keyword mol: The molecule container. @@ -313,7 +311,7 @@ mol.atom_connect(index1=atom_num-2, index2=origin_atom) -def create_cone_pdb(mol=None, cone=None, start_res=1, apex=None, axis=None, R=None, inc=None, scale=30.0, distribution='regular', file=None, dir=None, force=False): +def create_cone_pdb(mol=None, cone=None, start_res=1, apex=None, axis=None, R=None, inc=None, scale=30.0, distribution='regular', file=None, dir=None, force=False, axis_flag=True): """Create a PDB representation of the given cone object. @keyword mol: The molecule container. @@ -334,12 +332,14 @@ @type scale: float @keyword distribution: The type of point distribution to use. This can be 'uniform' or 'regular'. @type distribution: str - @param file: The name of the PDB file to create. + @keyword file: The name of the PDB file to create. @type file: str - @param dir: The name of the directory to place the PDB file into. + @keyword dir: The name of the directory to place the PDB file into. @type dir: str - @param force: Flag which if set to True will overwrite any pre-existing file. + @keyword force: Flag which if set to True will overwrite any pre-existing file. @type force: bool + @keyword axis_flag: A flag which if True will create the cone's axis. + @type axis_flag: bool """ # The cone axis default of the z-axis. @@ -366,12 +366,14 @@ if hasattr(mol, 'atom_num'): start_atom = mol.atom_num[-1]+1 - # Add the apex. - mol.atom_add(pdb_record='HETATM', atom_num=start_atom, atom_name='R', res_name='APX', res_num=start_res, pos=apex, element='C') - - # Generate the axis vectors. - print("\nGenerating the axis vectors.") - res_num = generate_vector_residues(mol=mol, vector=dot(R, axis), atom_name='Axis', res_name_vect='AXE', res_num=start_res+1, origin=apex, scale=scale) + # The axis. + if axis_flag: + # Add the apex. + mol.atom_add(pdb_record='HETATM', atom_num=start_atom, atom_name='R', res_name='APX', res_num=start_res, pos=apex, element='C') + + # Generate the axis vectors. + print("\nGenerating the axis vectors.") + res_num = generate_vector_residues(mol=mol, vector=dot(R, axis), atom_name='Axis', res_name_vect='AXE', res_num=start_res+1, origin=apex, scale=scale) # Generate the cone outer edge. print("\nGenerating the cone outer edge.") @@ -401,13 +403,13 @@ def create_diff_tensor_pdb(scale=1.8e-6, file=None, dir=None, force=False): """Create the PDB representation of the diffusion tensor. - @param scale: The scaling factor for the diffusion tensor. + @keyword scale: The scaling factor for the diffusion tensor. @type scale: float - @param file: The name of the PDB file to create. + @keyword file: The name of the PDB file to create. @type file: str - @param dir: The name of the directory to place the PDB file into. + @keyword dir: The name of the directory to place the PDB file into. @type dir: str - @param force: Flag which if set to True will overwrite any pre-existing file. + @keyword force: Flag which if set to True will overwrite any pre-existing file. @type force: bool """ @@ -584,15 +586,15 @@ def create_vector_dist(length=None, symmetry=True, file=None, dir=None, force=False): """Create a PDB representation of the vector distribution. - @param length: The length to set the vectors to in the PDB file. + @keyword length: The length to set the vectors to in the PDB file. @type length: float - @param symmetry: The symmetry flag which if set will create a second PDB chain 'B' which is the same as chain 'A' but with the vectors reversed. + @keyword symmetry: The symmetry flag which if set will create a second PDB chain 'B' which is the same as chain 'A' but with the vectors reversed. @type symmetry: bool - @param file: The name of the PDB file to create. + @keyword file: The name of the PDB file to create. @type file: str - @param dir: The name of the directory to place the PDB file into. + @keyword dir: The name of the directory to place the PDB file into. @type dir: str - @param force: Flag which if set will overwrite any pre-existing file. + @keyword force: Flag which if set will overwrite any pre-existing file. @type force: bool """ @@ -873,35 +875,34 @@ def generate_vector_residues(mol=None, vector=None, atom_name=None, res_name_vect='AXS', sim_vectors=None, res_name_sim='SIM', chain_id='', res_num=None, origin=None, scale=1.0, label_placement=1.1, neg=False): """Generate residue representations for the vector and the MC simulationed vectors. - This is used to create a PDB representation of any vector, including its Monte Carlo - simulations. - - @keyword mol: The molecule container. - @type mol: MolContainer instance - @param vector: The vector to be represented in the PDB. - @type vector: numpy array, len 3 - @param atom_name: The atom name used to label the atom representing the head of the vector. - @type atom_name: str - @param res_name_vect: The 3 letter PDB residue code used to represent the vector. - @type res_name_vect: str - @param sim_vectors: The optional Monte Carlo simulation vectors to be represented in the PDB. - @type sim_vectors: list of numpy array, each len 3 - @param res_name_sim: The 3 letter PDB residue code used to represent the Monte Carlo simulation vectors. - @type res_name_sim: str - @param chain_id: The chain identification code. - @type chain_id: str - @param res_num: The residue number. - @type res_num: int - @param origin: The origin for the axis. - @type origin: numpy array, len 3 - @param scale: The scaling factor to stretch the vectors by. - @type scale: float - @param label_placement: A scaling factor to multiply the pre-scaled vector by. This is used to place the vector labels a little further out from the vector itself. - @type label_placement: float - @param neg: If True, then the negative vector positioned at the origin will also be included. - @type neg: bool - @return: The new residue number. - @rtype: int + This is used to create a PDB representation of any vector, including its Monte Carlo simulations. + + @keyword mol: The molecule container. + @type mol: MolContainer instance + @keyword vector: The vector to be represented in the PDB. + @type vector: numpy array, len 3 + @keyword atom_name: The atom name used to label the atom representing the head of the vector. + @type atom_name: str + @keyword res_name_vect: The 3 letter PDB residue code used to represent the vector. + @type res_name_vect: str + @keyword sim_vectors: The optional Monte Carlo simulation vectors to be represented in the PDB. + @type sim_vectors: list of numpy array, each len 3 + @keyword res_name_sim: The 3 letter PDB residue code used to represent the Monte Carlo simulation vectors. + @type res_name_sim: str + @keyword chain_id: The chain identification code. + @type chain_id: str + @keyword res_num: The residue number. + @type res_num: int + @keyword origin: The origin for the axis. + @type origin: numpy array, len 3 + @keyword scale: The scaling factor to stretch the vectors by. + @type scale: float + @keyword label_placement: A scaling factor to multiply the pre-scaled vector by. This is used to place the vector labels a little further out from the vector itself. + @type label_placement: float + @keyword neg: If True, then the negative vector positioned at the origin will also be included. + @type neg: bool + @return: The new residue number. + @rtype: int """ # The atom numbers (and indices).