Skip to main content

CRAFT: Consistent Representational Fusion of Three Molecular Modalities.

Project description

CRAFT

CRAFT: Consistent Representational Fusion of Three Molecular Modalities

1. Environment Setup

1.1. Install Conda

wget https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh
chmod +x Anaconda3-2023.09-0-Linux-x86_64.sh
source ~/.bashrc

1.2. Create Conda Environment

conda create -n craft python=3.10.13
conda activate craft
conda install -c conda-forge rdkit

1.3. Install Dependencies

clone the repository

git clone https://github.com/hukunhukun/CRAFT.git
cd CRAFT
pip install -r requirements.txt 

or

pip install -e .

1.4. Import the CRAFT package

pip install craft_mol

2. Model weights

Download the model weights from the huggingface and place them in the weights directory.

git lfs install
git clone https://huggingface.co/kunkunhu/craft_mol

3. Usage

Get molecular representations from three molecular modalities (SELFIES, Molecular Graph and IUPAC names)

from craft_mol import batch_feature

model_path = '/your_path/1m_checkpoint_09.pth'
config_path = '/your_path/pre_train.yaml'
batch_feature = BatchFeature(model_path,config_path)

smiles = "CC(C)CC1=CC=C(C=C1)C(=O)O"
iupac_name = "4-(2-methylpropyl)benzoic acid"

mol_feature = batch_feature.get_feature_single(smiles=smiles, iupac_name=iupac_name)
print(mol_feature.shape)

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

craft_mol-1.1.tar.gz (70.6 kB view details)

Uploaded Source

Built Distribution

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

craft_mol-1.1-py3-none-any.whl (92.5 kB view details)

Uploaded Python 3

File details

Details for the file craft_mol-1.1.tar.gz.

File metadata

  • Download URL: craft_mol-1.1.tar.gz
  • Upload date:
  • Size: 70.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for craft_mol-1.1.tar.gz
Algorithm Hash digest
SHA256 a64642360761dc722b7b6d35efe8a057a87bfd3f999b7cd263e00c3ba12d1c97
MD5 db27a7d3b197c74db585105fc524d16b
BLAKE2b-256 e5250cd40f8a548fe38bfcd25522acb160e3a774837f76a46b62d37eee508c28

See more details on using hashes here.

File details

Details for the file craft_mol-1.1-py3-none-any.whl.

File metadata

  • Download URL: craft_mol-1.1-py3-none-any.whl
  • Upload date:
  • Size: 92.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for craft_mol-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3647dc49500770c699e5a0c2ab26033b8a6af8195fec0af1bdc91eb014f9c250
MD5 81f07a9b348fa8c1155ca3101bdd5321
BLAKE2b-256 2f3a7e60c40410bac32e869af53f569c7c4028faaa564bafcdccecbcd7717065

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