sponge.system.Residue

View Source On Gitee
class sponge.system.Residue(atom_name: Union[List[str], ndarray] = None, atom_type: Union[List[str], ndarray] = None, atom_mass: Union[Tensor, ndarray, List[float]] = None, atom_charge: Union[Tensor, ndarray, List[float]] = None, atomic_number: Union[Tensor, ndarray, List[float]] = None, bonds: Union[Tensor, ndarray, List[int]] = None, settle_index: Union[Tensor, ndarray, List[int]] = None, settle_length: Union[Tensor, ndarray, List[float]] = None, settle_unit: str = None, head_atom: int = None, tail_atom: int = None, start_index: int = 0, name: str = 'MOL', template: Union[dict, str] = None, length_unit: str = None, **kwargs)[source]

Base class for residue. The Residue Cell is the component of the Molecule (System) Cell. A Residue can represent not only an amino acid residue, but also a small molecule in a molecular system, such as a water molecule, an inorganic salt ion, etc. This means that the Residue Cell has a similar concept to the "residue" in a PDB file.

Note

Residue Cell is only used to represent the atomic properties and bond connections, but does NOT contain atomic coordinates.

Parameters
  • atom_name (Union[List[str], ndarray]) – Array of atom name with data type str. Default: None.

  • atom_type (Union[List[str], ndarray]) – Array of atom type with data type str. Default: None.

  • atom_mass (Union[Tensor, ndarray, List[float]]) – Array of atom mass of shape \((B, A)\) with data type float. Default: None.

  • atom_charge (Union[Tensor, ndarray, List[float]]) – Array of atom charge of shape \((B, A)\) with data type float. Default: None.

  • atomic_number (Union[Tensor, ndarray, List[float]]) – Array of atomic number of shape \((B, A)\) with data type int. Default: None.

  • bonds (Union[Tensor, ndarray, List[int]]) – Array of bond connection of shape \((B, b, 2)\) with data type int. Default: None.

  • settle_index (Union[Tensor, ndarray, List[int]]) – Array of atom indices for SETTLE constraint algorithm, The shape of the array is \((B, 3)\) with data type int. The order of index is vertex atoms and two base atoms. Default: None.

  • settle_length (Union[Tensor, ndarray, List[float]]) – Array of length for SETTLE constraint algorithm, The shape of the array is \((B, 2)\) with data type int. The order of length is leg and base. Default: None.

  • settle_unit (str) – Unit value for SETTLE constraint algorithm. Default: None.

  • head_atom (int) – Index of the head atom to connect with the previous residue. Default: None.

  • tail_atom (int) – Index of the tail atom to connect with the next residue. Default: None.

  • start_index (int) – The start index of the first atom in this residue. Default: 0.

  • name (str) – Name of the residue. Default: 'MOL'.

  • template (Union[dict, str]) – Template for residue. It can be a dict in MindSPONGE template format or a str for the filename of a MindSPONGE template file. If a str is given, it will first look for a file with the same name in the current directory. If file does not exist, it will search in the built-in template directory of MindSPONGE (mindsponge.data.template). Default: None.

  • length_unit (str) – Unit of length. Default: None.

  • kwargs (dict) – Other parameters dictionary.

Note

B: Batchsize, i.e. number of walkers in simulation A: Number of atoms. b: Number of bonds.

add_atom(atom_name: str = None, atom_type: str = None, atom_mass: float = None, atom_charge: float = None, atomic_number: str = None)[source]

Add an atom to the residue.

Parameters
  • atom_name (str) – Atom name. Default: None.

  • atom_type (str) – Atom type. Default: None.

  • atom_mass (float) – Atom mass. Default: None.

  • atom_charge (float) – Atom charge. Default: None.

  • atomic_number (str) – Atomic number. Default: None.

broadcast_multiplicity(multi_system: int)[source]

Broadcast the information to the number of multiple system.

Parameters

multi_system (int) – The number of multiple systems.

build_atom_charge(template: dict)[source]

According to the name of the atom, find the index of the atom in the template. Get atom charge of the atom with the index in the template and build it into the residue.

Parameters

template (dict) – Template for residue.

build_atom_mass(template: dict)[source]

According to the name of the atom, find the index of the atom in the template. Get atom mass of the atom with the index in the template and build it into the residue.

Parameters

template (dict) – Template for residue.

build_atom_type(template: dict)[source]

According to the name of the atom, find the index of the atom in the template. Get atom type of the atom with the index in the template and build it into the residue.

Parameters

template (dict) – Template for residue.

build_atomic_number(template: dict)[source]

According to the name of the atom, find the index of the atom in the template. Get atomic number of the atom with the index in the template and build it into the residue.

Parameters

template (dict) – Template for residue.

build_bond(template: dict)[source]

According to the name of the atom, find the index of the atom in the template. Get bond of the atom with the index in the template and build it into the residue.

Parameters

template (dict) – Template for residue.

build_settle(template: dict)[source]

According to the type of the atoms, find the indices and length for of SETTLE algorithm in the template. Get the indices and length in the template and build it into the residue.

Parameters

template (dict) – Template for residue.

property name: str

Get the name of the residue.

Returns

str, the name of the residue.

set_name(name: str)[source]

Set residue name.

Parameters

name (str) – Residue name.

set_start_index(start_index: int)[source]

Set the start index.

Parameters

start_index (int) – The start index.