Data prep & featurization
Data preparation and featurization guide for DeepPurpose DTI prediction.
DeepPurpose is a deep learning library for drug-target interaction (DTI) prediction, published in Bioinformatics. This guide covers data preparation for training DTI models.
Input format
Create a CSV with SMILES, FASTA targets, and labels:
Train/val/test splits
Choosing encoders
DeepPurpose provides 15+ compound encoders and 7+ protein encoders that can be combined into 50+ neural architectures.
Compound (drug) encoders
| Encoder | Type | Description |
|---|---|---|
Morgan | Fingerprint | Morgan/ECFP circular fingerprints |
Pubchem | Fingerprint | PubChem substructure fingerprints |
Daylight | Fingerprint | Daylight-type fingerprints |
rdkit_2d_normalized | Descriptor | RDKit 2D molecular descriptors |
CNN | Deep Learning | 1D CNN on SMILES strings |
CNN_RNN | Deep Learning | CNN + RNN hybrid on SMILES |
RNN | Deep Learning | RNN/LSTM on SMILES sequences |
Transformer | Deep Learning | Transformer encoder on SMILES |
MPNN | GNN | Message Passing Neural Network on molecular graphs |
DGL_GCN | GNN | Graph Convolutional Network (DGL) |
DGL_NeuralFP | GNN | Neural fingerprints via DGL |
DGL_AttentiveFP | GNN | Attentive fingerprints via DGL |
DGL_GIN_AttrMasking | GNN | GIN with attribute masking (pretrained) |
DGL_GIN_ContextPred | GNN | GIN with context prediction (pretrained) |
Protein (target) encoders
| Encoder | Type | Description |
|---|---|---|
AAC | Descriptor | Amino Acid Composition |
PseudoAAC | Descriptor | Pseudo Amino Acid Composition |
Conjoint_triad | Descriptor | Conjoint triad features |
Quasi-seq | Descriptor | Quasi-sequence order descriptors |
CNN | Deep Learning | 1D CNN on amino acid sequences |
CNN_RNN | Deep Learning | CNN + RNN hybrid |
RNN | Deep Learning | RNN/LSTM on protein sequences |
Transformer | Deep Learning | Transformer encoder on sequences |
Encoder selection tips
- Small datasets (<1000 samples): Use fingerprint encoders (
Morgan,Pubchem) with descriptor-based protein encoders (AAC,PseudoAAC) - Medium datasets: CNN-based encoders offer a good balance of performance and speed
- Large datasets: Transformer and GNN encoders can capture more complex patterns
- Pretrained options:
DGL_GIN_AttrMaskingandDGL_GIN_ContextPredleverage pretrained molecular representations
Featurize with DeepPurpose utils
DeepPurpose provides built-in dataset utilities and benchmark datasets:
Available benchmark datasets
DeepPurpose includes loaders for common DTI benchmark datasets:
- DAVIS: Kinase inhibitor binding affinities (Kd values)
- KIBA: Kinase Inhibitor BioActivity dataset
- BindingDB: Large-scale binding affinity database
- DrugBank: Drug-target associations
- Tox21: Toxicity prediction dataset
- HIV: HIV replication inhibition dataset
Data quality tips
- Deduplicate SMILES/targets before splitting.
- Validate FASTA headers and ensure sequences contain only valid amino acids.
- Standardize SMILES (e.g., RDKit canonicalization) before training to reduce variance.
- For binding affinity data, consider log transformation (pKd, pKi) for better model convergence.
- Remove invalid SMILES using RDKit's
MolFromSmiles()validation.
Split strategies
DeepPurpose supports multiple splitting strategies for robust evaluation:
Cold splits are more challenging but better reflect real-world drug discovery scenarios where you predict interactions for novel compounds or targets.
Was this page helpful?