| Bsoft 2.0.5 Bernard's software package

Classes | Functions
mol_util.h File Reference

Library routines used for atomic coordinates. More...

`#include "Vector3.h"`
`#include "rwmolecule.h"`

Go to the source code of this file.

## Classes
struct | Latom

## Functions
int | molgroup_Bfactors (Bmolgroup *molgroup)
| Calculates the average Bfactors for residues in molecules. More...
int | molgroup_print_sequence (Bmolgroup *molgroup)
| Prints the sequence of a molecule as a single letter code string. More...
int | molgroup_set_radius (Bmolgroup *molgroup, double radius)
| Shifts all coordinates to a given radius. More...
int | molgroup_rename (Bmolgroup *molgroup, char first_name)
| Renames molecules. More...
int | molgroup_residue_renumber (Bmolgroup *molgroup, int first)
| Renumbers residues. More...
int | molgroup_atom_renumber (Bmolgroup *molgroup, int first)
| Renumbers all atoms, disregarding molecule distinction. More...
int | molgroup_coor_reset_occupancy (Bmolgroup *molgroup, int range_first, int range_last, double occupancy)
| Sets occupancies to new values.. More...
double | molgroup_calculate_weight (Bmolgroup *molgroup)
| Calculates the weight of each molecule. More...
Vector3< double > | molgroup_center_of_mass (Bmolgroup *molgroup)
| Calculates the center of mass of a molecule group. More...
Vector3< double > | molgroup_selected_center_of_mass (Bmolgroup *molgroup)
| Calculates the center of mass of a molecule group. More...
Vector3< double > | molgroup_show_center_of_mass (Bmolgroup *molgroup)
| Calculates the center of mass of a molecule group. More...
Vector3< double > | mol_center_of_mass (Bmolecule *mol)
| Calculates the center of mass of a molecule. More...
Vector3< double > | mol_show_center_of_mass (Bmolecule *mol)
| Calculates the center of mass of a molecule. More...
Vector3< double > | molgroup_principal_axes (Bmolgroup *molgroup, Vector3< double > *eigenvec)
| Calculates the principal axes of a molecule group. More...
Vector3< double > | mol_principal_axes (Bmolecule *mol, Vector3< double > *eigenvec)
| Calculates the principal axes of a molecule. More...
double | molgroup_density (Bmolgroup *molgroup)
| Calculates the number and mass density of a molecular system. More...
double | molgroup_volume (Bmolgroup *molgroup, Bstring &paramfile, int wrap)
| Calculates the volume of a molecular system. More...
int | molgroup_composition (Bmolgroup *molgroup, Bstring &paramfile)
| Calculates the elemental composition of a molecular system. More...
int | molgroup_radial_density (Bmolgroup *molgroup, double interval, double cutoff, int wrap)
| Calculates a radial distribution function. More...
Latom ** | molgroup_atom_mesh_lists (Bmolgroup *molgroup, Vector3< int > size, Vector3< double > sampling)
| Generates lists of atoms based on a grid. More...
Batom ** | atom_get_array (Bmolgroup *molgroup, long *natom)
| Generates an array of pointers to atom structures. More...

## Detailed Description

Library routines used for atomic coordinates.

Author
  Bernard Heymann

Date
  Created: 19980214
  Modified: 20170118

Definition in file mol_util.h.

## Function Documentation

## ◆ atom_get_array()

Batom** atom_get_array | ( | Bmolgroup * | molgroup,
|  | long * | natom
| ) |  |

Generates an array of pointers to atom structures.

Parameters

  *molgroup | molecule group structure to be modified.
  *natom | pointer to number of atoms found.

Returns
  Batom** array of pointers to atoms.

Definition at line 931 of file mol_util.cpp.

## ◆ mol_center_of_mass()

Vector3<double> mol_center_of_mass | ( | Bmolecule * | mol | ) |

Calculates the center of mass of a molecule.

Parameters

  *mol | molecule structure.

