Skip to main content

Kartografs fancy logo

Kartograf: A Geometry-Based Atom Mapper

Logo build coverage Documentation Status DOI Conda Install

Kartograf is a package 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 fulfill the desired criteria, see filters. Several mapping scoring metrics are provided, that evaluate geometric properties of your mapping, from mapping_metrics, which might be useful for checking quality of your mappings.

Checkout our article on Kartograf in the Journal of Chemical Theory and Computation: Kartograf: A Geometrically Accurate Atom Mapper for Hybrid-Topology Relative Free Energy Calculations - Benjamin Ries*, Irfan Alibay, David W. H. Swenson, Hannah M. Baumann, Michael M. Henry, James R. B. Eastwood, and Richard J. Gowers.

You can find a preprint on ChemRxiv.

Usage

from rdkit import Chem
from kartograf.atom_aligner import align_mol_shape
from kartograf.mapping_metrics 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:

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

Development 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.

Metadata

Release files for acellera-kartograf 2.0.0

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

Source distribution (sdist)

Source distribution for acellera-kartograf 2.0.0
File Size Uploaded Provenance Actions
acellera_kartograf-2.0.0.tar.gz 6.8 MB Without provenance Details for acellera_kartograf-2.0.0.tar.gz

Release files / acellera_kartograf-2.0.0.tar.gz

Download URL acellera_kartograf-2.0.0.tar.gz
Size 6.8 MB
Tags Source
SHA-256 checksum
How to use checksums
f40384b093523c1a2c45fe2820929c27197bb78f45869235188a88227b3d3f6f
BLAKE2b-256 checksum
How to use checksums
fe38b51f239dd40b2535cc7c8c24eb5562b90e3322043376c174a1e5691ef8b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Security for acellera-kartograf 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

1 release file No provenance

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