Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libmolgrid with custom typer #240

Open
jacobdurrant opened this issue Dec 12, 2023 · 1 comment
Open

libmolgrid with custom typer #240

jacobdurrant opened this issue Dec 12, 2023 · 1 comment

Comments

@jacobdurrant
Copy link

Issue summary

I'm struggling to figure out how to implement a custom typer using libmolgrid. This page shows how to make the typer, but not how to use it with molgrid.ExampleProvider

Steps to reproduce

Please see this repository that illustrates what I want to do: https://github.com/durrantlab/molgriddebug

Specifically this file: https://github.com/durrantlab/molgriddebug/blob/main/test.ipynb

Then search for "HELP US DAVID KOES!!!"

Your system configuration

Operating system: Ubuntu 20.04.1
Compiler: Not sure
CUDA version (if applicable): 11.4
CUDNN version (if applicable): Not sure
Python version: Python 3.9.16

@dkoes
Copy link
Contributor

dkoes commented Dec 12, 2023

You need to wrap your function with PythonCallbackVectorTyper (or PythonCallbackIndexTyper) and then pass them as positional arguments to ExampleProvider:

t = molgrid.PythonCallbackVectorTyper(mytyper, 2, ["anum","valence"])
example = molgrid.ExampleProvider(t,
    default_batch_size=1
)

You can pass multiple typers (e.g., you might have separate receptor and ligand typers) and these will be mapped to your input structures (e.g., each example might specify two structure files where the first is always the receptor and the second the ligand).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants