Open douweschulte opened 2 years ago
If a bonds
method on an atom takes a PDB
by reference it has to go through all bonds listed in the PDB
and for the ones matching the current atom find the atom reference using binary_find_atom
. This would leave a n * a log a
runtime (n
= number of bonds matching the atom, a
= total number of atoms) which should be reasonable for the current goals.
Bonds are currently partly supported, only disulfide bonds are read from PDBs. The main issue is in the implementation design. Currently the bonds are saved as a list of bond type and the serial numbers of the atoms involved on the PDB struct. This removes any possibility to trace the bound state from an individual atom. The implementation is open for discussion.
Best case from a user perspective
Atom::bonds() -> impl Iterator<Item=(Bond, &Atom)>
Implementation idea: the
bonds
function on atoms could use a reference to thePDB
to get the reference to the other atoms.