{"id":21441750,"url":"https://github.com/dmis-lab/molpla","last_synced_at":"2025-04-19T19:28:31.382Z","repository":{"id":221450315,"uuid":"754416384","full_name":"dmis-lab/MolPLA","owner":"dmis-lab","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-13T06:57:54.000Z","size":584,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-23T01:41:44.397Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmis-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-08T02:02:58.000Z","updated_at":"2024-10-15T07:34:52.000Z","dependencies_parsed_at":"2024-02-08T03:22:41.932Z","dependency_job_id":"8901fc13-8c06-4be6-81dd-c47ccb543ba9","html_url":"https://github.com/dmis-lab/MolPLA","commit_stats":null,"previous_names":["dmis-lab/molpla"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2FMolPLA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2FMolPLA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2FMolPLA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmis-lab%2FMolPLA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmis-lab","download_url":"https://codeload.github.com/dmis-lab/MolPLA/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235263488,"owners_count":18962157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-23T01:41:32.900Z","updated_at":"2025-01-23T10:27:39.147Z","avatar_url":"https://github.com/dmis-lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MolPLA \n\n![img](./figures/molpla_model.jpg)\n\n## Abstract (submitted to ISMB 2024 Proceedings Track)\n\nMolecular core structures and R-groups are essential concepts in drug development. Integration of these concepts with conventional graph pre-training approaches can promote deeper understanding in molecules. We propose MolPLA, a novel pre-training framework that employs masked graph contrastive learning in understanding the underlying decomposable parts in molecules that implicate their core structure and peripheral R-groups. Furthermore, we formulate an additional framework that grants MolPLA the ability to help chemists find replaceable R-groups in lead optimization scenarios. Experimental results on molecular property prediction show that MolPLA exhibits predictability comparable to current state-of-the-art models. Qualitative analysis implicate that MolPLA is capable of distinguishing core and R-group sub-structures, identifying decomposable regions in molecules and contributing to lead optimization scenarios by rationally suggesting R-group replacements given various query core templates.\n\n\n## How to run the experiments \n\n### Step 1. Edit the confguration file **settings.yaml**.\n```\nexample:\n  dev_mode: \n    debugging: \n    toy_test: \n\n  wandb:\n    project_name: example_project_name\n    session_name: example_session_name\n    group_name: \n\n  ddp:\n    port: 13000\n\n  path:\n    dataset: /path/to/folder/named/datasets\n    checkpoint: /path/to/folder/named/checkpoints\n\n  dataprep:\n    dataset: geom\n    version: v11\n    subsample: 1.0\n\n  experiment:\n    testing_mode: false\n    random_seed: 911012\n    which_best: loss\n\n  model_params: \n    model_type: molpla\n    hidden_dim: 300\n    dropout_rate: 0.0\n    graph_encoder: GNN\n    gnn_params:\n      aggr: add\n      JK: concat\n      gnn_type: gin\n      num_layer: 3\n\n    graph_pooling: add\n    graph_projector: mlp\n    link_decoder: mlp\n\n    stop_gradient_arms:    False\n    stop_gradient_core:    False\n    separate_linker_nodes: False\n\n    prop_conditioned: arms\n\n    faiss_metric: inner_product\n\n  train_params:\n    batch_size: 4096\n    num_epochs: 200\n\n    optimizer: adam\n    scheduler: CyclicLR\n\n    learning_rate: 0.00001\n    weight_decay: 0.0\n\n    early_stopping: loss\n    early_patience: 30\n\n    pretraining:\n      main_graph_contrastive:\n        loss_coef: 0.1\n        score_func: dualentropy\n        tau: 0.1\n      dcpd_graph_contrastive:\n        loss_coef: 0.1\n        score_func: dualentropy\n        tau: 0.05\n      linker_node_contrastive:\n        loss_coef: 0.8\n        score_func: dualentropy\n        tau: 0.01\n\nexample_bench:\n  dataprep:\n    dataset: \n    version: \n    subsample:\n\n  experiment:\n    testing_mode: false\n    random_seed: 8888\n    which_best: loss\n\n  model_params:\n    dropout_rate: 0.1\n\n  train_params:\n    batch_size: 256\n    num_epochs: 100\n\n    optimizer: adam\n    scheduler: dummy\n\n    learning_rate: 0.0001\n    weight_decay: 0.0\n\n    early_stopping: \n    early_patience: 100\n\n    finetuning:\n      from_pretrained:   pretrained_geom_v11\n      freeze_pretrained: False\n```\n\n- Possible arguments for \n  - **example.model_params.model_type**: ```molpla```\n  - **example.train_params.scheduler**: ```dummy```, ```CyclicLR```\n  - **example.train_params.pretraining.linker_node_contrastive**: ```dualentropy```\n- All experiment reports are uploaded to your WANDB account. \n- You can download the datasets from our Google Drive. Current version is ```v11```.\n\n### Step 2. Run the following script\n```\npython run.py -sn main -mg {GPU indices separated by comma}\n\n```\n\n- This script will pretrain the molecule representation model and then perform benchmark experiments (finetune-and-test) on various molecule property prediction datasets including *freesolv*, *lipophilicity*, *esol*, *toxcast*, *tox21*, *sider*, *bbbp*, *bace* and *clintox*.\n- If you want to skip the pretraining phase, add *-sp* to the above script.\n- If you want to run only the pretraining code to either adjust the hyperparameters or look into the **R-Group Retrieval Task**, run this code instead.\n\n```\npython run_pretrain.py -sn example -mg {GPU indices separated by comma}\n\n```\n\n\n### Downloading the Preprocessed Dataset and Pretrained Model\n\n- The dataset contains all pre-processed data that was used to pre-train MoLPLA and perform benchmark test on molecule property prediction. [GOOGLE DRIVE DOWNLOAD LINK](https://drive.google.com/file/d/1sgWVvZ3ln56D9GP7u5VoUhoP4MD0IQTR/view?usp=sharing)\n- This repository in Google Drive contains all the files including the model checkpoints containing pre-trained parameters. Note that you might have to edit the directory configuration inside **model_config.pkl**. [GOOGLE DRIVE DOWNLOAD LINK](https://drive.google.com/drive/folders/1fEtaPKuwDihHAprxQgWg2eKPXtNCi5xv?usp=drive_link)\n\n\n## Contributors\n\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003cth\u003eName\u003c/th\u003e\t\t\n\t\t\u003cth\u003eAffiliation\u003c/th\u003e\n\t\t\u003cth\u003eEmail\u003c/th\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eMogan Gim\u0026dagger;\u003c/td\u003e\t\t\n\t\t\u003ctd\u003eData Mining and Information Systems Lab,\u003cbr\u003eKorea University, Seoul, South Korea\u003c/td\u003e\n\t\t\u003ctd\u003eakim@korea.ac.kr\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eJueon Park\u0026dagger;\u003c/td\u003e\t\t\n\t\t\u003ctd\u003eData Mining and Information Systems Lab,\u003cbr\u003eKorea University, Seoul, South Korea\u003c/td\u003e\n\t\t\u003ctd\u003ejueon_park@korea.ac.kr\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eSoyon Park\u003c/td\u003e\t\t\n\t\t\u003ctd\u003eData Mining and Information Systems Lab,\u003cbr\u003eKorea University, Seoul, South Korea\u003c/td\u003e\n\t\t\u003ctd\u003esoyon_park@korea.ac.kr\u003c/td\u003e\n\t\u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eSanghoon Lee\u003c/td\u003e   \n    \u003ctd\u003eData Mining and Information Systems Lab,\u003cbr\u003eKorea University, Seoul, South Korea\u003c/td\u003e\n    \u003ctd\u003ea11525@korea.ac.kr\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eSeungheun Baek\u003c/td\u003e   \n    \u003ctd\u003eData Mining and Information Systems Lab,\u003cbr\u003eKorea University, Seoul, South Korea\u003c/td\u003e\n    \u003ctd\u003esheunbaek@korea.ac.kr\u003c/td\u003e\n  \u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eJunhyun Lee\u003c/td\u003e\t\t\n\t\t\u003ctd\u003eData Mining and Information Systems Lab,\u003cbr\u003eKorea University, Seoul, South Korea\u003c/td\u003e\n\t\t\u003ctd\u003eljhyun33@korea.ac.kr\u003c/td\u003e\n\t\u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eNgoc-Quang Nguyen\u003c/td\u003e   \n    \u003ctd\u003eData Mining and Information Systems Lab,\u003cbr\u003eKorea University, Seoul, South Korea\u003c/td\u003e\n    \u003ctd\u003equangku12@korea.ac.kr\u003c/td\u003e\n  \u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eJaewoo Kang*\u003c/td\u003e\t\t\n\t\t\u003ctd\u003eData Mining and Information Systems Lab,\u003cbr\u003eKorea University, Seoul, South Korea\u003c/td\u003e\n\t\t\u003ctd\u003ekangj@korea.ac.kr\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n- \u0026dagger;: *Equal Contributors*\n- \u0026ast;: *Corresponding Author*","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmis-lab%2Fmolpla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmis-lab%2Fmolpla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmis-lab%2Fmolpla/lists"}