Topology class

class chemfiles.BondOrder(value)

Possible bond orders are:

  • BondOrder.Unknown: the bond order is not specified

  • BondOrder.Single: bond order for single bond

  • BondOrder.Double: bond order for double bond

  • BondOrder.Triple: bond order for triple bond

  • BondOrder.Quadruple: bond order for quadruple bond (present in some metals)

  • BondOrder.Qintuplet: bond order for qintuplet bond (present in some metals)

  • BondOrder.Amide: bond order for amide bond

  • BondOrder.Aromatic: bond order for aromatic bond

class chemfiles.Topology

A Topology contains the definition of all the atoms in the system, and the liaisons between the atoms (bonds, angles, dihedrals, …). It will also contain all the residues information if it is available.

Create a new empty Topology.

add_bond(i, j, order=None)

Add a bond between the atoms at indexes i and j in this Topology, optionally setting the bond order.

property angles

Get the list of angles in this Topology.

angles_count()

Get the number of angles in this Topology.

property bonds

Get the list of bonds in this Topology.

bonds_count()

Get the number of bonds in this Topology.

bonds_order(i, j)

Get the bonds order corresponding to the bond between atoms i and j

property bonds_orders

Get the list of bonds order for each bond in this Topology.

property dihedrals

Get the list of dihedral angles in this Topology.

dihedrals_count()

Get the number of dihedral angles in this Topology.

property impropers

Get the list of improper angles in this Topology.

impropers_count()

Get the number of improper angles in this Topology.

remove_bond(i, j)

Remove any existing bond between the atoms at indexes i and j in this Topology.

This function does nothing if there is no bond between i and j.

residue_for_atom(index)

Get read-only access to the Residue containing the atom at the given index from this Topology; or None if the atom is not part of a residue.

residues_linked(first, second)

Check if the two Residue first and second from this Topology are linked together, i.e. if there is a bond between one atom in the first residue and one atom in the second one.

resize(count)

Resize this Topology to contain count atoms. If the new number of atoms is bigger than the current number, new atoms will be created with an empty name and type. If it is lower than the current number of atoms, the last atoms will be removed, together with the associated bonds, angles and dihedrals.