Package pipe_control :: Package structure :: Module geometric
[hide private]
[frames] | no frames]

Module geometric

source code

Functions [hide private]
array of float, array of float
angles_regular(inc=None)
Determine the spherical angles for a regular sphere point distribution.
source code
array of float, array of float
angles_uniform(inc=None)
Determine the spherical angles for a uniform sphere point distribution.
source code
 
create_rotor_pdb(file=None, dir=None, rotor_angle=None, axis=None, axis_pt=True, centre=None, span=2e-09, blade_length=5e-10, force=False, staggered=False)
Create a PDB representation of a rotor motional model.
source code
 
create_vector_dist(length=None, symmetry=True, file=None, dir=None, force=False)
Create a PDB representation of the vector distribution.
source code
 
generate_vector_dist(mol=None, res_name=None, res_num=None, chain_id='', centre=array([ 0., 0., 0.]), R=array([[ 1., 0., 0..., warp=array([[ 1., 0., 0..., limit_check=None, scale=1.0, inc=20, distribution='uniform', debug=False)
Generate a uniformly distributed distribution of atoms on a warped sphere.
source code
int
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.
source code
str
get_proton_name(atom_num)
Return a valid PDB atom name of <4 characters.
source code
list of rank-1, 3D numpy arrays
vect_dist_spherical_angles(inc=20, distribution='uniform')
Create a distribution of vectors on a sphere using a distribution of spherical angles.
source code
Variables [hide private]
  status = Status()
  __package__ = 'pipe_control.structure'

Imports: cos, pi, sin, arccos, array, dot, eye, float64, zeros, getcwd, RelaxNoPdbError, RelaxNoSequenceError, RelaxNoVectorsError, get_file_path, open_write_file, Internal, rotor_pdb, pipes, interatomic_loop, exists_mol_res_spin_data, return_spin, pipe_centre_of_mass, Status


Function Details [hide private]

angles_regular(inc=None)

source code 

Determine the spherical angles for a regular sphere point distribution.

Parameters:
  • inc (int) - The number of increments in the distribution.
Returns: array of float, array of float
The phi angle array and the theta angle array.

angles_uniform(inc=None)

source code 

Determine the spherical angles for a uniform sphere point distribution.

Parameters:
  • inc (int) - The number of increments in the distribution.
Returns: array of float, array of float
The phi angle array and the theta angle array.

create_rotor_pdb(file=None, dir=None, rotor_angle=None, axis=None, axis_pt=True, centre=None, span=2e-09, blade_length=5e-10, force=False, staggered=False)

source code 

Create a PDB representation of a rotor motional model.

Parameters:
  • file (str) - The name of the PDB file to create.
  • dir (str) - The name of the directory to place the PDB file into.
  • rotor_angle (float) - The angle of the rotor motion in degrees.
  • axis (numpy rank-1, 3D array) - The vector defining the rotor axis.
  • axis_pt (numpy rank-1, 3D array) - A point lying anywhere on the rotor axis. This is used to define the position of the axis in 3D space.
  • centre (numpy rank-1, 3D array) - The central point of the representation. If this point is not on the rotor axis, then the closest point on the axis will be used for the centre.
  • span (float) - The distance from the central point to the rotor blades (meters).
  • blade_length (float) - The length of the representative rotor blades.
  • force (bool) - A flag which if set will overwrite any pre-existing file.
  • staggered (bool) - A flag which if True will cause the rotor blades to be staggered. This is used to avoid blade overlap.

create_vector_dist(length=None, symmetry=True, file=None, dir=None, force=False)

source code 

Create a PDB representation of the vector distribution.

Parameters:
  • length (float) - The length to set the vectors to in the PDB file.
  • symmetry (bool) - 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.
  • file (str) - The name of the PDB file to create.
  • dir (str) - The name of the directory to place the PDB file into.
  • force (bool) - Flag which if set will overwrite any pre-existing file.

generate_vector_dist(mol=None, res_name=None, res_num=None, chain_id='', centre=array([ 0., 0., 0.]), R=array([[ 1., 0., 0..., warp=array([[ 1., 0., 0..., limit_check=None, scale=1.0, inc=20, distribution='uniform', debug=False)

source code 

Generate a uniformly distributed distribution of atoms on a warped sphere.

The vectors from the function vect_dist_spherical_angles() are used to generate the distribution. These vectors are rotated to the desired frame using the rotation matrix 'R', then each compressed or stretched by the dot product with the 'warp' matrix. Each vector is centred and at the head of the vector, a proton is placed.

Parameters:
  • mol (MolContainer instance) - The molecule container.
  • res_name (str) - The residue name.
  • res_num (int) - The residue number.
  • chain_id (str) - The chain identifier.
  • centre (numpy array, len 3) - The centre of the distribution.
  • R (3x3 numpy array) - The optional 3x3 rotation matrix.
  • warp (3x3 numpy array) - The optional 3x3 warping matrix.
  • limit_check (function) - A function with determines the limits of the distribution. It should accept two arguments, the polar angle phi and the azimuthal angle theta, and return True if the point is in the limits or False if outside.
  • scale (float) - The scaling factor to stretch all rotated and warped vectors by.
  • inc (int) - The number of increments or number of vectors.
  • distribution (str) - The type of point distribution to use. This can be 'uniform' or 'regular'.

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)

source code 

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.

Parameters:
  • mol (MolContainer instance) - The molecule container.
  • vector (numpy array, len 3) - The vector to be represented in the PDB.
  • atom_name (str) - The atom name used to label the atom representing the head of the vector.
  • res_name_vect (str) - The 3 letter PDB residue code used to represent the vector.
  • sim_vectors (list of numpy array, each len 3) - The optional Monte Carlo simulation vectors to be represented in the PDB.
  • res_name_sim (str) - The 3 letter PDB residue code used to represent the Monte Carlo simulation vectors.
  • chain_id (str) - The chain identification code.
  • res_num (int) - The residue number.
  • origin (numpy array, len 3) - The origin for the axis.
  • scale (float) - The scaling factor to stretch the vectors by.
  • label_placement (float) - 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.
  • neg (bool) - If True, then the negative vector positioned at the origin will also be included.
Returns: int
The new residue number.

get_proton_name(atom_num)

source code 

Return a valid PDB atom name of <4 characters.

Parameters:
  • atom_num (int) - The number of the atom.
Returns: str
The atom name to use in the PDB.

vect_dist_spherical_angles(inc=20, distribution='uniform')

source code 

Create a distribution of vectors on a sphere using a distribution of spherical angles.

This function returns an array of unit vectors distributed within 3D space. The unit vectors are generated using the equation:

              | cos(theta) * sin(phi) |
   vector  =  | sin(theta) * sin(phi) |.
              |      cos(phi)         |

The vectors of this distribution generate both longitudinal and latitudinal lines.

Parameters:
  • inc (int) - The number of increments in the distribution.
  • distribution (str) - The type of point distribution to use. This can be 'uniform' or 'regular'.
Returns: list of rank-1, 3D numpy arrays
The distribution of vectors on a sphere.