Skip to content
KartinaaPublic

About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

1 watching

Forks

Repository files navigation

SLOGEN: A Structure-based Lead Optimization model unifying fragment Generation and screENing

A hybrid approach combining fragment generation and screening for structure-based fragment growing/elaboration.

🚀 Quick Start

Installation

  1. Clone the repository:
git clone https://github.com/Kartinaa/Slogen.git

cd Slogen
  1. Install dependencies:
conda env create -f environment.yaml

📁 Data and ckpt folder structure

You could download data files from HuggingFace and pretrained model checkpoint from Zenodo. Then put them in corresponding folders as follows:

Slogen/

├── data/ # Datasets and examples

│ ├── example/ 

│ ├── small_frag/ 

| | ├── high/

| | ├── high_name2id.pt

| | ├── high_processed.lmdb

├── ckpt/ # Model checkpoints

│ ├── train_1000_2025_06_29__20_16_35/

| | ├── 2340000.pt

📊 Usage

Data pre-processing:

We provided two script for pre-processing the PL complex to the format needed by Slogen.

For protein input, residues around 6A of ligand will be extracted by preprocessing/extract_protein_near_ligand.py.

For ligand input, you could using SMILES with connecting point indicated by dummy atom to generate 3D parent fragment by preprocessing/extract_fragment_with_dummy.py

Example command will be:

For protein input:

python preprocessing/extract_protein_near_ligand.py --protein data/example/protein.pdb --ligand data/example/ligand.sdf --output data/example/protein_6A.pdb

For ligand input:

python preprcessing/extract_fragment_with_dummy.py --ligand_sdf data/example/ligand.sdf --smiles 'OC1=CC=C(OC[C@H](O)C[NH2+][*])C=C1' --out_sdf data/example/big.sdf --match_index 0

The big.sdf should be same with data/example/target_CHEMBL210_CHEMBL12994_2_big.sdf.

1. Training the GNN Model

Train the GNN predictor on protein-ligand complexes:

python train.py --config ./configs/train.yml --device cuda

Configuration (configs/train.yml):

  • Model architecture parameters

  • Training hyperparameters

  • Dataset paths and splits

2. Sampling Latent Vectors

Generate latent vectors for molecular fragments:

python sample_latent.py \

--pocket_path data/example/protein_6A.pdb \

--ligand_path data/example/target_CHEMBL210_CHEMBL12994_1_big.sdf \

--checkpoint ckpt/train_1000_2025_06_29__20_16_35/2340000.pt

3. Decoding to SMILES

Convert latent vectors to molecular SMILES:

python decode_smiles.py \

--latent_mu sample_latent_outputs/*Your_latent_folder*/sampled_latent_mu.npy \

--latent_var sample_latent_outputs/*Your_latent_folder*/sampled_latent_var.npy \

--num_smiles 50 \

--temperature 1.0

4. Combined Pipeline

Run the complete generation pipeline:

python sample_and_decode.py \

--pocket_path pl_complex_separate_6A.pdb \

--ligand_path pl_complex_separate_big.sdf \

--checkpoint ckpt/train_1000_2025_06_29__20_16_35/2340000.pt \

--num_smiles 50

🧪 Data Format

Input Files

  • pocket_path: PDB format files containing residues around 6Å of the ligand of interest.

  • Ligand: SDF format files containing parent fragments with connecting point marked by dummy atom

Output format for combined pipeline

Your_defined_output_folder/

├── Unique_name_for_each_run/ 

│ ├── 2340000.pt # Checkpoint used for this run.

│ ├── generated_*_unique_neutralized_2340000.smi # Generated fragments, connecting point marked by dummy atom '*'.

│ ├── *.pdb # input pocket file.

│ ├── *.sdf # input parent fragment file.

│ ├── sample_and_decode.log # log file

│ ├── sample_latent.yml # Config file used for generation.

│ ├── sampled_latent_mu.npy # predicted mu vector.

│ ├── sampled_latent_var.npy # predicted var vector.

About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages