I am wondering why there is the following inconsistency in InChI:

  • penicillin G vs. penicillin G potassium salt uses the /p layer to drop a proton
  • but chloramine-T vs. tosylchloramide drops an H from the formula instead

Here is penicillin G vs. penicillin G potassium salt

penicillin G potassium salt

Here are their two InChI's aligned:

InChI=1S/C16H18N2O4S  /c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9 /h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22)          /t11-,12+,14-/m1/s1

they are nicely aligned in the formula and /c and /h layers. The only difference to construct the salt is the /q;+1 ionizing the potassium and the /p-1 removing a proton from the total, thus balancing the charges.

Now chloramine-T vs. tosylchloramide should do it the same way.


but it doesn't. I show first (1) what its InChI actually is, then the InChI of the tosylchloramide base, and finally what the chloramine-T InChI should be in my (unlearned) opinion:

see here    v                                                     vv            vvvvvvvv
InChI=1S/C7H7ClNO2S.Na.3H2O/c1-6-2-4-7(5-3-6)12(10,11)9-8;;;;/h2-5  H,1H3;;3*1H2/q-1;+1;;;
InChI=1S/C7H8ClNO2S        /c1-6-2-4-7(5-3-6)12(10,11)9-8    /h2-5,9H,1H3
InChI=1S/C7H8ClNO2S.Na.3H2O/c1-6-2-4-7(5-3-6)12(10,11)9-8;;;;/h2-5,9H,1H3;;3*1H2/q  ;+1;;;/p-1
see here    ^                                                     ^^--------------^^------^^^^

never mind the trihydrate, just focus on the formula, why is in the penecillin G case the proton removed with a /p-1 while in the chloramine-T case it is removed from the formula and the /h layer, then the electron moved from K to the base with /q-1;+1?

Since no answer came yet, I wonder what's different between the two. O vs. N. O tending to give off a proton, and N tending to capture one. Is it this? Still I think it's sad that InChI cares about the difference, it's always nicer if you can actually perform transformation operations on the InChI, separating the moieties and after adjusting the /q and figuring out to which moiety the /p difference belongs, generate the two InChIs for the two moieties separately. Alas, it doesn't work that way.

And if you answer this question, could you also say why the /p layer is so unspecific? Why doesn't it say from where the proton is dropped exactly? If you have multiple moieties here wouldn't it be clearer if the /p layer was like the /q layers, a list of additions and subtractions for each moiety?

  • 1
    $\begingroup$ I guess in the latter, this can be regarded as a potentially mobile proton. I also guess that the amide functional group is programatically treated quite differently than the sulfonamide functional group. The technical documentation might clear that up; otherwise the mailing list might be a good starting point for asking these questions. Obviously there is the documented source code. The charge layer (/q,/p) is intentionally vague to capture (e.g.) tautomers/any protonation state. If needed, a fixed hydrogen layer may be added to clarify if a specific structure is meant. $\endgroup$ Nov 4, 2021 at 23:38
  • $\begingroup$ For penicillin G, potassium salt: what is the particular reason for you that the carboxylic acid kept its proton, while the imidic acid (conceptually like keto-enol tautomerism to the amide, possibly to a small extent only) did not? Is the imidic acid this much stronger by pKa? $\endgroup$
    – Buttonwood
    Nov 6, 2021 at 18:36

1 Answer 1


This is an extended comment to support Martin's comment by illustration, i.e. to generate InChI with a fixed H layer is going to account for the differences about peripheral hydrogens in question. By this, you leave the sub set of standard InChI which may affect subsequent processing of the strings in other programs. Reading InChI trust's FAQ e.g., about tautomers (e.g. «The Fixed-H layer is useful if you wish to represent a particular tautomer of a given structure.», section 6.2) may help; there are some details (e.g., «It is not possible to use InChI syntax to compare molecules with different but similar connection tables.», section 12.5) to be aware when using InChI.

In the second part of your question, the structure drawing and the InChI written do not match each other; the presence/absence of the sodium cation and water molecules influences the generation of the InChI in question (and subsequent InChIKey) and the two are discernible by standard InChI/InChIKey.

Regarding the case of penicilline, I departed from a set of eight canonical SMILES