Returns
  Vector3<double> 3-valued center of mass vector.

Definition at line 401 of file mol_util.cpp.

## ◆ mol_principal_axes()

Vector3<double> mol_principal_axes | ( | Bmolecule * | mol,
|  | Vector3< double > * | eigenvec
| ) |  |

Calculates the principal axes of a molecule.

Parameters

  *mol | molecule structure.
  *eigenvec | eigen vectors (can be NULL).

Returns
  Vector3<double> 3-valued vector of principal axes.

Definition at line 500 of file mol_util.cpp.

## ◆ mol_show_center_of_mass()

Vector3<double> mol_show_center_of_mass | ( | Bmolecule * | mol | ) |

Calculates the center of mass of a molecule.

Parameters

  *mol | molecule structure.

Returns
  Vector3<double> 3-valued center of mass vector.

Definition at line 439 of file mol_util.cpp.

## ◆ molgroup_atom_mesh_lists()

Latom** molgroup_atom_mesh_lists | ( | Bmolgroup * | molgroup,
|  | Vector3< int > | size,
|  | Vector3< double > | sampling
| ) |  |

Generates lists of atoms based on a grid.

    The coordinates must be positive to fit into a grid starting at {0,0,0}.

Parameters

  *molgroup | molecule group structure to be modified.
  size | size of grid.
  sampling | spacing in each dimension.

Returns
  Latom** array of linked lists of atoms.

Definition at line 882 of file mol_util.cpp.

## ◆ molgroup_atom_renumber()

int molgroup_atom_renumber | ( | Bmolgroup * | molgroup,
|  | int | first
| ) |  |

Renumbers all atoms, disregarding molecule distinction.

Parameters

  *molgroup | molecule group structure.
  first | number of first atom.

Returns
  int 0.

Definition at line 211 of file mol_util.cpp.

## ◆ molgroup_Bfactors()

int molgroup_Bfactors | ( | Bmolgroup * | molgroup | ) |

Calculates the average Bfactors for residues in molecules.

Parameters

  *molgroup | molecule group structure.

Returns
  int 0.

Definition at line 28 of file mol_util.cpp.

## ◆ molgroup_calculate_weight()

double molgroup_calculate_weight | ( | Bmolgroup * | molgroup | ) |

Calculates the weight of each molecule.

Parameters

  *molgroup | molecule group structure.

Returns
  double total mass of the molecule group.

Definition at line 270 of file mol_util.cpp.

## ◆ molgroup_center_of_mass()

Vector3<double> molgroup_center_of_mass | ( | Bmolgroup * | molgroup | ) |

Calculates the center of mass of a molecule group.

Parameters

  *molgroup | molecule group structure.

Returns
  Vector3<double> 3-valued center of mass vector.

Definition at line 307 of file mol_util.cpp.

## ◆ molgroup_composition()

int molgroup_composition | ( | Bmolgroup * | molgroup,
|  | Bstring & | paramfile
| ) |  |

Calculates the elemental composition of a molecular system.

Parameters

  *molgroup | molecule group structure.
  &paramfile | atomic parameter file.

Returns
  int 0.

Definition at line 699 of file mol_util.cpp.

## ◆ molgroup_coor_reset_occupancy()

int molgroup_coor_reset_occupancy | ( | Bmolgroup * | molgroup,
|  | int | range_first,
|  | int | range_last,
|  | double | occupancy
| ) |  |

Sets occupancies to new values..

Parameters

  *molgroup | molecule group structure.
  range_first | first residue in range to change.
  range_last | last residue in range to change.
  occupancy | value to set occupancy to.

Returns
  int 0.

Definition at line 243 of file mol_util.cpp.

## ◆ molgroup_density()

double molgroup_density | ( | Bmolgroup * | molgroup | ) |

Calculates the number and mass density of a molecular system.

    Requirement: The box size must be correctly specified in the
    molecular group structure.
    The number of molecules, residues and atoms are calculated and the
    density for each number reported.
    The total mass is calculated and the mass density reported as
    Da/A^3 and g/ml.

