Source code for TWN-FG method.
TWN-FG is conducted through the following procedure.
This code was tested in windows with Python 3.9.
A yaml file containing all requirements is provided.
You can set up a virtual environment in conda as follows:
conda env create -f TWN-Region-Analysis.yaml
conda activate TWN-Region-Analysis
To run this code, you need the following three preset files.
- Molecular dynamics (MD) simulation trajectories for target protein
- Topological water networks (TWN)
- Boundary file
We used GROMACS version 5.1.4 and the CHARMM27 forcefield to get MD trajecotries. For this analysis, you can use input files available in DATA directory or you can prepare your input files in similar way.
TWNs can be obtained by running the TWN_Extractor_v1.exe file. The input file must contain a_input in the upper PDB directory (for example, 1NVR in the trajectory directory) and must be entered in the format of "trajectory number.pdb" (for example, 0.pdb).
For example:
TWN_Extractor_v1.exe -path ./DATA/trajectory/1NVR
The output file is created as "a_output" in the same pdb directory by default. In detail, you can set the output directory name and whether to include duplicates of rings of larger size ("True" by default which means include duplicates).
For example:
TWN_Extractor_v1.exe -path ./DATA/trajectory/1NVR -opname "output directory name" -dup False
After the extraction process is completed, you must change the rfour directory created in the output directory to the "protein-name_pdb-code_ring-type" format to create a TWN directory like "CHK1_1NVR_R4" in the DATA/TWN directory.
Boundary file can be obtained by running the Boundary_file_maker.py file. The input file must be same as the input of TWN_Extractor_v1.exe.
For example:
python boundary_file_maker.py -path ./DATA/trajectory/1NVR
You can choose options after typing this at the prompt (for example, centering methods and sizes). After running you can get a ".bd" format file in the directory name of "boundary".
After preparing all required presets, you are ready to run the main code, "TWN-Region-Analysis.py". Please make sure to prepare all directories like the example "DATA".
Script for running code is following:
python TWN-Region-Analysis.py -d ./DATA
After running the code, you can get three directories.
- TWN Pattern
- TWN Region
- logs
TWN patterns indicate independent positions and shapes of water networks within protein binding pocket. TWN regions are identified based on the TWN patterns.
For better understanding of output files, you can read our paper.
https://link.springer.com/article/10.1186/s13321-026-01188-4#Sec25
Questions : Please ask our professor nskang@cnu.ac.kr
Bugs/Requests : Please submit a GitHub issue or contact me ray971125@naver.com