{"id":49378746,"url":"https://github.com/tiejundong/FlexPose","last_synced_at":"2026-05-14T14:01:49.138Z","repository":{"id":201812951,"uuid":"707428665","full_name":"tiejundong/FlexPose","owner":"tiejundong","description":"FlexPose, a framework for AI-based flexible modeling of protein-ligand binding pose.","archived":false,"fork":false,"pushed_at":"2023-12-27T11:13:25.000Z","size":4603,"stargazers_count":55,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-05T20:05:05.564Z","etag":null,"topics":["deep-learning","docking","molecular-modeling","protein-ligand"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiejundong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-10-19T22:03:51.000Z","updated_at":"2026-01-21T07:55:19.000Z","dependencies_parsed_at":"2023-11-12T16:30:55.385Z","dependency_job_id":"2c0982ec-a05f-4d50-b392-9d674fb76c71","html_url":"https://github.com/tiejundong/FlexPose","commit_stats":null,"previous_names":["tiejundong/flexpose"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tiejundong/FlexPose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiejundong%2FFlexPose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiejundong%2FFlexPose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiejundong%2FFlexPose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiejundong%2FFlexPose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiejundong","download_url":"https://codeload.github.com/tiejundong/FlexPose/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiejundong%2FFlexPose/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33028203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","docking","molecular-modeling","protein-ligand"],"created_at":"2026-04-28T04:00:26.990Z","updated_at":"2026-05-14T14:01:49.117Z","avatar_url":"https://github.com/tiejundong.png","language":"Python","funding_links":[],"categories":["2. Deep Learning-Enhanced Molecular Docking and Virtual Screening \u003ca name=\"2\"\u003e\u003c/a\u003e"],"sub_categories":["2.1 Deep learning-based docking methods \u003ca name=\"2.1\"\u003e\u003c/a\u003e"],"readme":"# FlexPose\n\n### [FlexPose](https://pubs.acs.org/doi/10.1021/acs.jctc.3c00273), a framework for AI-based flexible modeling of protein-ligand binding pose.\n\n![Fig1_b](img/Fig1_b.png)\n\n***A free light-weight web server can be found [here](https://www.knightofnight.com/sl/FlexPose).***\n\n\u003cdetails open\u003e\u003csummary\u003e\u003cb\u003eTable of contents\u003c/b\u003e\u003c/summary\u003e\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Prediction](#prediction)\n  - [Training](#training)\n    - [Data augmentation](#data-aug)\n    - [Data preprocessing](#data-preprocessing)\n    - [Train your own model](#train-your-own-model)\n  - [Model confidence visualization](#model-confidence-visualization)\n- [License](#license)\n- [Citation](#citation)\n\u003c/details\u003e\n\n\n## Installation \u003ca name=\"installation\"\u003e\u003c/a\u003e\n### Install prerequisite packages\nFlexPose is implemented in PyTorch. All basic dependencies are listed in `requirements.txt` \nand most of them can be easily installed with `pip install`. \nWe provide tested installation commands in `install_cmd.txt` for your reference.\n\n### Install FlexPose pacakge\n  ```pip install -e .```\n\n## Usage \u003ca name=\"usage\"\u003e\u003c/a\u003e\n\n### Prediction \u003ca name=\"prediction\"\u003e\u003c/a\u003e\n\nYou can use the FlexPose as follows in `demo.py`:\n\n```python\nfrom FlexPose.utils.prediction import predict as predict_by_FlexPose\n\npredict_by_FlexPose(\n    protein='./FlexPose/example/4r6e/4r6e_protein.pdb',               # a protein path, or a list of paths\n    ligand='./FlexPose/example/4r6e/4r6e_ligand.mol2',                # a ligand path (or SMILES), or a list of paths (or SMILES)\n    ref_pocket_center='./FlexPose/example/4r6e/4r6e_ligand.mol2',     # a ligand-like file for selecting pocket, e.g. predictions from Fpocket\n    # batch_csv='./FlexPose/example/example_input.csv',               # for batch prediction\n\n    device='cuda:0',                                                  # device\n    structure_output_path='./structure_output',                       # structure output\n    output_result_path='./output.csv',                                # record output\n)\n```\n\n|Arguments | Descriptions |\n|----------|--------|\n| `protein` | Input proteins (a list of paths) |\n| `ligand`  | Input ligands (a list of paths) |\n| `ref_pocket_center` | Ligand-like files for pocket selection (a list of paths) |\n| `batch_csv` | Batch prediction |\n| `ens` | Ensemble number |\n| `structure_output_path` | A folder for saving predicted structures |\n| `output_result_path` | A csv file for saving records |\n| `min` | Energy minimizion |\n| `min_loop` | Energy minimizion loops |\n| `min_constraint` | Constraint energy minimizion constant (kcal/mol/Å^2) |\n| `model_conf` | Output model confidence |\n| `device` | Device |\n| `batch_size` | Batch size |\n| `prepare_data_with_multi_cpu` | Prepare inputs with multiprocessing |\n\n\n\n### Training \u003ca name=\"training\"\u003e\u003c/a\u003e\n\nHere, we provide a pipeline for training a model on the PDBbind and APObind datasets, \nand it is recommended to run these scripts in the root directory of FlexPose.\n\n#### Data augmentation (Optional) \u003ca name=\"data-aug\"\u003e\u003c/a\u003e\nWe use Rosetta to generate fake apo conformations from holo conformations. For each training iteration, \nthere is a small probability that the model is trained with these fake conformations.\n  ```sh\n  python FlexPose/preprocess/aug_pseudo_apo.py \\\n  --apobind_path path/to/apobind \\\n  --pdbbind_path path/to/pdbbind \\\n  --save_path path/for/saving \\\n  --n_rand_pert 3 \\\n  --n_fixbb_repack 3 \\\n  --n_flexbb_repack 3\n  ```\nYou need to set `--apobind_path` and `--pdbbind_path` to path of the decompressed APObind and PDBbind, \nand set the `--save_path` to a folder to save data augmentation.\n\nNOTE: Generating all conformations takes hours to days (depending on the number of CPU cores used).\nWe recommend performing the data augmentation on computers with multiple CPU cores. \nAlternatively, you can set `--n_rand_pert`, `--n_fixbb_repack` and `--n_flexbb_repack` to 0 to skip most of the processing.\n\n\n#### Data preprocessing (Optional) \u003ca name=\"data-preprocessing\"\u003e\u003c/a\u003e\nAfter data augmentation, now we can generate input files for training:\n  ```sh\n  python FlexPose/preprocess/prepare_APOPDBbind.py \\\n  --apobind_path path/to/apobind \\\n  --pdbbind_path path/to/pdbbind \\\n  --save_path path/for/saving \\\n  --apo_info_path path/to/apobind_all.csv \\\n  --aff_info_path path/to/INDEX_general_PL_data.{year} \\\n  --aug_path path/to/data/augmentation \\\n  --tmp_path ./tmp \\\n  --max_len_pocket 150 \\\n  --max_len_ligand 150\n  ```\nYou need to set `--apobind_path` and `--pdbbind_path` to path of the decompressed APObind and PDBbind (same settings as in the data augmentation), \nand set the `--save_path` to a new folder to save preprocessed data. \n`--apo_info_path` is the path to `apobind_all.csv`, which is provided by APObind.\n`--aff_info_path` is the path to `INDEX_general_PL_data.{year}`, which is provided by PDBbind.\n\nNOTE: Set `--max_len_pocket` and `--max_len_ligand` to a small number (e.g. 64) to get a toy dataset, which can speed up training.\n\n#### Train your own model \u003ca name=\"train-your-own-model\"\u003e\u003c/a\u003e\nIf you want to skip data augmentation and data preprocessing, the preprocessed data can be found \n[here](https://1drv.ms/u/c/469b767efa9cca5a/EWPDY3ymuEtAnY1e6rXlt0EB_U7uXvDihaTvrH6NkN1aeg?e=v1UfN8).\nNow, we can train a toy FlexPose by running:\n  ```sh\n  python FlexPose/train/train_APOPDBbind.py \\\n  --data_path path/to/preprocessed/data \\\n  --data_list_path path/to/data/split \\\n  --batch_size 3 \\\n  --lr 0.0005 \\\n  --n_epoch 200 \\\n  --dropout 0.1 \\\n  --use_pretrain False \\\n  --c_x_sca_hidden 32 \\\n  --c_edge_sca_hidden 16 \\\n  --c_x_vec_hidden 16 \\\n  --c_edge_vec_hidden 8 \\\n  --n_head 2 \\\n  --c_block 2 \\\n  --c_block_only_coor 1\n  ```\nYou need to set the `--data_path` to the preprocessed data and set the `--data_list_path` to a path for saving splited data IDs.\n\nBesides, you can set `--use_pretrain` to `True` to use pre-trained encoders, \nand set (`--pretrain_protein_encoder`, `--pretrain_ligand_encoder`) to the path of pre-trained parameters, respectively \n(or set them to `None` to load our pre-trained encoders). \nWe freeze pre-trained parameters by default to improve training efficiency.\n\n\n## Model confidence visualization \u003ca name=\"model-confidence-visualization\"\u003e\u003c/a\u003e\n![Fig_conf](img/conf_for_demo.png)\n\nYou can visualize model confidence with PyMol:\n```pymol\nspectrum b, red_white_green, minimum=0, maximum=1\n```\n\n\n## License \u003ca name=\"license\"\u003e\u003c/a\u003e\nReleased under the MIT license.\n\n## Citation \u003ca name=\"citation\"\u003e\u003c/a\u003e\nIf you find our model useful in your research, please cite the relevant paper:\n```\n@article{dong2023equivariant,\n  title={Equivariant Flexible Modeling of the Protein--Ligand Binding Pose with Geometric Deep Learning},\n  author={Dong, Tiejun and Yang, Ziduo and Zhou, Jun and Chen, Calvin Yu-Chian},\n  journal={Journal of Chemical Theory and Computation},\n  year={2023},\n  publisher={ACS Publications}\n}\n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiejundong%2FFlexPose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiejundong%2FFlexPose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiejundong%2FFlexPose/lists"}