Skip to main content

Kartograf is a package for mapping geometrically atoms of two molecules. (like you need it with hybrid topology)

Project description

Kartografs fancy logo

Kartograf: A Geometry-Based Atom Mapper

Logo build coverage Documentation Status

Pip Install Conda Install

Kartograf is a packgage for atom mappings focussing on 3D geometries. This package can be for example be used to generate hybrid topology systems, where an atom mapping is required to determine the core region of the approach. But of course there exist also other use cases for this package. The atom mapper takes two set of coordinates of molecules as input. Optionally those set of coordinates can be aligned onto each other, checkout the atom_aligner module functions of Kartograf that offer a shape alignment implementation and a MCS-skeleton alignment. The atom_mapper can be used to generate the 3D geometry focused atom mapping, the algorithm is described in the related publication of Kartograf (see reference). Additionally, rule based filter functions can be provided to demap atoms, that do not fullfill the desired criteria, see filters. Several mapping scoring metrics are provided, that evaluate geometric properties of your mapping, from atom_mapping_scorer, which might be useful for checking quality of your mappings. Finally, there is a visualization function display_mappings_3d that can be used to check out the mappings with a jupyter notebook widget.

You can find our Preprint on ChemRxiv

Try our interactive demo: Open In Colab

Usage

from rdkit import Chem
from kartograf.atom_aligner import align_mol_shape
from kartograf.atom_mapping_scorer import MappingRMSDScorer
from kartograf import KartografAtomMapper, SmallMoleculeComponent

# Preprocessing from Smiles - Here you can add your Input!
# Generate Data: START
smiles = ["c1ccccc1", "c1ccccc1(CO)"]
rdmols = [Chem.MolFromSmiles(s) for s in smiles]
rdmols = [Chem.AddHs(m, addCoords=True) for m in rdmols]
[Chem.rdDistGeom.EmbedMolecule(m, useRandomCoords=False, randomSeed = 0) for m in rdmols]
# Generate Data: END

# Build Small Molecule Components
molA, molB = [SmallMoleculeComponent.from_rdkit(m) for m in rdmols]

# Align the mols first - this might not needed, depends on input.
a_molB = align_mol_shape(molB, ref_mol=molA)

# Build Kartograf Atom Mapper
mapper = KartografAtomMapper(atom_map_hydrogens=True)

# Get Mapping
kartograf_mapping = next(mapper.suggest_mappings(molA, a_molB))

# Score Mapping
rmsd_scorer = MappingRMSDScorer()
score = rmsd_scorer(mapping=kartograf_mapping)
print(f"RMSD Score: {score}")

kartograf_mapping

Installation

Latest release

Kartograf can be installed via the package following package managers:

pip (PyPI)

pip install kartograf

conda (conda-forge)

conda install -c conda-forge kartograf

Kartograf can be used via the OpenFE environment like:

from openfe.setup.atom_mapping import kartograf

Developement version

The developing setup of Kartograf works like this:

git clone https://github.com/OpenFreeEnergy/kartograf.git

cd kartograf
mamba env create -f environment.yml

mamba activate kartograf
pip install -e .

License

This library is made available under the MIT open source license.

Authors

The OpenFE development team.

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

kartograf-1.0.1.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

kartograf-1.0.1-py3-none-any.whl (32.7 kB view details)

Uploaded Python 3

File details

Details for the file kartograf-1.0.1.tar.gz.

File metadata

  • Download URL: kartograf-1.0.1.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for kartograf-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9ba7f108e116c1c37721c385cc1caeb176d4c54076b07df8d29660699a5f6ee2
MD5 4ef78b11383450e8cb7c167779c801e4
BLAKE2b-256 9c8bab8cfe4be5cd57df7d370ed236f66de0e829555e2a438cd067fc0fb5514f

See more details on using hashes here.

File details

Details for the file kartograf-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: kartograf-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 32.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for kartograf-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 856188e2499dc060755c11d51266aef6b5d9539de9ed19cc1089feadd58f7ad0
MD5 7d461bbe2bacb37886a14ef50b8a7aca
BLAKE2b-256 220c9fe3ab9e1a9f8d373ab06f8af0cbe6939324b24d83776c50c49e8bb84f93

See more details on using hashes here.

Supported by

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