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
- inchi-identity-api — Flask REST backend
- inchi-identity-app — Web frontend
#\x00 \x00i\x00n\x00c\x00h\x00i\x00-\x00i\x00d\x00e\x00n\x00t\x00i\x00t\x00y\x00-\x00a\x00p\x00p\x00 \x00 \x00
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inchi_identity-0.2.0.tar.gz.
File metadata
- Download URL: inchi_identity-0.2.0.tar.gz
- Upload date:
- Size: 68.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8c6f548815cb202cddc8ab4cdc8a9d807ff5572adb473263e59ca2e2a2c5ed6
|
|
| MD5 |
a4886bbc473cc20866412b967a4d9fbc
|
|
| BLAKE2b-256 |
d13b2f3d820ef6531a17d637845bee485d73fde61173090a0fb52c9e04e03e0b
|
File details
Details for the file inchi_identity-0.2.0-py3-none-any.whl.
File metadata
- Download URL: inchi_identity-0.2.0-py3-none-any.whl
- Upload date:
- Size: 33.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1646f6e4e70873d0d7927c26e315f7c0e4ba2e2519c8468425ef79c9e7455719
|
|
| MD5 |
df2b6ea8eba8bd06ad0a5c61f0c9bc8a
|
|
| BLAKE2b-256 |
ed97780ac2358f4bd1ed88651383d9258fbbd79afc5612943891379cb6d371c9
|