which cover neuter, anionic, and forms of a potassium salt. To share the same page, here a visual survey of them by OpenBabel:

obabel -ismi penicillin_G_can.smi -osvg -O test.svg -xl --addinindex

enter image description here

Subsequently, a .sdf was written

obabel penicillin_G_can.smi -O penicillin_G_can.sdf -h --gen3d

With InChI trust's reference binaries (version 1.06, December 2020, repository), this container file was processed once to generate standard InChI/InChIKey, and once InChI/InChIKey considering a fixed H layer as a tabulator separated list:

./inchi-1 -tabbed -AuxNone -Key penicillin_G_can.sdf  # standard assignment
./inchi-1 -tabbed -AuxNone -Key -FixedH penicillin_G_can.sdf  # non-standard

In the standard form, there indeed is pairwise match of the strings for entries (1, 4), (2, 5), and (3, 6):

Structure: 1    InChI=1S/C16H18N2O4S/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22)/t11-,12+,14-/m1/s1    InChIKey=JGSARLDLIJGVTE-MBNYWOFBSA-N
Structure: 2    InChI=1S/C16H18N2O4S/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22)/p-1/t11-,12+,14-/m1/s1    InChIKey=JGSARLDLIJGVTE-MBNYWOFBSA-M
Structure: 3    InChI=1S/C16H18N2O4S.K/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9;/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22);/q;+1/p-1/t11-,12+,14-;/m1./s1 InChIKey=IYNDLOXRXUOGIU-LQDWTQKMSA-M
Structure: 4    InChI=1S/C16H18N2O4S/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22)/t11-,12+,14-/m1/s1    InChIKey=JGSARLDLIJGVTE-MBNYWOFBSA-N
Structure: 5    InChI=1S/C16H18N2O4S/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22)/p-1/t11-,12+,14-/m1/s1    InChIKey=JGSARLDLIJGVTE-MBNYWOFBSA-M
Structure: 6    InChI=1S/C16H18N2O4S.K/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9;/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22);/q;+1/p-1/t11-,12+,14-;/m1./s1 InChIKey=IYNDLOXRXUOGIU-LQDWTQKMSA-M
Structure: 7    InChI=1S/C16H18N2O4S/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22)/p-2/t11-,12+,14-/m1/s1    InChIKey=JGSARLDLIJGVTE-MBNYWOFBSA-L
Structure: 8    InChI=1S/C16H18N2O4S.2K/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9;;/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22);;/q;2*+1/p-2/t11-,12+,14-;;/m1../s1  InChIKey=PEPWXSJDCDQNTL-UDPGNSCCSA-L

If the optional fixed H layer is used, each member of this set is assigned a unique string:

Structure: 1    InChI=1/C16H18N2O4S/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22)/t11-,12+,14-/m1/s1/f/h17,21H   InChIKey=JGSARLDLIJGVTE-JGBPDRTNNA-N
Structure: 2    InChI=1/C16H18N2O4S/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22)/p-1/t11-,12+,14-/m1/s1/fC16H17N2O4S/h17H/q-1   InChIKey=JGSARLDLIJGVTE-JSKXZDGENA-M
Structure: 3    InChI=1/C16H18N2O4S.K/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9;/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22);/q;+1/p-1/t11-,12+,14-;/m1./s1/fC16H17N2O4S.K/h17H;/q-1;m   InChIKey=IYNDLOXRXUOGIU-UBIYMBTGNA-M
Structure: 4    InChI=1/C16H18N2O4S/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22)/t11-,12+,14-/m1/s1/f/h19,21H/b17-10-   InChIKey=JGSARLDLIJGVTE-SCGMZQNYNA-N
Structure: 5    InChI=1/C16H18N2O4S/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22)/p-1/t11-,12+,14-/m1/s1/fC16H17N2O4S/h21H/q-1/b17-10-   InChIKey=JGSARLDLIJGVTE-HOPLNNLJNA-M
Structure: 6    InChI=1/C16H18N2O4S.K/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9;/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22);/q;+1/p-1/t11-,12+,14-;/m1./s1/fC16H17N2O4S.K/h21H;/q-1;m/b17-10-;  InChIKey=IYNDLOXRXUOGIU-XNDLOSBFNA-M
Structure: 7    InChI=1/C16H18N2O4S/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22)/p-2/t11-,12+,14-/m1/s1/fC16H16N2O4S/q-2/b17-10-    InChIKey=JGSARLDLIJGVTE-JRFSBVOJNA-L
Structure: 8    InChI=1/C16H18N2O4S.2K/c1-16(2)12(15(21)22)18-13(20)11(14(18)23-16)17-10(19)8-9-6-4-3-5-7-9;;/h3-7,11-12,14H,8H2,1-2H3,(H,17,19)(H,21,22);;/q;2*+1/p-2/t11-,12+,14-;;/m1../s1/fC16H16N2O4S.2K/q-2;2m/b17-10-;;  InChIKey=PEPWXSJDCDQNTL-KBRAHMAKNA-L

