Package: signaturizer3D
signaturizer3DInfer the bioactivity of molecules using models trained on molecular 3D structures🚧 Under Development 🚧Bioactivity signaturizersThis package builds on the originalsignaturizerspackage (paper) by applying a state of the art 3D transformer model for molecular representation (Uni-Mol) to the task of infering bioactivity. One of the novel capabilities ofsignaturizer3Dis the
ability to infer different bioactivities for stereoisomers of a molecule.Bioactivity signatures are multi-dimensional vectors that capture biological
traits of a molecule (fex its target profile) in a numerical vector
format that is akin to the structural descriptors or fingerprints used in the
field of chemoinformatics.Thesignaturizer3Dmodels infer bioactivity in 25 bioactivity types (including
target profiles, cellular response and clinical outcomes) and can be used as
drop-in replacements for chemical descriptors in day-to-day chemoinformatics
tasks.For an overview of the different bioctivity types available see the original Chemical
Checkerpaperorwebsite.Get startedInstallCreate a virtual environment with Python 3.9 or higher.condacreate-nsign3D-envpython=3.10
condaactivatesign3D-envInstall the package with pippython-mpipinstallsignaturizer3dInstall pytorch. Pytorch needs to be installed separately. Find the correct install
command for your compute platform (CPU, GPU, ...) and install tool (pip, conda)on this page.
Fex, if you want to install with Conda for the CPU only you would run.condainstallpytorchtorchvisiontorchaudiocpuonly-cpytorchIf you're using singularity containers there is an example image definition filesingularity.defthat shows how you can install
the package with cuda and pytorch.Infer signatures for moleculesInstantiate a signaturizer for one of the 25 bioactivity spaces in the chemical checker:fromsignaturizer3dimportSignaturizer,CCSpaceCCSpace.print_spaces()# Prints a description of the 25 available spacessignaturizer=Signaturizer(CCSpace.B4)The first time you load a space it will download and cache the model weights
locally.Infer signaturers from a list of SMILES.smiles_list=['C','CCC',"CN(C)CCOC(C1=CC=CC=C1)C1=CC=CC=C1"]signatures=signaturizer.infer_from_smiles(smiles_list)print(signatures.shape)# -> (3, 128) a 128D vector per moleculeInfer signatures from an SDF file or a directory of SDF files by specifying a path.signatures=signaturizer.infer_from_sdf("/path/to/file.sdf")(Download thenicotine sdf fileif you want an sdf file to test with)See thisnotebookfor more detailed examples of signaturizer usage.For a more comprehensive example of using infered bioactivity signatures for analysing similarity between a set of compounds
have a look at theexample notebookin the original signaturizers package.DevelopmentGuidelines on how to set up the development environment and run tests.Install dependencies locally with PoetryDependencies are managed viapoetry. Poetry is a tool that does depencency management and packaging in Python, it allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
Poetry is also a handy tool for making virtual environment with the project dependencies.
First, follow the documentation on how to install poetryhere.
Then using poetry, install the system dependencies with poetry by running this inside the project directory:poetryinstallThis will create a virtual environment with the project dependencies. The virtual environment can be activated in your current shell by runningpoetry shell, or you can run any command inside the virtual environment by prefixing it withpoetry runfex you'd run the tests inside the
virtual environment withpoetry run pytest.Pytorch is the only dependency not managed by poetry. This means it needs to be installed manually in the virtual environment.
Find the correct install command for your compute platform (CPU, GPU, ...)on this page.
Run the install command inside the poetry environment by prefixing it withpoetry runlike this:# Replace the install command if you're installing for a GPUpoetryrunpipinstalltorchtorchvisiontorchaudio--index-urlhttps://download.pytorch.org/whl/cpuThe project has been tested with Pytorch 2.1Run testsRun all tests.poetryrunpytestBy default tests marked withperformanceare excluded. These tests test runtime of different
components. This will be very system dependent, therefore they are excluded by default.
If you want to use these tests to monitor changes in performance as you change the code you
should run the tests on your system before making any changes and update the time threshold to
that before making any changes.
Run theperformancetests with:poetryrunpytest-m'performance'DocumentationFor more information about the package and unimol check out thedocs