| Bsoft 2.0.5 Bernard's software package

Functions | Variables
mol_edit.cpp File Reference

Library routines used for atomic coordinates. More...

`#include "rwmolecule.h"`
`#include "rwatomprop.h"`
`#include "rwresprop.h"`
`#include "mol_transform.h"`
`#include "mol_edit.h"`
`#include "mol_util.h"`
`#include "seq_util.h"`
`#include "linked_list.h"`
`#include "Matrix3.h"`
`#include "random_numbers.h"`
`#include "utilities.h"`

Go to the source code of this file.

## Functions
long | molgroup_set_atom_types_to_elements (Bmolgroup *molgroup)
| Sets atom types to element names. More...
int | molgroup_remove_hydrogens (Bmolgroup *molgroup)
| Removes all hydrogens from a molecular system. More...
bool | bond_find (Bmolgroup *molgroup, Batom *atom1, Batom *atom2)
int | molgroup_add_disulfides (Bmolgroup *molgroup, double distance)
| Adds disulfide bonds when sulfur atoms are close to each other. More...
Bmolgroup ** | molgroup_split_into_slices (Bmolgroup *molgroup, double slice_thickness, int &nslices)
| Splits a set of coordinates into slices with a given thickness. More...
int | molgroup_insert (Bmolgroup *molgroup, Bmolgroup *molinsert, double distance)
| Inserts one set of molecules into another. More...
int | molgroup_randomize (Bmolgroup *molgroup, double random_max)
| Applies random displacements to coordinates. More...
int | molgroup_remove_overlapping_atoms (Bmolgroup *molgroup, double mindist)
| Removes overlapping atoms. More...
int | molgroup_bond_pseudo_atoms (Bmolgroup *molgroup, int atoms_per_bond, int wrap)
| Places pseudo-atoms on bonds. More...
char * | grid_from_molgroup (Bmolgroup *molgroup, Vector3< double > min, double sampling, Vector3< int > size)
char * | grid_from_molecule (Bmolecule *mol, Vector3< double > min, double sampling, Vector3< int > size)
int | molgroup_prune_molecules (Bmolgroup *molgroup)
| Deletes overlapping molecules. More...
long | molgroup_delete_deselected_molecules (Bmolgroup *molgroup)
| Deletes deselected molecules. More...
long | molgroup_prune_overlapping_atoms (Bmolgroup *molgroup, double mindist)
| Prunes overlapping atoms based on a distance criterion. More...
long | molgroup_delete_deselected_atoms (Bmolgroup *molgroup)
| Deletes deselected atoms. More...
int | molgroup_untangle_molecules (Bmolgroup *molgroup, double sampling, double lambda)
| Moves overlapping molecules away from each other. More...
int | molgroup_untangle_groups (Bmolgroup *molgroup, double sampling, double lambda)
| Moves overlapping molecules away from each other. More...

## Variables
int | verbose

## Detailed Description

Library routines used for atomic coordinates.

Author
  Bernard Heymann

Date
  Created: 19980214
  Modified: 20110811

Definition in file mol_edit.cpp.

## Function Documentation

## ◆ bond_find()

bool bond_find | ( | Bmolgroup * | molgroup,
|  | Batom * | atom1,
|  | Batom * | atom2
| ) |  |

Definition at line 85 of file mol_edit.cpp.

## ◆ grid_from_molecule()

char* grid_from_molecule | ( | Bmolecule * | mol,
|  | Vector3< double > | min,
|  | double | sampling,
|  | Vector3< int > | size
| ) |  |

Definition at line 542 of file mol_edit.cpp.

## ◆ grid_from_molgroup()

char* grid_from_molgroup | ( | Bmolgroup * | molgroup,
|  | Vector3< double > | min,
|  | double | sampling,
|  | Vector3< int > | size
| ) |  |

Definition at line 517 of file mol_edit.cpp.

## ◆ molgroup_add_disulfides()

int molgroup_add_disulfides | ( | Bmolgroup * | molgroup,
|  | double | distance
| ) |  |

Adds disulfide bonds when sulfur atoms are close to each other.

Parameters

  *molgroup | molecule group structure.
  distance | maximum separation between sulfur atoms.

Returns
  int number of disulfide bonds added.

Definition at line 101 of file mol_edit.cpp.

## ◆ molgroup_bond_pseudo_atoms()

int molgroup_bond_pseudo_atoms | ( | Bmolgroup * | molgroup,
|  | int | atoms_per_bond,
|  | int | wrap
| ) |  |

Places pseudo-atoms on bonds.

Parameters

  *molgroup | the molecule group.
  atoms_per_bond | number of pseudo-atoms per bond.
  wrap | wrap around periodic boundaries if !=0.

Returns
  Bbond* new bond list.

      The requested number of new atoms are placed to coincide with each bond.

Definition at line 496 of file mol_edit.cpp.

## ◆ molgroup_delete_deselected_atoms()

long molgroup_delete_deselected_atoms | ( | Bmolgroup * | molgroup | ) |

Deletes deselected atoms.

Parameters

  *molgroup | molecule group structure to be modified.

Returns
  long number of atoms deleted.

Definition at line 684 of file mol_edit.cpp.

## ◆ molgroup_delete_deselected_molecules()

