Scoring ligands

29 views
Skip to first unread message

Tim Dudgeon

unread,
Sep 24, 2020, 10:37:03 AM9/24/20
to Open Drug Discovery Toolkit Community
I'm wanting to use the scoring functions (nnscore etc.) and have that working using the virtualscreening module, but this does not seem to provide the flexibility I need.

I already have a supplier of ligands (molecules) and are performing operations on them.
For each one I wan to generate the score. In some cases all ligands are scored against the same protein, in other cases each ligand has its own protein.

It seems like I should be able to do this with the oddt.scoring.functions.nnscore class but my simple attempt doesn't work.

def calc_nnscore(protein, ligand):
    nns = functions.nnscore(protein=protein)
    nns.predict_ligand(ligand) 

Is there an example of doing this somewhere?

Thanks
Tim

Maciek Wójcikowski

unread,
Sep 24, 2020, 3:05:24 PM9/24/20
to Tim Dudgeon, Open Drug Discovery Toolkit Community
Hi Tim,

This might not be well documented but you are supposed to use the `load` method to load trained picke or train it, if it's missing. https://oddt.readthedocs.io/en/latest/rst/oddt.scoring.functions.html#oddt.scoring.functions.NNScore.nnscore.load

Very basic VS pipeline is available in one of the examples from ODDT paper: https://github.com/oddt/jcheminf/blob/master/Snippet_1.ipynb
The model NNSCORE might also be used in `virtualscreening.score(...)` method directly, or you can just us the name `nnscore`, or a path to a pickle file implementing scorer instance. Only by using name the scoring function will be trained on demand. Using the VS pipeline is probably the easiest.

Note that this will take a while (~1h) for the initial training of a model of NNscore. Afterwards you can use the pretrained pickle. Unpickling might still be intensive so I'd suggest storing it as a global variable. RFScores take a lot less time to train so you can experiment with them first, as the API is identical (RFScore has more arguments in load method, but you can skip them).

So I'd suggest you modify the code as follows:
NNSCORE = functions.nnscore().load('path_to_picke/nnscore.pkl')
def calc_nnscore(protein, ligand):
    NNSCORE.set_protein(protein)  # this can be set once for a series of ligands if you have one target
    NNSCORE.predict_ligand(ligand) 

Note that the score is appended to Molecules' properties in `mol.data`.

----
Pozdrawiam,  |  Best regards,
Maciek Wójcikowski
mac...@wojcikowski.pl


--
You received this message because you are subscribed to the Google Groups "Open Drug Discovery Toolkit Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oddt+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oddt/06295771-6a62-4007-83aa-2c45ec6f53b3n%40googlegroups.com.

Tim Dudgeon

unread,
Sep 25, 2020, 4:34:00 AM9/25/20
to Maciek Wójcikowski, Open Drug Discovery Toolkit Community
Thanks. That did the trick!
Tim

Tim Dudgeon

unread,
Sep 25, 2020, 6:03:09 AM9/25/20
to Maciek Wójcikowski, Open Drug Discovery Toolkit Community
Is PLECScore supported by the virtual screening module?
I try to run it in the same way as NNScore or RFScore:
    pipeline.score(function='plecscore', protein=protein)
 I get this error:

ValueError: The version "score" is not supported by PLECscore

On Thu, 24 Sep 2020 at 20:05, Maciek Wójcikowski <mac...@wojcikowski.pl> wrote:

Maciek Wójcikowski

unread,
Sep 25, 2020, 6:18:40 AM9/25/20
to Tim Dudgeon, Open Drug Discovery Toolkit Community
PLEC Score alias is "plec" plus its variant, so pleclinear, plecrf and plecnn. 

All of the choices are listed by oddt_cli - - help 
Reply all
Reply to author
Forward
0 new messages