TWN-Align: A Topological Water Network–Guided Molecular Alignment Method for Fragment Screening
This repository provides the source code for TWN-Align, a fragment screening and alignment framework guided by Topological Water Networks (TWNs). The overall workflow of TWN-Align is summarized below.

This code has been tested on Windows using Python 3.9.
A YAML file containing all required dependencies is provided. You can set up a Conda virtual environment as follows:
conda env create -f TWN-FS-open-source.yaml
conda activate TWN-FS-open-sourceTo run TWN-Align, the following preset files are required:
- trajectory
- TWN-Region
- TWN-Pattern
- TWN-pharma
- Fragment files
The trajectory, TWN-Region and TWN-Pattern files can be generated using the same procedure as in the TWN-FG method:
https://github.com/RgJeoung/TWN-FG
Important notes on fragment files Fragment files must contain energy-minimized 3D structures. Hydrogen atoms must be explicitly included to enable pharmacophore feature assignment.
Details on generating the TWN-pharma file are provided below.
The TWN-pharma file is generated by computing the dipole moments of TWNs. It can be obtained using the following command:
python TWN_dipole_extractor.py -d ./DATA/TWN-PatternAfter preparing all required preset files, you can run the main script, TWN-FS-open-source.py. Please ensure that all input directories are organized in the same manner as the example DATA directory provided in this repository.
You can check the available command-line options using:
python TWN-FS-open-source.py -hThis will display the following instructions:
-h, --help show this help message and exit
-f FRAGMENT, --fragment FRAGMENT
Path to the fragment directory (input fragments to be screened)
-r REGION, --region REGION
Region definition file used for TWN analysis
-o OUTPUT, --output OUTPUT
Output directory name (optional).
If not specified, a directory named:
<fragment_dir>_TWN-FS-RESULT0001
will be created automatically.
If the directory already exists, the index will be incremented.
-a True/False, --alignment True/False
Enable TWN-based alignment step.
Default: True
-c CORE, --core CORE Number of CPU cores to use for parallel processing.
Default: maximum available cores
To run TWN-Align with default settings, use the following command:
python TWN-FS-open-source.py -f ./DATA/test_fragments -r ./DATA/TWN-Region/CHK1_1NVR_R4/TWN_Region_1.sdfAfter completion, an output directory such as the following will be created:
test_fragments_TWN-FS-RESULT0001
The output directory contains:
- Aligned fragment files (
.sdf) TWN-FS.log(log and report file)
We recommend visualizing the aligned fragment files together with the corresponding TWN-Region to verify that the alignment was performed correctly.
The TWN-FS.log file includes the execution settings as well as a brief screening report.
For a detailed interpretation of the output files and methodology, please refer to our published paper.
Questions Please contact our professor: 📧 nskang@cnu.ac.kr
Bugs / Feature Requests Please submit a GitHub issue or contact the developer directly: 📧 ray971125@naver.com