luna.mol.atom module

class AtomData(atomic_num, coord, bond_type, serial_number=None)[source]

Bases: object

Store atomic data (atomic number, coordinates, bond type, and serial number).

Parameters
  • atomic_num (int) – Atomic number.

  • coord (array_like of float (size 3)) – Atomic coordinates (x, y, z).

  • bond_type (int) – Bond type.

  • serial_number (int, optional) – Atom serial number.

Variables
  • ~AtomData.atomic_num (int) – The atomic number.

  • ~AtomData.bond_type (int) – The bond type.

  • ~AtomData.serial_number (int or None) – The atom serial number.

property coord

The atomic coordinates (x, y, z).

Type

array_like of float (size 3)

property x

The orthogonal coordinates for x in Angstroms.

Type

float

property y

The orthogonal coordinates for y in Angstroms.

Type

float

property z

The orthogonal coordinates for z in Angstroms.

Type

float

class ExtendedAtom(atom, nb_info=None, atm_grps=None, invariants=None)[source]

Bases: object

Extend Atom with additional properties and methods.

Parameters
  • atom (Atom) – An atom.

  • nb_info (iterable of AtomData, optional) – A sequence of AtomData containing information about atoms covalently bound to atom.

  • atm_grps (iterable of AtomGroup, optional) – A sequence of atom groups that contain atom.

  • invariants (list or tuple, optional) – Atomic invariants.

add_atm_grps(atm_grps)[source]

Add AtomGroup objects to atm_grps.

add_nb_info(nb_info)[source]

Add AtomData objects to neighbors_info.

as_json()[source]

Represent the atom as a dict containing the structure id, model id, chain id, residue name, residue id, and atom name.

The dict is defined as follows:

  • pdb_id (str): structure id;

  • model (str): model id;

  • chain (str): chain id;

  • res_name (str): residue name;

  • res_id (tuple): residue id (hetflag, sequence identifier, insertion code);

  • name (tuple): atom name (atom name, alternate location).

property atm_grps

The list of atom groups that contain atom.

To add or remove atom groups from atm_grps use add_atm_grps() or remove_atm_grps(), respectively.

Type

list of AtomGroup, read-only

property atom

Atom, read-only.

property electronegativity

The Pauling electronegativity for this atom. This information is obtained from Open Babel.

Type

float, read-only

property full_atom_name

The full name of an atom is composed by the structure id, model id, chain id, residue name, residue id, atom name, and alternate location if available. Fields are slash-separated.

Type

str, read-only

property full_id

The full id of an atom is the tuple (structure id, model id, chain id, residue id, atom name, alternate location).

Type

tuple, read-only

get_neighbor_info(atom)[source]

Get information from a covalently bound atom.

property invariants

The list of atomic invariants.

Type

list

is_neighbor(atom)[source]

Check if a given atom is covalently bound to it.

property neighbors_info

The list of AtomData containing information about atoms covalently bound to atom.

To add or remove neighbors information from neighbors_info use add_nb_info() or remove_nb_info(), respectively.

Type

list of AtomData, read-only

remove_atm_grps(atm_grps)[source]

Remove AtomGroup objects from atm_grps.

remove_nb_info(nb_info)[source]

Remove AtomData objects from neighbors_info.