Skip to main content

ChemLog is a framework for rule-based ontology extension. This repository implements a classification of peptides on the ChEBI and PubChem datasets.

Installation

You can install ChemLog with pip:

pip install chemlog

To get the latest development version, download the source code and install with

pip install .

If you want to use the MONA reasoner, you have to install it separately (the classifier expects the mona command to be available).

Run the classification

ChemLog provides a command line interface for the classification. Results are in JSON format for each run, alongside a log and a config file. Currently, classification of ChEBI and PubChem data is supported. Download and preprocessing of the data are handled automatically. For instances, the following command classifies the 1,000 smallest peptides in ChEBI with the algorithmic method:

python -m chemlog classify-chebi --chebi-version 239 --strategy algo --only-peptides --n-molecules 1000

For more details on the available command line options run

python -m chemlog --help

Publication

Flügel et al. (2025): ChemLog: Making MSOL Viable for Ontological Classification and Learning

How are peptides classified?

4 methods for classification are implemented:

  1. Using Monadic Second-Order Logic (MSOL) formulas with the MSOL model finder MONA
  2. Turning an MSOL model finding problem into a QBF satisfiability problem and solving that with CAQE or DepQBF, using the Bloqqer preprocessor.
  3. Turning an MOSL model finding problem partially into First-Order Logic (FOL) and solving that with a custom FOL model checker (since not all MSOL axioms are translatable, the non-translatable parts are calculated algorithmically).
  4. Using an algorithmic implementation
  5. Using Answer Set Programming (ASP) rules (chemlog/asp_classification/peptide_rules.pl) with clingo (--strategy asp). Molecules are translated into ASP facts by chemlog/preprocessing/mol_to_asp.py.

If you are just interested in the results, we recommend choosing the algorithmic implementation, as it is the fastest and can handle complex molecules.

The classification covers the following aspects:

  1. Number of amino acids (up to 10, except for the algorithmic method, which covers arbitrary sizes)
  2. Charge category (either salt, anion, cation, zwitterion or neutral)
  3. Proteinogenic amino acids present
  4. Emericellamides and 2,5-diketopiperazines

ChemLog will also return the ChEBI classes that match this classification. Currently supported are:

ChEBI ID name
16670 peptide
60194 peptide cation
60334 peptide anion
60466 peptide zwitterion
25676 oligopeptide
46761 dipeptide
47923 tripeptide
48030 tetrapeptide
48545 pentapeptide
15841 polypeptide
90799 dipeptide zwitterion
155837 tripeptide zwitterion
64372 emericellamide
65061 2,5-diketopiperazines
24866 salt
25696 organic anion
25697 organic cation
27369 zwitterion

All implementations are based on the same natural language definitions and have been developed jointly. Therefore, it is expected that all methods yield the same result. If you make a different experience, please open an issue.

If you face problems using ChemLog or have other questions, feel free to open an issue as well.

Metadata

Release files for chemlog 1.1

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

Source distribution (sdist)

Source distribution for chemlog 1.1
File Size Uploaded Provenance Actions
chemlog-1.1.tar.gz 98.1 kB With provenance Details for chemlog-1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for chemlog 1.1
File Interpreter ABI Platform Actions
chemlog-1.1-py3-none-any.whl Python 3 none any Details for chemlog-1.1-py3-none-any.whl

Total release size: 213.7 kB

Release files / chemlog-1.1.tar.gz

Download URL chemlog-1.1.tar.gz
Size 98.1 kB
Tags Source
SHA-256 checksum
How to use checksums
76dc9287a2e1986d7cd0b190fe01efd2a112efe161befe4e975ddb06a98e3bdd
BLAKE2b-256 checksum
How to use checksums
973e668ebe37f4cb1c676606e8355892852fcbf14da96795c8d1f8073cb01cdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / chemlog-1.1-py3-none-any.whl

Download URL chemlog-1.1-py3-none-any.whl
Size 115.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2f601ace55552c07781f34f43d7e025ede07e9b3f37fe98d67ade2c920a2af5
BLAKE2b-256 checksum
How to use checksums
19943c0b82244b7f1c478c24757e6e1989da079de9ba8d0c98e213107691af53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for chemlog 1.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for chemlog-1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

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.

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