Topology
Chemfiles.Topology
— TypeA Topology
describes the organisation of the particles in the system: what their names are, how they are bonded together, etc. A Topology
is a list of Atom
s in the system, together with the list of bonds between the atoms.
Chemfiles.BondOrder
— TypePossible bond orders in Chemfiles:
Chemfiles.UnknownBond
: when the bond order is not specifiedChemfiles.SingleBond
: for single bondsChemfiles.DoubleBond
: for double bondsChemfiles.TripleBond
: for triple bondsChemfiles.QuadrupleBond
: for quadruple bonds (present in some metals)Chemfiles.QuintupletBond
: for qintuplet bonds (present in some metals)Chemfiles.AmideBond
: for amide bondsChemfiles.AromaticBond
: for aromatic bonds
Chemfiles.Topology
— MethodTopology(frame::Frame) -> Topology
Get a copy of the Topology
of the given frame
.
Chemfiles.Topology
— MethodTopology() -> Topology
Create an empty Topology
.
Base.deepcopy
— Methoddeepcopy(topology::Topology) -> Topology
Make a deep copy of a topology
.
Base.getindex
— Methodgetindex(
topology::Topology,
index::Integer
) -> Chemfiles.Atom
Get the Atom
at the given index
of the topology
. By default this creates a copy so as to be safe. To not create a copy, use @view topology[index]
.
Base.resize!
— Methodresize!(topology::Topology, size::Integer)
Resize the topology
to hold natoms
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.
Base.size
— Methodsize(topology::Topology) -> Int64
Get the Topology
size, i.e. the current number of atoms.
Base.view
— Methodview(topology::Topology, index::Integer) -> Chemfiles.Atom
Get the Atom
at the given index
of the topology
without creating a copy.
This function can lead to unefined behavior when keeping the returned Atom
around. See Base.view(frame::Frame, index::Integer)
for more information on this issue.
Chemfiles.add_atom!
— Methodadd_atom!(topology::Topology, atom::Chemfiles.Atom)
Add an atom
at the end of a topology
.
Chemfiles.add_bond!
— Functionadd_bond!(topology::Topology, i::Integer, j::Integer)
add_bond!(topology::Topology, i::Integer, j::Integer, order)
Add a bond between the atoms i
and j
in the topology
, optionaly setting the bond order
.
Chemfiles.add_residue!
— Methodadd_residue!(topology::Topology, residue::Residue)
Add a copy of residue
to this topology
.
The residue id must not already be in the topology, and the residue must contain only atoms that are not already in another residue.
Chemfiles.angles
— Methodangles(topology::Topology) -> Matrix{UInt64}
Get the angles in the topology
, in a 3 x angles_count(topology)
array.
Chemfiles.angles_count
— Methodangles_count(topology::Topology) -> Int64
Get the number of angles in the topology
.
Chemfiles.are_linked
— Methodare_linked(
topology::Topology,
first::Residue,
second::Residue
) -> Bool
Check if the two residues first
and second
from the 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.
Chemfiles.bond_order
— Methodbond_order(
topology::Topology,
i::Integer,
j::Integer
) -> Chemfiles.BondOrder
Get the BondOrder
for the bond between atoms i
and j
in the topology
.
Chemfiles.bond_orders
— Methodbond_orders(
topology::Topology
) -> Vector{Chemfiles.BondOrder}
Get the BondOrder
for all the bonds in the topology
.
Chemfiles.bonds
— Methodbonds(topology::Topology) -> Matrix{UInt64}
Get the bonds in the topology
, in a 2 x bonds_count(topology)
array.
Chemfiles.bonds_count
— Methodbonds_count(topology::Topology) -> Int64
Get the number of bonds in the topology
.
Chemfiles.clear_bonds!
— Methodclear_bonds!(topology::Topology)
Remove all bonds, angles and dihedral angles from this Topology
.
Chemfiles.count_residues
— Methodcount_residues(topology::Topology) -> Int64
Get the number of residues in the topology
.
Chemfiles.dihedrals
— Methoddihedrals(topology::Topology) -> Matrix{UInt64}
Get the dihedral angles in the topology
, in a 4 x dihedrals_count(topology)
array.
Chemfiles.dihedrals_count
— Methoddihedrals_count(topology::Topology) -> Int64
Get the number of dihedral angles in the topology
.
Chemfiles.impropers
— Methodimpropers(topology::Topology) -> Matrix{UInt64}
Get the improper angles in the topology
, in a 4 x impropers_count(topology)
array.
Chemfiles.impropers_count
— Methodimpropers_count(topology::Topology) -> Int64
Get the number of improper angles in the topology
.
Chemfiles.remove_atom!
— Methodremove_atom!(topology::Topology, index::Integer)
Remove the atom at the given index
from a topology
.
Chemfiles.remove_bond!
— Methodremove_bond!(topology::Topology, i::Integer, j::Integer)
Remove any existing bond between the atoms i
and j
in the topology
.