Skip to main content

Hierarchical molecular identity comparison framework for untargeted metabolomics

Project description

InChI Identity

A hierarchical molecular identity comparison framework for untargeted metabolomics.

Instead of binary exact matching, this tool evaluates molecular equivalence across six progressive normalization layers, returning a structured equivalence profile that reflects the structural resolution actually supported by the experimental evidence. For lipids, a dedicated four-level hierarchy (Levels A–D) addresses cis/trans geometry, sn-position, intra-chain double bond position, and global sum composition.

Comparison Layers

Layer Name Description
1 Complete Identity Exact InChI string equality
2 Isotopic Independence Equality after /i layer removal
3 Salt Independence Equality after counterion removal
4 Charge Independence Equality after charge/protonation normalization
5 Stereochemical/Isomeric Independence Levels A–D (all molecules / lipids only)
6 Tautomeric Independence Equality after canonical tautomer generation

Installation

RDKit must be installed via conda:

git clone https://github.com/alejandraoshea/identity-levels-inchi.git
cd identity-levels-inchi
conda env create -f conda_env.yml
conda activate inchi-identity
pip install -e .

Verify:

inchi --help

InChI Trust (optional, for Layer 6)

Download from https://www.inchi-trust.org/downloads/ then set the path:

export INCHITRUST_PATH=/path/to/inchi-1

If not available, Layer 6 falls back to RDKit's TautomerEnumerator automatically.


CLI Usage

Compare two structures across all layers

inchi compare-pair "<inchi_1>" "<inchi_2>"

Compare with selected layers only

inchi compare-pair-layers "<inchi_1>" "<inchi_2>" --layers isotope salt charge

File-based comparison

Pairwise

inchi compare file1.txt file2.txt

Cross-comparison (all vs all)

inchi compare file1.txt file2.txt --mode cross

Only show equivalent pairs

inchi compare file1.txt file2.txt --only-equal
inchi compare file1.txt file2.txt --mode cross --only-equal

MGF spectral library unification

inchi compare-mgf file1.mgf file2.mgf \
    --layer CHARGES_INDEPENDENCE \
    --output-mgf unified.mgf \
    --output-log unified_log.json

Available layers: COMPLETE_IDENTITY, ISOTOPIC_INDEPENDENCE, SALTS_INDEPENDENCE, CHARGES_INDEPENDENCE, DOUBLE_BONDS_INDEPENDENCE, STEREOCHEMICAL_CIS_TRANS_INDEPENDENCE, TAUTOMER_INDEPENDENCE


Example output

{
    "inchi_1": "InChI=1S/C5H11NO2/c1-6(2,3)4-5(7)8/h4H2,1-3H3/p+1",
    "inchi_2": "InChI=1S/C18H34O2/...",
    "results": {
        "COMPLETE_IDENTITY": false,
        "ISOTOPIC_INDEPENDENCE": false,
        "SALTS_INDEPENDENCE": false,
        "CHARGES_INDEPENDENCE": false,
        "DOUBLE_BONDS_INDEPENDENCE": false,
        "STEREOCHEMICAL_CIS_TRANS_INDEPENDENCE": false,
        "TAUTOMER_INDEPENDENCE": false
    }
}

Related repositories


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

inchi_identity-0.1.0.tar.gz (66.1 kB view details)

Uploaded Source

Built Distribution

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

inchi_identity-0.1.0-py3-none-any.whl (32.6 kB view details)

Uploaded Python 3

File details

Details for the file inchi_identity-0.1.0.tar.gz.

File metadata

  • Download URL: inchi_identity-0.1.0.tar.gz
  • Upload date:
  • Size: 66.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for inchi_identity-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1c2c5ea189c67e07992f0cfde36c46493a2be69f3d3c1fd92b068810c367faef
MD5 297944655b0841b624bcc44020c59762
BLAKE2b-256 c5be3bc1c1107efd27fef0fb0ebe117273ea7a807190f63a27ff56e1d3322ca0

See more details on using hashes here.

File details

Details for the file inchi_identity-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: inchi_identity-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for inchi_identity-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17efe17ba04b2d9f8c6690ce16f5f7f9298ec502d6485c12dd1e2bd5eb2ba206
MD5 1bfd945911cc96782c736ffd86089cb6
BLAKE2b-256 d29cb0a3434255e1cf3a9011a892d45d9b110dd5476daf48e7c2f040c124dc04

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