I am looking at the latest INCHI-1 software which supports molecules with 32 thousand atoms. I work with macro-molecules and want to use that to generate humongous InChIs. I've never used that INCHI-1 software before. I thought I could just throw in some SMILES and get InChI but I learned now that it only accepts MOLFILEs. I find this strange as the atom coordinates shouldn't matter when generating an InChI. I am inclined to write myself a SMILES to MOLFILE converter which just leaves the atom positions at zero, but then, I come to the problem of MOLFILE v2000 having a 999 atom limit. What is the simplest way to get atoms and bonds of 32 thousand atoms into the INCHI-1 system? Can I load an incorrect INCHI perhaps? Like I could just convert SMILES to a non-canonical INCHI. What is the way?
UPDATE: I have started trying this out. I generated a MOLFILE with all 0.0000 atom positions and INCHI-1 would correctly reproduce the atom and connection layers. My data source is actually my own InChI parser which generates an atom list and a link structure.
The problem with this approach is two-fold
- How do I reproduce the bond degree in the MOLFILE when all I have is atom symbol, connections, and hydrogenization from the InChI?
- The MOLFILE format just cannot put more than 999 atoms in because of the fixed column format having only 3 places for the atom numbers in the bond line.
If my input was SMILES I would have the bond degree at least. But the 999 atom limit of the MOLFILE seems hard.
I wonder if I should use the AuxInfo format as input? And when I tried doing that with all but the coordination "layer" of this AuxInfo format I get the error
Error 40 (no InChI; Missing atom coordinates data) inp structure #1.
Finally, I did find that there is an InChI2InChI mode and I tried that with a non-canonical connection path:
Starting with the canonical test InChI:
InChI=1S/C6H12N2O4S2/c7-3(5(9)10)1-13-14-2-4(8)6(11)12/h3-4H,1-2,7-8H2,(H,9,10)(H,11,12)
I walked the connections backwards:
InChI=1S/C6H12N2O4S2/c12-6(11)4(8)2-14-13-1-3(5(9)10)7/h3-4H,1-2,7-8H2,(H,9,10)(H,11,12)
and that created the same result as the canonical starting version (which I show directly below the output)
InChI=1S/C6H12N2O4S2/c7-3(5(9)10)1-13-14-2-4(8)6(11)12/h3-4H,1-2,7-8H2,(H,9,10)(H,11,12)
InChI=1S/C6H12N2O4S2/c7-3(5(9)10)1-13-14-2-4(8)6(11)12/h3-4H,1-2,7-8H2,(H,9,10)(H,11,12)
so this is good, I might just generate a mega-pseudo-InChI instead of a MOLFILE and use that as the input format.
Now I do another test to see if the stereo layer(s) are invariant given my backwards walk of the connections, after all, in SMILES your walking direction matters for stereo. In the following I put (1) original, (2) inverted connection table, (3) output, and (4) again original to check against the output all in one block:
InChI=1S/C6H12N2O4S2/c7-3(5(9)10)1-13-14-2-4(8)6(11)12/h3-4H,1-2,7-8H2,(H,9,10)(H,11,12)/t3-,4-/m0/s1
InChI=1S/C6H12N2O4S2/c12-6(11)4(8)2-14-13-1-3(5(9)10)7/h3-4H,1-2,7-8H2,(H,9,10)(H,11,12)/t3-,4-/m0/s1
InChI=1S/C6H12N2O4S2/c7-3(5(9)10)1-13-14-2-4(8)6(11)12/h3-4H,1-2,7-8H2,(H,9,10)(H,11,12)/t3-,4-/m0/s1
InChI=1S/C6H12N2O4S2/c7-3(5(9)10)1-13-14-2-4(8)6(11)12/h3-4H,1-2,7-8H2,(H,9,10)(H,11,12)/t3-,4-/m0/s1
and lo and behold, the stereo information is conserved. This is good.
So I might be answering my own question here, but would like the authoritative answer:
- MOLFILE v2000 has a 999 atom limit, syntactically there is no way to create larger MOLFILEs for input into INCHI-1
- the InChI2InChI mode can be used with non-canonical connection layer and it will be canonicalized. This would be the way to deal with humongous molecules.
UPDATE:
Some people were asking to see an InChI that goes toward the 32 thousand atom length. I had shown here (in a previous edit) a freshly from my InChI peptide chain condensation algorithm on the human insulin B-chain, the INCHI-1 software would take it and return another InChI which seemed to have been re-routed and normalized, but it was incorrect! There is a problem with INCHI-1 in the /InChI2InChI mode, I ran as:
inchi-1 /InChI2InChI /STDIO`:
InChI version 1, Software v. 1.06 (inchi-1 executable)
Windows 64-bit Build (MS VS 2015) of Dec 18 2020 20:44:49
[MORE UPDATE]I thought I had found out that I cannot feed it molecules with more than 1024 atoms in that mode. If I do I get a "syntax error". But that was an error on my part. There is even a flag /LargeMolecules
but even with 1400 atoms now I do not trigger any syntax errors any more.[/UPDATE]
But it gets worse!
I found the INCHI-1 software does not properly re-organize incorrect InChIs. This is quite disturbing. I make a long story short (details deleted from earlier edits to this post), even if I get all the hydrogenation right, subtly and correctly sharing the remaining H in the peptide bond between the -C(=O) and the -NC(R)-, as shown in line 1 below, still INCHI-1 does not re-route the connection path correctly and gives me line 2 below while it should be line 3!
1 InChI=1S/C5H10N2O3/c1(6)2(8)7-4(3)5(9)10/h4H,1,6H2,3H3,(H,7,8)(H,9,10)
2 InChI=1S/C5H10N2O3/c3-4(5(9)10)7-2(8)1-6/h4H,1,6H2,3H3,(H,7,8)(H,9,10)
3 InChI=1S/C5H10N2O3/c1-3(5(9)10)7-4(8)2-6/h3H,2,6H2,1H3,(H,7,8)(H,9,10)
So I'm back to square-1, meaning, I cannot use the INCHI-1 software feeding it any non-MOLFILE input hoping to get out a correctly normalized InChI connection layer, even if I have all the hydrogenation exactly correct.
So, my question remains: how can I use the INCHI-1 software with > 999 atoms getting it to produce a correct InChI?
I know there is this API, but it too wants atom positions. I do not have atom positions.