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

Module geometric

source code

Functions [hide private]
 
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
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]
  __package__ = 'lib.structure'

Imports: cos, pi, sin, arccos, array, dot, eye, float64, zeros, angles_regular, angles_uniform, get_proton_name


Function Details [hide private]

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.

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.