Installation & Setup
Relevant source files
The following files were used as context for generating this wiki page:
DGL-LifeSci is a python-based package built on top of the Deep Graph Library (DGL) designed for various applications in life science, such as molecular property prediction, generative modeling, and reaction prediction. The project provides graph neural network (GNN) architectures, featurization methods, and pre-trained models specifically tailored for molecular and biological data.
Sources: README.md:11-19
The installation process involves setting up the core dependencies—PyTorch and DGL—along with domain-specific libraries like RDKit for cheminformatics. Users can choose between stable releases via package managers or development versions installed from source.
Sources: README.md:23-45
System Requirements and Prerequisites
DGL-LifeSci supports major operating systems and requires a specific stack of underlying libraries to function correctly.
Supported Operating Systems
- Linux: Ubuntu 16.04 or later.
- macOS: X versions.
- Windows: Windows 10.
Sources: README.md:25-28
Core Dependencies
The library requires Python 3.6+ and depends heavily on the PyTorch backend for DGL.
| Dependency | Version Requirement |
|---|---|
| Python | 3.6+ |
| DGL | 0.5.2+ |
| PyTorch | 1.5.0+ |
| RDKit | 2018.09.3 (Recommended) |
Sources: README.md:30-41
Installation Methods
1. Pip Installation
The simplest way to install the stable version of DGL-LifeSci is through the Python Package Index:
pip install dgllife
Sources: README.md:47-49
2. Conda Installation
For users managing environments with Conda, DGL-LifeSci is available via the dglteam channel. Note that hyperopt is a required prerequisite for this method:
pip install hyperopt
conda install -c dglteam dgllife
Sources: README.md:51-54
3. Installation from Source
To access experimental features or contribute to development, users can install directly from the GitHub repository:
git clone https://github.com/awslabs/dgl-lifesci.git
cd dgl-lifesci/python
python setup.py install
Sources: README.md:56-62
Workflow and Configuration
The following diagram illustrates the typical setup and verification flow for a new installation.
The diagram shows the sequence of dependency resolution followed by the choice of installation method and final verification.
Sources: README.md:23-77
Initial Backend Selection
Upon the first import of DGL, the system will prompt for a backend choice. DGL-LifeSci is designed to work with PyTorch.
DGL does not detect a valid backend option. Which backend would you like to work with?
Backend choice (pytorch, mxnet or tensorflow): pytorch
Sources: README.md:73-77
Verification of Installation
Successful installation can be verified by checking the version in a Python shell:
import dgllife
print(dgllife.__version__)
# Expected output example: 0.2.5
Sources: README.md:64-70
Setup for Specific Modules
Certain examples and modules within the project require additional setup steps or external data.
Cheminformatics and Data Analysis
For analyzing molecules in CSV files or performing featurization, RDKit must be properly configured in the environment.
Sources: examples/property_prediction/csv_data_configuration/README.md:14-20
Generative Models (JTVAE/DGMG)
- JTVAE: Requires a vocabulary file. The dataset and vocabulary for ZINC are downloaded automatically upon running
train.py, but custom datasets require a manual vocabulary generation step usingvocab.py. - DGMG: Monitoring training requires installing
tensorboardXandTensorFlow.
Sources: examples/generative_models/jtvae/README.md:41-43, examples/generative_models/dgmg/README.md:94-96
Reaction Prediction
The candidate ranking module requires MolVS for comparing molecule equivalence during evaluation.
pip install molvs
Sources: examples/reaction_prediction/rexgen_direct/README.md:144-149
Contributing Setup
Developers intending to contribute via Pull Requests should follow a specific fork-and-branch workflow against the master branch.
The sequence diagram details the standard contribution flow for environmental setup and code submission.
Sources: CONTRIBUTING.md:22-41
Summary
DGL-LifeSci setup requires a Python environment with PyTorch and DGL. While standard installation is handled via pip or conda, complex modules like reaction prediction or generative models may require supplementary libraries (e.g., MolVS) or automated data downloads. Proper verification involves confirming the library version and ensuring the PyTorch backend is active in DGL.