long molgroup_delete_deselected_molecules | ( | Bmolgroup * | molgroup | ) |

Deletes deselected molecules.

Parameters

  *molgroup | molecule group structure to be modified.

Returns
  long number of molecules deleted.

Definition at line 611 of file mol_edit.cpp.

## ◆ molgroup_insert()

int molgroup_insert | ( | Bmolgroup * | molgroup,
|  | Bmolgroup * | molinsert,
|  | double | distance
| ) |  |

Inserts one set of molecules into another.

    Molecules overlapping in the receiving molecule group are deleted.
    The footprint of the molecules being inserted is calculated on a grid
    and all atoms within this footprint is tested for deletion.
    Note: The molecule list is transferred from the insertion group to
        the main group and the insertion group is deallocated.

Parameters

  *molgroup | molecule group structure to be modified.
  *molinsert | molecule group structure to insert. (deallocated)
  distance | cutoff distance to remove atoms.

Returns
  int 0.

Definition at line 244 of file mol_edit.cpp.

## ◆ molgroup_prune_molecules()

int molgroup_prune_molecules | ( | Bmolgroup * | molgroup | ) |

Deletes overlapping molecules.

Parameters

  *molgroup | the molecule group.

Returns
  int 0.

Definition at line 569 of file mol_edit.cpp.

## ◆ molgroup_prune_overlapping_atoms()

long molgroup_prune_overlapping_atoms | ( | Bmolgroup * | molgroup,
|  | double | mindist
| ) |  |

Prunes overlapping atoms based on a distance criterion.

    The first atom in any pair of overlapping atoms is kept.

Parameters

  *molgroup | molecule group structure to be modified.
  mindist | distance criterion.

Returns
  long number of remaining atoms.

Definition at line 652 of file mol_edit.cpp.

## ◆ molgroup_randomize()

int molgroup_randomize | ( | Bmolgroup * | molgroup,
|  | double | random_max
| ) |  |

Applies random displacements to coordinates.

Parameters

  *molgroup | molecule group structure to be modified.
  random_max | maximum displacement.

Returns
  int set of molecule groups.

Definition at line 369 of file mol_edit.cpp.

## ◆ molgroup_remove_hydrogens()

int molgroup_remove_hydrogens | ( | Bmolgroup * | molgroup | ) |

Removes all hydrogens from a molecular system.

Parameters

  *molgroup | molecule group structure.

Returns
  int number of hydrogens removed.

Definition at line 52 of file mol_edit.cpp.

## ◆ molgroup_remove_overlapping_atoms()

int molgroup_remove_overlapping_atoms | ( | Bmolgroup * | molgroup,
|  | double | mindist
| ) |  |

Removes overlapping atoms.

    The input molecule group is checked for any atom pairs closer than
    a minimum allowed distance. The second atom of an overlapping pair
    is removed. This is intended to clean up after symmetry operations
    that generate overlapping pseudo-atoms lying on symmetry axes.

Parameters

  *molgroup | molecule group.
  mindist | minimum distance allowed between atoms.

Returns
  int number of atoms removed, <0 on error.

Definition at line 407 of file mol_edit.cpp.

## ◆ molgroup_set_atom_types_to_elements()

long molgroup_set_atom_types_to_elements | ( | Bmolgroup * | molgroup | ) |

Sets atom types to element names.

Parameters

  *molgroup | molecule group structure.

Returns
  long number of atoms.

Definition at line 29 of file mol_edit.cpp.

## ◆ molgroup_split_into_slices()

Bmolgroup** molgroup_split_into_slices | ( | Bmolgroup * | molgroup,
|  | double | slice_thickness,
|  | int & | nslices
| ) |  |

Splits a set of coordinates into slices with a given thickness.

Parameters

  *molgroup | molecule group structure.
  slice_thickness | slice thickness (in angstrom).
  &nslices | pointer to the number of slices generated

Returns
  Bmolgroup** set of molecule groups.

Definition at line 158 of file mol_edit.cpp.

## ◆ molgroup_untangle_groups()

int molgroup_untangle_groups | ( | Bmolgroup * | molgroup,
|  | double | sampling,
|  | double | lambda
| ) |  |

Moves overlapping molecules away from each other.

    The overlap of molecules are assessed by projecting atom positions
    onto a grid. Overlapping molecules are then moved away from each other
    along a vector through their centers-of-mass.

Parameters

  *molgroup | the molecule group.
  sampling | grid sampling (angstrom).
  lambda | damping factor.

Returns
  int 0.

Definition at line 849 of file mol_edit.cpp.

## ◆ molgroup_untangle_molecules()

int molgroup_untangle_molecules | ( | Bmolgroup * | molgroup,
|  | double | sampling,
|  | double | lambda
| ) |  |

Moves overlapping molecules away from each other.

    The overlap of molecules are assessed by projecting atom positions
    onto a grid. Overlapping molecules are then moved away from each other
    along a vector through their centers-of-mass.

Parameters

  *molgroup | the molecule group.
  sampling | grid sampling (angstrom).
  lambda | damping factor.

Returns
  int 0.

Definition at line 766 of file mol_edit.cpp.

## Variable Documentation

## ◆ verbose

int verbose