Skip to main content

Molecule attention transformer for predicting aqueous solubility (log S)

Project description

SolTranNet

The official implementation of SolTranNet.

SolTranNet is an optimized fork of the Molecule Attention Transformer, whose original paper can be found here.

Requirements

  • Python 3.6+
  • PyTorch 1.7+
  • RDKit 2017.09.1+
  • pathlib 1.0+

Soft Requirements

  • CUDA 10.1, 10.2, or 11.1

We heavily suggest installing CUDA and compiling PyTorch with it enabled to have faster models.

You can see installation instructions for CUDA here.

You can see installation instructions for PyTorch here.

Installation

Tested on Ubuntu 18.04.5, Ubuntu 20.04.2, Debian 10, Fedora 33, CentOS 8.3.2011, Windows 10, and Ubuntu 20.04.2 subsystem for Windows 10

First, install RDKit. Installation instructions are available here

After RDKit has finished installing, you can install SolTranNet via pip:

python3 -m pip install soltrannet

NOTE: This installation method often mismatches installation of PyTorch for enabling CUDA if it needs to install PyTorch as a dependency.

If you wish to do a more careful installation:

python3 -m pip install --install-option test soltrannet

This will run our unit tests to ensure that GPU-enabled torch was setup correctly, and the proper functioning of SolTranNet as a command line tool and within a python environment.

Usage

Command line tool

Upon successful pip installation, a command line tool will be installed.

To generate the predictions for SMILES provided in my_smiles.txt and store them into my_output.txt:

soltrannet my_smiles.txt my_output.txt

You can see all of the options available for the command line tool:

usage: soltrannet [-h] [--batchsize BATCHSIZE] [--cpus CPUS] [--cpu_predict] [input] [output]

Run SolTranNet aqueous solubility predictor

positional arguments:
  input                 PATH to the file containing the SMILES you wish to
                        use. Assumes the content is 1 SMILE per line.

  output                Name of the output file. Defaults to stdout.

optional arguments:
  -h, --help            show this help message and exit
  --batchsize BATCHSIZE
                        Batch size for the data loader. Defaults to 32.

  --cpus CPUS           Number of CPU cores to use for the data loader.
                        Defaults to use all available cores. Pass 0 to only
                        run on 1 CPU.

  --cpu_predict         Flag to force the predictions to be made on only the
                        CPU. Default behavior is to use GPU if available.

In a Python environment

Soltrannet also supports integration in a python3 environment

import soltrannet as stn
my_smiles=["c1ccccc1","c1ccccc1 .ignore","Cn1cnc2n(C)c(=O)n(C)c(=O)c12","[Zn+2]","[Na+].[Cl-]"]
predictions=list(stn.predict(my_smiles))

Help

Please subscribe to our slack team.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

soltrannet-1.0.0.tar.gz (41.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

soltrannet-1.0.0-py3-none-any.whl (41.8 kB view details)

Uploaded Python 3

File details

Details for the file soltrannet-1.0.0.tar.gz.

File metadata

  • Download URL: soltrannet-1.0.0.tar.gz
  • Upload date:
  • Size: 41.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9

File hashes

Hashes for soltrannet-1.0.0.tar.gz
Algorithm Hash digest
SHA256 73267af6786a271875c4111b46453ea9e43ce2612f69eaa0a1608873fa30d931
MD5 9d41d5be0fb5ad73190f79b89e23db37
BLAKE2b-256 8cd6d592b95282a4a74c5750aa66a3b402d258e00dd6a2ef1a15c46496410119

See more details on using hashes here.

File details

Details for the file soltrannet-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: soltrannet-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 41.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9

File hashes

Hashes for soltrannet-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91d4329e4144883151bf1c57e064812b956253f6895f709fbb099c4587bffcf1
MD5 5eac03dfe2155df7aa1c0374ac7e63b0
BLAKE2b-256 6a0f9ba461b99904879f79a233226f6c621154b9c745ef4c72bf8fbe7fd89581

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page