Ligand Torsion problems

Started by nspc

nspc Lv 1

-Sometimes when I use "Tweak Ligand" , and rotate all the 360 degrees, the torsion still "unrealistic". In this case, sometimes, I just needs to do some wiggles before, and try again the Tweak Tool.

-The "Tweak Ligand" doesn't always turn the side I want, so I have sometimes to rotate the whole ligand after.

-The "undo" doesn't work during "Tweak Mode". When I use the incorrect arrow, or it turn in the bad way, I have to leave the "Tweak Mode" before undo, and re enter in "Tweak Mode".

-During wiggle there is very often unrealistic torsions that appears.
Off course I want to avoid them to have a good ligand.
I have a suggestion for this :
In "medium wiggle power", the system can try to resolve the torsion quality smoothly, like the "ideality" for protein.
Off course this torsion quality repair can scale with "Clashing importance"

That means that with some options, it will be possible to repair all torsions with a wiggle, or keep realistic torsions during it.

spvincent Lv 1

Some thoughts:

1) It can be hard to tell which are the problematic bonds: the fuzzy brown diffuse representation isn't that clear.

2) Agree with the point about the "wrong" part of the ligand rotating: maybe a command-modifier key such as shift would let you select which part of the ligand remains static.

3) Agree about undo: also the torsion penalty should be continuous.

4) I've found my best results have come from loading compounds from the library and wiggling. The best results come from ligands that have a minor torsion penalty: these can be fixed by jiggling things around then wiggling. The script Ligand docker v2.3 works nicely too.

jeff101 Lv 1

Since our ligands have a small number of rotatable bonds, they should also have a
small number of torsions that we can tweak. Why not have LUA commands like below?

ntor=torsion.GetCount()
This reads the # of torsion angles in the ligand and puts the result in the variable ntor.

ang=torsion.GetAngle(num)
This reads torsion angle # num and puts the result in the variable ang.
The output ang will always be a number from 0 to 360 degrees.

torsion.SetAngle(num,ang,sidenum)
This sets torsion angle # num to ang degrees.
If ang is outside 0 to 360 degrees, it automatically shifts it in
increments of 360 degrees so that the result is 0 to 360 degrees.
sidenum is +1 or -1 to tell which part of the ligand rotates (the other
part of the ligand stays fixed). +1 is on one side of the torsion angle,
and -1 is on the other side. +1 could be the side with the higher atom #
adjacent to the torsion angle, and -1 could be the side with the lower atom #
adjacent to the torsion angle. For example, if the torsion angle is defined by
the positions of ligand atoms 4 5 6 & 7, the -1 side contains atom 5, and the
+1 side contains atom 6.

With this minimal set, we could make recipes that vary the torsion angles to improve the Foldit score.
The simplest could just shift the angles at random and keep changes that improve the Foldit score.
More complicated ones could use the Nelder-Mead Simplex Direct Search algorithm, for example,
to more systematically vary the torsion angles to optimize the Foldit score.

For more details, see https://en.wikipedia.org/wiki/Nelder%E2%80%93Mead_method
and https://www.mathworks.com/help/matlab/ref/fminsearch.html (fminsearch is
MATLAB's built-in version of the Nelder-Mead Simplex Direct Search algorithm).

jeff101 Lv 1

More elaborate recipes could be made with some additional commands.

For example,
anums=torsion.GetAtoms(num)
could send to anums the #'s of the 4 atoms that define torsion angle # num.
Atom #'s anums[2] and anums[3] would be adjacent to torsion angle # num,
and the line connecting them gives the axis of rotation for that torsion angle.

astr=structure.GetElement(seg,anum)
could send to astr the symbol from the periodic table for the element
on segment # seg at atom # anum. astr could end as 'C' for carbon,
'N' for nitrogen, 'O' for oxygen, 'H' for hydrogen, 'S' for sulfur,
'Br' for bromine, 'Cl' for chlorine, etc.

It would also be good if we could select ligand atoms by # and have wiggle
selected & mmff move only those atoms.

jeff101 Lv 1

The command
torsion.SetAngle(num,ang,sidenum)
above could accept for sidenum any real # from -1 to +1.
Using +1 or -1 would rotate atoms on one side of the torsion angle
while keeping atoms on the other side of the torsion angle fixed.
Using 0 would rotate atoms on each side of the torsion angle the
same amount but in opposite directions. Using other values for
sidenum would also rotate atoms on each side of the torsion
angle in opposite directions, but one side's atoms would rotate
more than the other side's atoms.

rosie4loop Lv 1

Automatically sampling torsion angles set to be "rotatable" is a common approach in docking programs, represented by the open-source autodock4/autodock vina and variants like smina, that use genetic algorithm or other optimization methods to optimize torsions, atomic positions and orientations.

Not sure if they want something similar in Foldit but it's definitely going to be useful.

Currently, to provide a drug design tutorial with minimal command-line usage and single GUI program, I use PyMOL and double-clicker in-house scripts for ligand design -> sample binding pose with smina(or other codes) -> load results in PyMOL to do something similar. (command line is used for installation on mac and linux, was able to do all double-clickers on windows)

If the whole process can be done within Foldit I may even skip PowerPoint making (for biochem tutorial on what is protein, 20 amino acids etc) and use only a single software. Still need to discuss on drug properties and drug likeliness etc since not a lot of info on these in game, but the terms like cLogP are already in the "objectives" so it's going to be easier.

rosie4loop Lv 1

Actually I think it's possible to implement a similar pipeline to call a open-source docking program to do the sampling and show results and scores in game. This external score could also serve as a reference that currently the Foldit scoring function cannot account for. Or, either allow players to develop new docking algorithm by providing new Lua commands as suggested by others or include more conformational sampling protocols in the game, if its preferrable not to use other software.

When I tested on using FolditStandalone to setup custom drug design puzzles to see if it could replace pymol for my purpose, I was able to use the saved pdb and the previously prepared double-click scripts for docking after some manual editing of FolditStandalone's output. Need some tricks to deal with the custom formatting used by FolditStandalone and the change in atom numbering among different software, but it did work.

I was using smina as docking engine to do that for the "autobox" option and I/O format flexibility via openbabel, but in theory other docking programs may also be used.

It's smoother in PyMOL than FolditStandalone because PyMOL does not generate a customized PDB with ligand topology as FolditStandalone does, but the extraction of coordinates can be automatic with scripting.

I've never tested it in the game version, of course, official puzzles have coordinate file encrypted and it maybe cheating if doing this kind of things out of the game. But I do hope they add this in the real game.