Skip to main content

D4C molecular property prediction

License Version

Introduction

This project is a deep learning application designed to predict molecular properties. The models implemented in this project feature interpretable and hierarchical architectures, including conventional graph convolutional models. D4CMPP is designed to be user-friendly and extremely convenient for deep learning applications.


Installation

$ pip install D4CMPP

It is recommended to install dgl and torch first with the appropriate versions for your system.
Note that this package was developed with dgl==2.3.0 and torch==2.1.2.


How to start training

Using module

  1. Place the CSV file in your working directory
    • The SMILES of molecules should be in the "compound" column.
    • The SMILES of corresponding solvent should be in the "solvent" column. (optional)
    • There needs to be at least one molecular property for each corresponding molecule.
    • There are some inherent datasets such as 'Aqsoldb' and 'lipophilicity'. Use the 'test' dataset for test execution.
  2. Import the train module of the D4CMPP package
> from D4CMPP import train
  1. Check and choose the ID of the deep learning model in 'network_refer.yaml'. Or, give any invalid ID as the 'network' argument. This will show you the list of IDs of implemented networks.
    • Note that the networks incorporating the effect of solvents have the postfix 'wS', which indicates 'with solvent' (e.g. GCNwS).
> train(network="invalidID", data="test")
  1. Write the network ID for the argument 'network', the CSV file name for the argument 'data', and the column name in the file with the target property for the argument 'target'.
> train(network="GCN", data="test", target=["Abs","Emi"])
  1. Then, the graph will be generated, training will start, and the result of the training will be saved under the './_Models/' directory.

Using source code

You can directly execute training with the source code as below, which is equal to an above example.

$ python main.py -n GCN -d test -t Abs,Emi

Continue to training

You can load the saved model and continue training by

> train(LOAD_PATH="GCN_model_test_Abs,Emi_20240101_000000")

or

$ python main.py -l GCN_model_test_Abs,Emi_20240101_000000

Transfer learning

You can try transfer learning from the pretrained model by

> train(TRANSFER_PATH="GCN_model_test_Abs,Emi_20240101_000000", data="Aqsoldb", target=["Solbility"] )

or

$ python main.py --transfer GCN_model_test_Abs,Emi_20240101_000000 -d Aqsoldb -t Solubility

Analyzer

For additional tasks or analysis, the trained model can be loaded through the Analyzer module. You should import an appropriate analyzer for your trained model. In general, MolAnalyzer supports every model.

from D4CMPP.Analyzer import MolAnalyzer
ma = MolAnalyzer("_Model/GCN_model_test_Abs,Emi_20240101_000000")

In general, Analyzer supports predicting external data.

ma.predict("CCC")

Acknowledgements

This project includes code from the GC-GNN by Adem Rosenkvist Nielsen Aouichaoui (arnaou@kt.dtu.dk), licensed under the MIT License.

  • URL: GC-GNN
  • files: AttentiveFP.py, DMPNN.py
  • Description: The source codes were adopted from this project.
    Additionally, we acknowledge that various other codes and workflows in this project are based on or inspired by these projects. While many of the original codes were modified, we recognize that the coding style and some workflows were influenced by the corresponding projects.

Metadata

Release files for D4CMPP 1.26.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for D4CMPP 1.26.2
File Size Uploaded
d4cmpp-1.26.2.tar.gz 1.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for D4CMPP 1.26.2
File Interpreter ABI Platform
D4CMPP-1.26.2-py3-none-any.whl Python 3 none any Details

Total release size: 3.6 MB

Release files / d4cmpp-1.26.2.tar.gz

Download URL d4cmpp-1.26.2.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
25a31a6641825812fd2fe701d8722251705f1b4f8ffa69fa8fe1a4c32bc473e2
BLAKE2b-256 checksum
How to use checksums
dfbc50ba1eef37b6e06d3b071fe6b5b8901ac09bb73e5a844a19bac8413d238f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / D4CMPP-1.26.2-py3-none-any.whl

Download URL D4CMPP-1.26.2-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b6b79196e904b6a49325d676bfe5dd2662a47ff03c6c667bdc6dfb606a3575cc
BLAKE2b-256 checksum
How to use checksums
6d44b1f4b50c491a596bfed4806cd3b8ad0b20492c9bcd8486bc8ef709a676c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.26.2 This release

2 release files

1.26.1

2 release files

1.26.0

2 release files

1.25.1

2 release files

1.24

2 release files

1.23

2 release files

1.22

2 release files

1.21

2 release files

1.2

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.38

2 release files

0.37

2 release files

0.36

2 release files

0.35

2 release files

0.34

2 release files

0.33

2 release files

0.32

2 release files

0.31

2 release files

0.24

2 release files

0.23

2 release files

0.22

2 release files

0.21

2 release files

0.3

2 release files

0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page