Parameters

  *molgroup | molecule group structure.

Returns
  double density: Da/A^3.

Definition at line 548 of file mol_util.cpp.

## ◆ molgroup_principal_axes()

Vector3<double> molgroup_principal_axes | ( | Bmolgroup * | molgroup,
|  | Vector3< double > * | eigenvec
| ) |  |

Calculates the principal axes of a molecule group.

Parameters

  *molgroup | molecule group structure.
  *eigenvec | eigen vectors (can be NULL).

Returns
  Vector3<double> 3-valued vector of principal axes.

Definition at line 455 of file mol_util.cpp.

## ◆ molgroup_print_sequence()

int molgroup_print_sequence | ( | Bmolgroup * | molgroup | ) |

Prints the sequence of a molecule as a single letter code string.

Parameters

  *molgroup | molecule group structure.

Returns
  int 0.

Definition at line 92 of file mol_util.cpp.

## ◆ molgroup_radial_density()

int molgroup_radial_density | ( | Bmolgroup * | molgroup,
|  | double | interval,
|  | double | cutoff,
|  | int | wrap
| ) |  |

Calculates a radial distribution function.

Parameters

  *molgroup | molecule group.
  interval | interval between bins.
  cutoff | distance cutoff.
  wrap | flag to use periodic boundaries.

Returns
  int 0.

      The atoms are not distinguished by type or properties.

Definition at line 780 of file mol_util.cpp.

## ◆ molgroup_rename()

int molgroup_rename | ( | Bmolgroup * | molgroup,
|  | char | first_name
| ) |  |

Renames molecules.

Parameters

  *molgroup | molecule group structure.
  first_name | letter of first molecule.

Returns
  int 0.

      Letters are assigned to the molecules in sequence starting from the
      given first letter. If it extends beyond 'Z', it restarts at 'A'.

Definition at line 161 of file mol_util.cpp.

## ◆ molgroup_residue_renumber()

int molgroup_residue_renumber | ( | Bmolgroup * | molgroup,
|  | int | first
| ) |  |

Renumbers residues.

Parameters

  *molgroup | molecule group structure.
  first | number of first residue.

Returns
  int 0.

Definition at line 182 of file mol_util.cpp.

## ◆ molgroup_selected_center_of_mass()

Vector3<double> molgroup_selected_center_of_mass | ( | Bmolgroup * | molgroup | ) |

Calculates the center of mass of a molecule group.

Parameters

  *molgroup | molecule group structure.

Returns
  Vector3<double> 3-valued center of mass vector.

Definition at line 347 of file mol_util.cpp.

## ◆ molgroup_set_radius()

int molgroup_set_radius | ( | Bmolgroup * | molgroup,
|  | double | radius
| ) |  |

Shifts all coordinates to a given radius.

Parameters

  *molgroup | molecule group structure.
  radius | spherical radius.

Returns
  int 0.

Definition at line 114 of file mol_util.cpp.

## ◆ molgroup_show_center_of_mass()

Vector3<double> molgroup_show_center_of_mass | ( | Bmolgroup * | molgroup | ) |

Calculates the center of mass of a molecule group.

Parameters

  *molgroup | molecule group structure.

Returns
  Vector3<double> 3-valued center of mass vector.

Definition at line 387 of file mol_util.cpp.

## ◆ molgroup_volume()

double molgroup_volume | ( | Bmolgroup * | molgroup,
|  | Bstring & | paramfile,
|  | int | wrap
| ) |  |

Calculates the volume of a molecular system.

    The volume occupied by all the atoms is estimated from the footprint
    under the Van der Waals volume of each atom.

Parameters

  *molgroup | molecule group structure.
  &paramfile | atomic parameter file.
  wrap | flag to turn on wrapping.

Returns
  double volume in angstrom^3.

Definition at line 586 of file mol_util.cpp.