ReliaSolve / cctbx_project

Computational Crystallography Toolbox
https://cctbx.github.io
Other
0 stars 0 forks source link

Ensure that the keep_unselected_atoms Phil parameter is working in Probe2 #191

Open russell-taylor opened 2 years ago

russell-taylor commented 2 years ago

-KEEP vs. -DROP on 3wrp when using the RESVAL in Probe only have one dot difference. Using "resname VAL" in Probe2 seems to make no difference. Find a selection with more difference and see what is going on.

russell-taylor commented 2 years ago

The original question being investigated that turned this up was from 3wrp:

@todo: When we run with a "not water" selection for this molecule, we still see some extra dots in this molecule from Probe2 that are not seen in Probe.

We see close contacts in Probe2 between O ALA 9 A and H ALA 12 A and further close contacts with CB ALA 12 A. This may be because O HOH 178 A is considered to be bonded to O ALA 9 even though it is not selected. image

We also see close contacts in Probe2 between O ARG 97 A and H GLU 101 A, HG HLU 101 A, and C GLN 98A. This may be because O HOH 183 A appears to be bonded to O ARG 97 A even though it is not selected. image

We see a more complete set of overlaps between SD MET 66 A and (OE2 GLU 60 A and CD GLU 60 A). This may be because O HOH 181 A appears to be bonded to OE2 and sitting between it and CD, even though it is not selected. image

We see more dots in Probe2 between HD13 LEU 43 A and HD 12 LEU 39 A. This might be due to a water being closer to those dots, even though it is not selected. image

russell-taylor commented 2 years ago

Try selecting only sidechains and see what happens. This is "SC" in Probe; the -KEEP and -DROP have several large regions of difference. It is "sidechain" in Probe2; @todo: the setting for keep_unselected_atoms doesn't make a difference in Probe2.

Note: The results of sidechain selection are very different in Probe and Probe2; one of these may be selecting the Sidechain Hydrogens and the other may not be, but in any case the keep and not-keep should probably differ in Probe2.

russell-taylor commented 2 years ago

(done) We want to find a selection that lets us determine which Probe set (drop or keep) the Probe2 set most closely matches, so we can know which to fix. Trying LEU. Probe2 looks more like -KEEP than like -DROP (though there is a small difference there as well).

For Probe2, making an accessible surface had very different results for the drop and keep cases. This may indicate that the problem has to do with bonded neighbors, which the surface code ignores.

(nope) It looks like when we factored out the bondedNeighborLists code and just use self._allBondedNeighborLists we broke the ability to properly implement -DROP. There were two commits that did this, both made on the same day. Hmm... reverting those commits does not cause the two cases to differ in Probe2. The reversions did not break the tests on 1bti and 1xso, so we'll leave them in place.

mmtbx.probe2 source_selection="resname LEU" approach=self count_dots=False output.file_name=C:/tmp/3wrp_LEU_drop.kin F:/data/Richardsons/3wrp_reduced.pdb record_added_hydrogens=True keep_unselected_atoms=False
mmtbx.probe2  source_selection="resname LEU" approach=self count_dots=False output.file_name=C:/tmp/3wrp_LEU_keep.kin F:/data/Richardsons/3wrp_reduced.pdb record_added_hydrogens=True keep_unselected_atoms=True

(done) The Probe2 result looks like the original DROP result, so there is something about keeping that is not working after these changes. Adding the atoms back into the bonding calculations, for both the main atoms and for the ionic bonds.

This made the keep case differ from the drop case in Probe2, removing many of the extra dots.

russell-taylor commented 2 years ago

(done) There are still some dots in Probe2 keep that are not present in Probe. One set are near a water atom. Others are near Oxygen atoms in other residues.

The -DROP case looks the same between Probe and Probe2.

In the -KEEP case, one set are dots on the edges of H LEU 20 A and HG LEU 20 A that are near O HIS 16 A. In Probe, these are clipped but in Probe2 they are not; the O is not hiding the dots even though it is the closer contact.

(nope) We are only adding Phantom Hydrogens and adjusting the donor/acceptor state of atoms that are in the selected atoms list, so we may not be adjusting the Oxygen properly.

Marking the donor status of all atoms rather than just selected atoms did not fix the problem.

We don't want to add Phantom Hydrogens for unselected atoms (doing so differed from Probe behavior).

(done) In _generate_interaction_dots(), we don't know about the non-target atoms so can't treat them separately. We're going to need to pass both the total list of atoms and the set of selected atoms, treating the touching differently depending on whether it is selected or not. Maybe we can handle this by just passing the set of target atoms in rather than all selected atoms.

Modifying the code to check for collisions with all atoms and discard dots caused by non-target atoms made the Oxygen problems go away.

russell-taylor commented 2 years ago

@todo: There are a few other additional dots in Probe2 that are not present in Probe when using -KEEP. They are on N O and Ca within one Leucine where it is bumping against another Leucine. They are right at the edges of target collision areas.

These could be due to <= vs < in some comparisons. They could be due to slight differences in annular calculations (double vs. float precision?); the comparison swapped from <= to > but so did the meaning of the function return, so they should match.

Putting this issue on the back burner because the major difference has been fixed and we may be looking at arithmetic edge cases.