In the case of chloramine, a discern of the two entries already is possible with standard InChI/InChIKey. With canonical SMILES by OpenBabel


enter image description here

processing as above eventually yields the standard strings

Structure: 1    InChI=1S/C7H8ClNO2S/c1-6-2-4-7(5-3-6)12(10,11)9-8/h2-5,9H,1H3   InChIKey=NXTVQNIVUKXOIL-UHFFFAOYSA-N
Structure: 2    InChI=1S/C7H7ClNO2S.Na/c1-6-2-4-7(5-3-6)12(10,11)9-8;/h2-5H,1H3;/q-1;+1 InChIKey=VDQQXEISLMTGAB-UHFFFAOYSA-N
  • $\begingroup$ Will have to digest that more. Seems to me that your answer states what is, but not sure somewhere in there is the answer for why this is? Clearly we can use fixed layer to nail them down. But I never doubted that. I wanted to know why the amino group's N-H gets to be treated differently in the formula, while the penicillin's O-H gets to have a /p dropped. I didn't see the answer to that. I think an answer expanding on Martin's comment should address this "I also guess that the amide functional group is programatically treated quite differently than the sulfonamide functional group." $\endgroup$ Nov 12, 2021 at 15:15
  • $\begingroup$ By the way I am told "This bounty has ended. Answers that other users post to this question are eligible for a +50 reputation bounty. You have 4 hours to award this bounty to an eligible answer." -- but what if the only offered answer does not actually contain the answer to the question? (Not trying to be dismissive or combative, I just don't understand this pressure of the 4 hours.) $\endgroup$ Nov 12, 2021 at 15:18
  • $\begingroup$ So is it about the two chemicals in the neuter form instead of e.g., the potassium salt of penicillin? Like in a comparison of acetic acid (InChI=1S/C2H4O2/c1-2(3)4/h1H3,(H,3,4)) vs. e.g., DMF (InChI=1S/C3H7NO/c1-4(2)3-5/h3H,1-2H3) vs. e.g. methanesulfonamide (InChI=1S/CH5NO2S/c1-5(2,3)4/h1H3,(H2,2,3,4))? And it wasn't for the 50 pts («This is an extended comment to support Martin's comment»), indeed hoping a second/third/additional perspective would be put forward, but to understand the InChI better. Just too long for a comment. $\endgroup$
    – Buttonwood
    Nov 12, 2021 at 18:21
  • $\begingroup$ I don't know what "neuter form" means, I mean, the base with proton removed, of course I don't care about the counter-ion, Na+, K+, Ca++ whatever, I care about the base. In one case a /p-1 is used, in the other case the formula loses an H and a /q-1 is added. I want to know why that is done so differently in InChI, because frankly, it's annoying, but also, perhaps it can give more ideas about the difference of treating O vs. N. $\endgroup$ Nov 12, 2021 at 20:35
  • $\begingroup$ From inchi-trust.org/technical-faq-2: section 10.1: «For most compounds the /q layer uses a positive or negative integer to represent the actual charge on the species; the formula represents the correct composition.» And later (10.2): «What does the /p layer mean? This is the number of protons that must be added to or removed from the formula to give the input composition.» And 4.1: «each layer holds a distinct and separable class of structural information, with the layers ordered to provide successive structural refinement.» Though related, a mutually independent assignment. $\endgroup$
    – Buttonwood
    Nov 15, 2021 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.