Skip to main content

Graph neural network tool for solvent removal from MOF structures

Project description

GTsR

GTsR logo

Requires Python 3.10 MIT

GTsR (GNN Tool for Solvent Removal) is a tool for solvent identification, solvent removal, and activation-stability prediction in metal-organic frameworks (MOFs).

GTsR uses graph neural networks to classify atoms in CIF structures and generate solvent-free framework CIF files. It also provides a random forest model that predicts the activation stability of cleaned MOFs using structural, pore, and RAC descriptors.

Models

checkpoint Model file Purpose
free (default) ckpt/free_best.pth Remove free solvent
all ckpt/all_best.pth Remove all solvent
stability ckpt/stability_best.pkl Predict activation stability

The free and all checkpoints are atom-level GNN classifiers. The stability checkpoint is a random forest model bundled with its missing-value imputer.

Installation

git clone https://github.com/coollkr/GTsR.git
cd GTsR
pip install -e .

Usage

Solvent Removal

from gtsr import GTsRunner

runner = GTsRunner(checkpoint="free") ### for free solvent removal
runner = GTsRunner(checkpoint="all") ### for all solvent removal
runner = GTsRunner(checkpoint="path/to/ckpt.pth", device="cpu") #### use your model
result = runner.clean(
    cif="input.cif",
    output="prediction",
    threshold=0.5,
)

clean() Result

clean() returns a dictionary containing the following fields:

Field Description
input Absolute path to the input CIF
output Output directory
framework Path to the cleaned framework CIF
solvent Path to the solvent CIF, or None if no file was generated
checkpoint Path to the checkpoint used for prediction
task Task name stored in the checkpoint
threshold Atom-classification threshold
num_atoms Total number of atoms
num_framework_atoms Number of framework atoms
num_solvent_atoms Number of solvent atoms
probabilities Solvent probability for each atom
labels Predicted class label for each atom
solvent_smiles SMILES strings of identified solvents

Predict Activation Stability

from gtsr import GTsRunner

runner = GTsRunner(checkpoint="stability")
score = runner.stability(cif="cleaned_framework.cif")

if score == 1:
    print("The cleaned structure is stable.")
else:
    print("The cleaned structure is not stable.")

Web Interface

Host on Streamlit or in your location

streamlit run webapp/Home.py

Citation

Update the following entry when the associated publication becomes available:

@article{gtsr-xyl-group,
  title   = {GTSR: A GNN Based Tool for Solvent Removal from MOF with Stability Check},
  author  = {Liang, Kairui and Zhao, Guobin and Li, Xiao-Yan},
  year    = {2026}
}

License

The repository's LICENSE file currently uses the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gtsr-0.0.1.tar.gz (31.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gtsr-0.0.1-py3-none-any.whl (32.1 MB view details)

Uploaded Python 3

File details

Details for the file gtsr-0.0.1.tar.gz.

File metadata

  • Download URL: gtsr-0.0.1.tar.gz
  • Upload date:
  • Size: 31.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for gtsr-0.0.1.tar.gz
Algorithm Hash digest
SHA256 21d0ac05aa605566a44c5e260869eab935017c5ec4a0fb18d2833ad2d343e734
MD5 272ed0197f5bacfd4bca4593d8637f84
BLAKE2b-256 b77f00c4d7b5aef210283b0120c8a17ce1ad978bc3a5fdebd42c448bc75c0eb9

See more details on using hashes here.

File details

Details for the file gtsr-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: gtsr-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 32.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for gtsr-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a52ea4ba252bbb34656c65d33b99e3a6e722ab3d31037d1415491d9fe3826bc
MD5 a1de95591f87508b8c50b39437eea9c6
BLAKE2b-256 88be311599a4946059e5d18a1d90eab049296df53476def096b006732ffea760

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page