molecular-design-toolkit icon indicating copy to clipboard operation
molecular-design-toolkit copied to clipboard

Wrong bonding between residues surrounding missing ones

Open avirshup opened this issue 8 years ago • 1 comments

This is a residue that appears right before several missing residues:

mol = mdt.from_pdb('3p3k')
res = mol.residues[46]

MDT currently shows a bond between this and the next available residue, which is clearly wrong:

>>> res.bonded_residues
[<Residue HIS71 (index 47, chain A) in Molecule: 3p3k>,
 <Residue ILE46 (index 45, chain A) in Molecule: 3p3k>]
>>> res.distance(res.next_residue)
3.88332344777 ang

Also res.next_residue returns '<Residue HIS71 (index 47, chain A) in Molecule: 3p3k>', but should raise something along the lines of StopIteration, or maybe MissingResidue or maybe PrematureTerminus

I suppose it could also just return a MissingResidue object or something

avirshup avatar Feb 28 '17 05:02 avirshup

It would appear that a distance-based cutoff for bonds would work well, even when just looking at alpha-carbon distances. image

Obviously C-N bond lengths would work fine too, but it gets tricky when they are missing

avirshup avatar Mar 06 '17 20:03 avirshup