GLYLIB
0.3.0b
|
For functions that perform geometric manipulations or calculations on the chemical structures (e.g. assembly, molecule, etc.), it is often necessary to indicate which set of coordinates are to be used for the calculation. In most cases, it is also possible to perform the calculation on coordinates in one location, but leave those untouched and save the results to another location. The same applies to velocities and vectors.
Special variable names and meanings:
xs, vs, xvs: These are the source data on which to base the calculation.
xd, vd, xvd: These are the locations to which changed data should be stored. Note that this location can typically be the same as the source.
xt, vt, xvt: In these cases, two sets of coordinates are being compared to
The variables above can take on the following values:
-1 This tells the function to use the main coordinate set. That is, use atom.x or atom.xv. This value is not relevant to vectors, where there is not a "main" vector.
0, 1, 2, ... A number greater than or equal to zero indicates the location in an array. These values apply to atom.xa[i], atom.xva[i] and atom.v[i].
-2 This is not available in all functions. It indicates that the entire array should be used. This applies to atom.xa[i], atom.xva[i] and atom.v[i].
-3 This is not available in all functions. It indicates that the main coordinates and the entire corresponding array should be used. This applies to { atom.x + atom.xa[i] } and to { atom.xv and atom.xva[i] }. It does not apply to atom.v[i].
Information about vectors:
All of the functions that involve vectors will set the magnitude of the resulting vector without relying on the entry in the input vector. So, for example, there is no need to get_magnitude before normalizing or multiplying by a scalar.
This also means that the vector manipulation functions here are inefficient in that they recalculate the magnitude every time they are called. If you are doing many vector manipulations in which the magnitude is not relevant, you might consider making a similar set that does not recalculate the magnitude.
#define get_vector_from_coords | ( | a, | |
b | |||
) | coord_to_vec(subtract_coord(b,a)) |
Definition at line 19 of file geometries.h.
Referenced by get_cartesian_point_from_internal_coords(), and orient_coords2_to_coords1_dp_list().
#define PI 3.1415926535897932384626433832795028 |
Definition at line 16 of file geometries.h.
Referenced by find_vdw_clashes_pairwize_between_Assemblies(), get_plane_for_ring(), and orient_coords2_to_coords1_dp_list().
Definition at line 7 of file add_coord.c.
References coord_3D::i, coord_3D::j, and coord_3D::k.
Referenced by shift_molecule_atoms_by_vector_scale().
Definition at line 7 of file add_vec.c.
References vectormag_3D::d, vectormag_3D::i, vectormag_3D::j, and vectormag_3D::k.
void apply_rotation_matrix_to_coord_p | ( | coord_3D * | c, |
double * | matrix | ||
) |
Apply the rotation matrix to the given coordinate
Definition at line 66 of file rotations.c.
References coord_3D::i, coord_3D::j, and coord_3D::k.
Referenced by rotate_coords_about_axis_dp_list().
coord_3D** atoms_to_coord_list | ( | atom ** | atoms, |
int | num_atoms | ||
) |
Definition at line 5 of file atoms_to_coord_list.c.
Definition at line 7 of file coord_to_vec.c.
References vectormag_3D::d, coord_3D::i, vectormag_3D::i, coord_3D::j, vectormag_3D::j, coord_3D::k, and vectormag_3D::k.
Referenced by get_angle_ABC(), get_angle_ABC_points(), get_dihedral_ABCD_points(), and get_dihedral_bonded_ABCD().
double* create_rotation_matrix | ( | coord_3D | point, |
vectormag_3D | direction, | ||
double | theta | ||
) |
Create a rotation matrix for a rotation of theta degrees about an axis through the given point in the given direction
Definition at line 16 of file rotations.c.
References vectormag_3D::d, coord_3D::i, vectormag_3D::i, coord_3D::j, vectormag_3D::j, coord_3D::k, vectormag_3D::k, and normalize_vec().
Referenced by rotate_coords_about_axis_dp_list().
void destroy_rotation_matrix | ( | double * | matrix | ) |
Deallocate the rotation matrix
Definition at line 60 of file rotations.c.
Referenced by rotate_coords_about_axis_dp_list().
double get_angle_ABC_points | ( | coord_3D | a, |
coord_3D | b, | ||
coord_3D | c | ||
) |
Get angle abc
Definition at line 17 of file coordinate_manipulations.c.
References coord_to_vec(), get_angle_between_vectors(), and subtract_coord().
Referenced by orient_coords2_to_coords1_dp_list().
double get_angle_between_plane_and_vector | ( | plane | p, |
coord_3D | pt1, | ||
coord_3D | pt2 | ||
) |
Definition at line 5 of file get_angle_between_plane_and_vector.c.
References plane::A, plane::B, plane::C, get_dotprod(), coord_3D::i, vectormag_3D::i, coord_3D::j, vectormag_3D::j, coord_3D::k, and vectormag_3D::k.
double get_angle_between_vectors | ( | vectormag_3D | a, |
vectormag_3D | b | ||
) |
Get angle between two vectors
Definition at line 12 of file coordinate_manipulations.c.
References get_dotprod(), and normalize_vec().
Referenced by get_angle_ABC(), and get_angle_ABC_points().
coord_3D get_cartesian_point_from_internal_coords | ( | coord_3D | a, |
coord_3D | b, | ||
coord_3D | c, | ||
double | theta, | ||
double | phi, | ||
double | distance | ||
) |
Calculate coordinate d, where (1) d is distance units from c (2) angle bcd is theta (3) dihedral between planes abc and bcd is phi
Link to derivation:
Note: should probably change the name of this
Definition at line 90 of file rotations.c.
References get_crossprod(), get_vector_from_coords, coord_3D::i, vectormag_3D::i, coord_3D::j, vectormag_3D::j, coord_3D::k, vectormag_3D::k, and normalize_vec().
Referenced by orient_coords2_to_coords1_dp_list().
Definition at line 7 of file get_crossprod.c.
References vectormag_3D::d, vectormag_3D::i, vectormag_3D::j, and vectormag_3D::k.
Referenced by get_cartesian_point_from_internal_coords(), get_dihedral_ABCD_points(), get_dihedral_bonded_ABCD(), get_plane_for_ring(), orient_coords2_to_coords1_dp_list(), rotate_vector_to_Z_list(), and rotate_vector_to_Z_M().
double get_dihedral_ABCD_points | ( | coord_3D | a, |
coord_3D | b, | ||
coord_3D | c, | ||
coord_3D | d | ||
) |
Get the dihedral angle between planes abc and bcd
This assumes that the bonding goes as: A-B-C-D or that the input vectors follow an equivalent direction convention. When A and D are eclipsed, the angle is zero.
Definition at line 27 of file coordinate_manipulations.c.
References coord_to_vec(), vectormag_3D::d, get_crossprod(), get_dotprod(), scalarmult_vec(), and subtract_coord().
Referenced by orient_coords2_to_coords1_dp_list().
double get_distance_AB_points | ( | coord_3D | a, |
coord_3D | b | ||
) |
Euclidean distance from x to y
Definition at line 8 of file coordinate_manipulations.c.
References coord_3D::i, coord_3D::j, and coord_3D::k.
double get_distance_from_point_to_plane | ( | plane | p, |
coord_3D | pt, | ||
int | absl | ||
) |
This function will return the distance from a point pt to a plane pt. If absl is set to 0, it returns a signed distance ("above" or "below"). If set to 1, it returns the absolute value.
Definition at line 6 of file get_distance_from_point_to_plane.c.
References plane::A, plane::B, plane::C, coord_3D::i, coord_3D::j, and coord_3D::k.
double get_dotprod | ( | vectormag_3D | , |
vectormag_3D | |||
) |
Definition at line 8 of file get_dotprod.c.
References vectormag_3D::i, vectormag_3D::j, and vectormag_3D::k.
Referenced by get_angle_between_plane_and_vector(), get_angle_between_vectors(), get_angle_two_vectors(), get_dihedral_ABCD_points(), and get_dihedral_bonded_ABCD().
coord_3D get_geometric_center | ( | coord_3D * | c, |
int | nc | ||
) |
Definition at line 9 of file get_geometric_center.c.
References coord_3D::i, coord_3D::j, coord_3D::k, and mywhine().
coord_3D get_geometric_center_dp | ( | coord_3D ** | c, |
int | nc | ||
) |
Definition at line 36 of file get_geometric_center.c.
References coord_3D::i, coord_3D::j, coord_3D::k, and mywhine().
double get_magnitude | ( | vectormag_3D | ) |
Definition at line 7 of file get_magnitude.c.
References vectormag_3D::i, vectormag_3D::j, and vectormag_3D::k.
Referenced by get_molecule_point_charge_dipole(), and rotate_vector_to_Z_M().
vectormag_3D get_molecule_point_charge_dipole | ( | molecule * | m, |
int | xs, | ||
int | chgsrc, | ||
atype * | AT | ||
) |
Definition at line 17 of file get_dipole.c.
References residue::a, atom::ch, vectormag_3D::d, get_magnitude(), get_molecule_COM(), coord_3D::i, vectormag_3D::i, coord_3D::j, vectormag_3D::j, coord_3D::k, vectormag_3D::k, mywhine(), residue::na, molecule::nr, molecule::r, atom::x, atom::xa, and zero_vec().
Definition at line 8 of file get_plane.c.
References plane::A, plane::B, plane::C, plane::D, coord_3D::i, coord_3D::j, and coord_3D::k.
plane get_plane_for_ring | ( | int | n, |
coord_3D ** | r | ||
) |
Definition at line 6 of file get_ring_pucker_plane.c.
References plane::A, plane::B, plane::C, vectormag_3D::d, plane::D, get_crossprod(), coord_3D::i, vectormag_3D::i, coord_3D::j, vectormag_3D::j, coord_3D::k, vectormag_3D::k, and PI.
double get_signed_distance_from_point_to_plane | ( | plane | p, |
coord_3D | pt | ||
) |
Definition at line 6 of file get_signed_distance_from_point_to_plane.c.
References plane::A, plane::B, plane::C, plane::D, coord_3D::i, coord_3D::j, and coord_3D::k.
void initialize_coord_3D | ( | coord_3D * | c | ) |
Definition at line 22 of file initialize_GLYstruct.c.
References coord_3D::i, coord_3D::j, and coord_3D::k.
void initialize_plane | ( | plane * | p | ) |
void initialize_vectormag_3D | ( | vectormag_3D * | v | ) |
Definition at line 27 of file initialize_GLYstruct.c.
References vectormag_3D::d, vectormag_3D::i, vectormag_3D::j, and vectormag_3D::k.
void normalize_ensemble_vectors | ( | ensemble * | e, |
int | vs, | ||
int | vd | ||
) |
Definition at line 32 of file normalize_X_vectors.c.
References ensemble::nm, and normalize_molecule_vectors().
void normalize_molecule_vectors | ( | molecule * | m, |
int | vs, | ||
int | vd | ||
) |
Definition at line 11 of file normalize_X_vectors.c.
References residue::a, mywhine(), residue::na, normalize_vec(), molecule::nr, molecule::r, and atom::v.
Referenced by normalize_ensemble_vectors().
Definition at line 7 of file normalize_vec.c.
References vectormag_3D::d, vectormag_3D::i, vectormag_3D::j, and vectormag_3D::k.
Referenced by create_rotation_matrix(), get_angle_between_vectors(), get_angle_two_vectors(), get_cartesian_point_from_internal_coords(), normalize_molecule_vectors(), rotate_vector_to_Z_list(), and rotate_vector_to_Z_M().
void orient_coords2_to_coords1_dp_list | ( | coord_3D ** | coords, |
int | num_coords, | ||
const coord_3D * | bond_atom_a, | ||
coord_3D * | bond_atom_b, | ||
double | distance, | ||
const coord_3D * | angle_atom_a, | ||
double | theta, | ||
coord_3D * | angle_atom_b, | ||
double | rho, | ||
const coord_3D * | dih_atom_a, | ||
coord_3D * | dih_atom_b, | ||
double | tau, | ||
const coord_3D * | tor_atom_a, | ||
const coord_3D * | ref_angle_a, | ||
double | phi, | ||
coord_3D * | tor_atom_b, | ||
coord_3D * | ref_atom_b, | ||
double | omega | ||
) |
Note: change name/parameter names
Definition at line 149 of file geometry.c.
References cross(), find_attachment_point(), get_angle(), get_angle_ABC_points(), get_cartesian_point_from_internal_coords(), get_crossprod(), get_dihedral(), get_dihedral_ABCD_points(), get_vector, get_vector_from_coords, PI, rotate_coords(), rotate_coords_about_axis_dp_list(), subtract(), subtract_coord(), translate_coords(), and translate_coords_dp_list().
void pitchAssembly | ( | assembly * | a, |
double | rad | ||
) |
Definition at line 100 of file rotation.c.
References coord_3D::i, coord_3D::j, and coord_3D::k.
void pitchMolecule | ( | molecule * | m, |
double | rad | ||
) |
Definition at line 27 of file rotation.c.
References coord_3D::i, coord_3D::j, and coord_3D::k.
void rollAssembly | ( | assembly * | a, |
double | rad | ||
) |
Definition at line 73 of file rotation.c.
References coord_3D::i, coord_3D::j, coord_3D::k, and atom::x.
void rollMolecule | ( | molecule * | m, |
double | rad | ||
) |
Definition at line 4 of file rotation.c.
References coord_3D::i, coord_3D::j, coord_3D::k, and atom::x.
void rotate_coords_about_axis_dp_list | ( | coord_3D ** | coords, |
int | num_coords, | ||
coord_3D | point, | ||
vectormag_3D | direction, | ||
double | theta | ||
) |
Rotate a list of coordinates theta degrees about an axis through the given coordinate in the given direction
Definition at line 76 of file rotations.c.
References apply_rotation_matrix_to_coord_p(), create_rotation_matrix(), and destroy_rotation_matrix().
Referenced by orient_coords2_to_coords1_dp_list().
void rotate_vector_to_Z_list | ( | coord_3D * | , |
int | , | ||
vectormag_3D | |||
) |
Functions
Definition at line 47 of file rotate_vector_to_Z.c.
References vectormag_3D::d, get_crossprod(), coord_3D::i, vectormag_3D::i, coord_3D::j, vectormag_3D::j, coord_3D::k, vectormag_3D::k, mywhine(), and normalize_vec().
void rotate_vector_to_Z_M | ( | molecule * | m, |
int | xs, | ||
int | xd, | ||
int | vs, | ||
int | vd, | ||
vectormag_3D | vec | ||
) |
This function rotates the coordinate list such that the vector given by vectormag_3D points along the Z (Y, X, other) axis. The orientation of the orthogonal axes is arbitrary.
Definition at line 94 of file rotate_vector_to_Z.c.
References residue::a, vectormag_3D::d, dprint_coord_3D(), dprint_vectormag_3D(), get_crossprod(), get_magnitude(), coord_3D::i, vectormag_3D::i, coord_3D::j, vectormag_3D::j, coord_3D::k, vectormag_3D::k, mywhine(), residue::na, normalize_vec(), molecule::nr, molecule::r, atom::v, atom::x, and atom::xa.
coord_3D scalarmult_coord | ( | coord_3D | , |
double | |||
) |
Definition at line 29 of file add_coord.c.
References coord_3D::i, coord_3D::j, and coord_3D::k.
Referenced by shift_molecule_atoms_by_vector_scale().
vectormag_3D scalarmult_vec | ( | vectormag_3D | , |
double | |||
) |
Definition at line 5 of file scalarmult_vec.c.
References vectormag_3D::d, vectormag_3D::i, vectormag_3D::j, and vectormag_3D::k.
Referenced by get_dihedral_ABCD_points(), and get_dihedral_bonded_ABCD().
void shift_molecule_atoms_by_vector_scale | ( | molecule * | m, |
int | xs, | ||
int | xd, | ||
int | vr, | ||
double | scale | ||
) |
Definition at line 21 of file vector_atom_movements.c.
References residue::a, add_coord(), mywhine(), residue::na, molecule::nr, molecule::r, scalarmult_coord(), vec_to_coord(), atom::x, and atom::xa.
Definition at line 18 of file add_coord.c.
References coord_3D::i, coord_3D::j, and coord_3D::k.
Referenced by get_alt_rms_mol(), get_alt_rms_res(), get_angle_ABC(), get_angle_ABC_points(), get_dihedral_ABCD_points(), get_dihedral_bonded_ABCD(), orient_coords2_to_coords1_dp_list(), and translate_zero_to_coord_M().
Definition at line 21 of file add_vec.c.
References vectormag_3D::d, vectormag_3D::i, vectormag_3D::j, and vectormag_3D::k.
void translate_coords_dp_list | ( | coord_3D ** | coords, |
int | num_coords, | ||
coord_3D | shift | ||
) |
Translate a list of coordinates
Definition at line 136 of file geometry.c.
References coord_3D::i, coord_3D::j, and coord_3D::k.
Referenced by orient_coords2_to_coords1_dp_list().
void translate_ensemble_by_XYZ | ( | ensemble * | e, |
int | xs, | ||
int | xd, | ||
coord_3D | |||
) |
Definition at line 106 of file translate_by_XYZ.c.
References residue::a, coord_3D::i, coord_3D::j, coord_3D::k, ensemble::m, mywhine(), residue::na, ensemble::nm, molecule::nr, molecule::r, atom::x, and atom::xa.
void translate_molecule_by_XYZ | ( | molecule * | m, |
int | xs, | ||
int | xd, | ||
coord_3D | |||
) |
Definition at line 61 of file translate_by_XYZ.c.
References residue::a, coord_3D::i, coord_3D::j, coord_3D::k, mywhine(), residue::na, molecule::nr, molecule::r, atom::x, and atom::xa.
void translate_residue_by_XYZ | ( | residue * | r, |
int | xs, | ||
int | xd, | ||
coord_3D | |||
) |
Definition at line 21 of file translate_by_XYZ.c.
References residue::a, coord_3D::i, coord_3D::j, coord_3D::k, mywhine(), residue::na, atom::x, and atom::xa.
void translate_zero_to_coord_M | ( | molecule * | m, |
int | xs, | ||
int | xd, | ||
coord_3D | |||
) |
Definition at line 12 of file translate_zero_to_coord.c.
References residue::a, mywhine(), residue::na, molecule::nr, molecule::r, subtract_coord(), atom::x, and atom::xa.
Definition at line 20 of file coord_to_vec.c.
References coord_3D::i, vectormag_3D::i, coord_3D::j, vectormag_3D::j, coord_3D::k, and vectormag_3D::k.
Referenced by shift_molecule_atoms_by_vector_scale().
void yawAssembly | ( | assembly * | a, |
double | rad | ||
) |
Definition at line 127 of file rotation.c.
References coord_3D::i, coord_3D::j, and coord_3D::k.
void yawMolecule | ( | molecule * | m, |
double | rad | ||
) |
Definition at line 50 of file rotation.c.
References coord_3D::i, coord_3D::j, and coord_3D::k.
coord_3D zero_coord | ( | ) |
Definition at line 19 of file zero_vec_crd.c.
References coord_3D::i, coord_3D::j, and coord_3D::k.
Referenced by read_prepres().
vectormag_3D zero_vec | ( | ) |
Definition at line 9 of file zero_vec_crd.c.
References vectormag_3D::d, vectormag_3D::i, vectormag_3D::j, and vectormag_3D::k.
Referenced by get_molecule_point_charge_dipole().