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.batch_feature import BatchFeature

model_path = './craft_mol/1m_checkpoint_09.pth'
config_path = './craft_mol/inference.yaml'
batch_feature = BatchFeature(model_path=model_path,config_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.3.tar.gz (76.2 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.3-py3-none-any.whl (102.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: craft_mol-1.3.tar.gz
  • Upload date:
  • Size: 76.2 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.3.tar.gz
Algorithm Hash digest
SHA256 4eff2ecb06500db02b9159e7e7587065469855780c262d36bdbdd93a2114e6ef
MD5 4638f2b65a745f6de676a444b6ace1bb
BLAKE2b-256 1fc8ff23fc6d8e36fa0ce03fb664ec4c5ca1af710e6a8e40d67ad9aef7ad0abc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: craft_mol-1.3-py3-none-any.whl
  • Upload date:
  • Size: 102.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e9fe7ab18823401580d799412ac50417474f0b23b9fd931b996634968200921a
MD5 b8a0662dd14735cff34cdf34597b1df7
BLAKE2b-256 ceb8c7cc72113055e34ce987793b2fc391323f8f3ac9da6ddc7a11fa77b86c5c

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