InChI
 
Loading...
Searching...
No Matches
ichirvrs.h
Go to the documentation of this file.
1/*
2 * International Chemical Identifier (InChI)
3 * Version 1
4 * Software version 1.07
5 * April 30, 2024
6 *
7 * MIT License
8 *
9 * Copyright (c) 2024 IUPAC and InChI Trust
10 *
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
17 *
18 * The above copyright notice and this permission notice shall be included in all
19 * copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 * SOFTWARE.
28*
29* The InChI library and programs are free software developed under the
30 * auspices of the International Union of Pure and Applied Chemistry (IUPAC).
31 * Originally developed at NIST.
32 * Modifications and additions by IUPAC and the InChI Trust.
33 * Some portions of code were developed/changed by external contributors
34 * (either contractor or volunteer) which are listed in the file
35 * 'External-contributors' included in this distribution.
36 *
37 * info@inchi-trust.org
38 *
39*/
40
41
42#ifndef _ICHIRVRS_H_
43#define _ICHIRVRS_H_
44
45#include "ichimain.h"
46#include "ichiring.h"
47
48#define ICHICONST const
49
50#define RI_ERR_ALLOC (-1)
51#define RI_ERR_SYNTAX (-2)
52#define RI_ERR_PROGR (-3)
53#define RI_ERR_EOL (-4)
54#define RI_ERR_EOF (0)
55
56#define RI_ERR_MISMATCH (-9)
57
58#define NO_VALUE_INT 9999
59#define NOT_READ_INT 9998 /* has not been read yet */
60
61#define VALUE_OCTET 8 /* number of electrons in a full shell */
62
63#define INC_EDGE_LIST_DEFAULT 64
64
65typedef struct tagXYZCoord {
66 double xyz[3];
68
69typedef struct tagStructRestoreMode {
70 int bMetalAddFlower; /* 1 => allow adjustable metal valence and charge; 0=> use std charge/valence */
71 /* the following three apply only if bMetalAddFlower = 1 */
72 int nMetalMinBondOrder; /* edge_flow=f means bond order=cMetalMinBondOrder+f */
73 int nMetalInitEdgeFlow; /* one bond contribution to metal's (st-cap - st-flow) = */
74 /* (nMetalInitBondOrder-nMetalMinBondOrder) - nMetalInitEdgeFlow */
75 int nMetalInitBondOrder; /* >= nMetalMinBondOrder + nMetalInitEdgeFlow */
76 /* same for metal-endpoint bonds */
80 int nMetalFlowerParam_D; /* additional edge capacity for canceling radicals */
81 int nMetalMaxCharge_D; /* cap and/or flow for metal charge group */
82 int bStereoRemovesMetalFlag; /* 1=> treat stereogenic atoms and atoms connected by a stereo bond as non-metals */
83
84 int bFixStereoBonds; /* 1=> forbid stereogenic double bonds from changing */
86
93
94/**************************************/
95#define BFS_Q_CLEAR (-1)
96#define BFS_Q_FREE (-2)
97typedef struct tagBfsQueue {
102 AT_RANK min_ring_size; /* 8 => detect 7-member and smaller rings */
104/**************************************/
105
106#define EXTRACT_STRUCT_NUMBER 1
107
108/* additional Mobile-H parities to be added to Fixed-H parities */
109/* This allows to set parities that exist in Mobile-H layer only */
110typedef struct tagInpAtomAddParities {
111 /* cml 0D parities */
112 S_CHAR bUsed0DParity; /* bit=1 => stereobond; bit=2 => stereocenter */
113 /* cml tetrahedral parity */
116 /* cml bond parities */
117 S_CHAR sb_ord[MAX_NUM_STEREO_BONDS]; /* stereo bond/neighbor ordering number, starts from 0 */
118 /* neighbors on both sides of stereobond have same sign=> trans/T/E, diff. signs => cis/C/Z */
119 S_CHAR sn_ord[MAX_NUM_STEREO_BONDS]; /* ord. num. of the neighbor adjacent to the SB; starts from 0;
120 -1 means removed explicit H */
121 /* neighbors on both sides of stereobond have same parity => trans/T/E/2, diff. parities => cis/C/Z/1 */
123 AT_NUMB sn_orig_at_num[MAX_NUM_STEREO_BONDS]; /* orig. at number of sn_ord[] neighbors */
125
126#define FIX_STEREO_BOND_ORDER 0 /* 1=> fix stereobonds; treat metal as non-metal if it is stereogenic or has a stereobond */
127
128#define METAL_FREE_CHARGE_VAL 1 /* 1=> allow free changing charges/valences of metals; initial bond order=0 or 1 */
129#define ALLOW_METAL_BOND_ZERO 1 /* 1=> allow zero flow (bobd order) to metals */
130
131#if ( ALLOW_METAL_BOND_ZERO == 1 )
132/* INIT_METAL_BOND_ZERO=1 => INIT_METAL_BOND_FLOW=0 */
133#define INIT_METAL_BOND_ZERO 0 /* 1=> initialize zero order bond to metals */
134#define INIT_METAL_BOND_FLOW 1 /* 1=> init flow=1, 0 => init. flow = 0 */
135#else
136#define INIT_METAL_BOND_ZERO 0
137#define INIT_METAL_BOND_FLOW 0 /* always 0 */
138#endif
139
140#define I2A_FLAG_FIXEDH 0x0001
141#define I2A_FLAG_RECMET 0x0002
142
143
144#define ATYPE_H 1
145#define ATYPE_Na 2
146#define ATYPE_Mg 3
147#define ATYPE_B 4
148#define ATYPE_C 5
149#define ATYPE_N 6
150#define ATYPE_O 7
151#define ATYPE_Cl 8
152
153
154/* first bonds valence for charge = c is cValence[0][c+VAL_BASE]; VAL_MIN_CHARGE <= c <= VAL_MAX_CHARGE */
155/* second bonds valence for charge = c is cValence[1][c+VAL_BASE]; VAL_MIN_CHARGE <= c <= VAL_MAX_CHARGE */
156/* total number of valences is 2 = VAL_NUMBER */
157/* neutral bond valence orders are cValence[0][VAL_NEUTR_ORDER], cValence[1][VAL_NEUTR_ORDER] */
158#define VAL_BASE ( 1)
159#define VAL_MIN_CHARGE (-1)
160#define VAL_MAX_CHARGE ( 1)
161#define VAL_NUMBER ( 2)
162#define VAL_NEUTR_ORDER (VAL_MAX_CHARGE-VAL_MIN_CHARGE+1)
163#define VAL_LENGTH (VAL_NEUTR_ORDER+1)
164#define VAL_NEGAT_CHARGE 0
165#define VAL_NEUTR_CHARGE 1
166#define VAL_POSIT_CHARGE 2
167
168typedef struct tagAtomIonPrperies {
169 /* char cValence[VAL_NUMBER][VAL_LENGTH]; */ /* ordering numbers of minimal valence, 0-based */
170 char cDoNotAddH; /* InChI does not add H to this element */
171 char cMetal; /* the element is a metal */
172 char cNumBondsToMetal; /* number of bonds to metal */
173 char cInitFlowToMetal; /* sum of init flow to metal atoms */
174 char cInitValenceToMetal; /* sum of init adjusted bond orders to metal atoms */
175 char cInitOrigValenceToMetal; /* sum of init bond orders to metal atoms */
176 char cMaxFlowToMetal; /* max total edge flow to metal atoms */
177 char cInitFreeValences; /* number of 'dots' to connect; charges are marked separately */
178 S_CHAR cInitCharge; /* initial charge on the atom (not included in ChargeStruct */
181 char cMinRingSize; /* min ring size for atoms that have 2 bonds only */
182 U_CHAR cPeriodicNumber; /* number in Periodic Table of elements */
183 S_CHAR cnListIndex; /* (index in the cnList) + 1; 0 => none */
184 int nCMinusGroupEdge; /* (index of the edge to the atom's (-) group) + 1 */
185 int nCPlusGroupEdge; /* (index of the edge to the atom's (+) group) + 1 */
186 int nMetalGroupEdge; /* index of the edge to the atom's M-group + 1 */
187 int nTautGroupEdge; /* index of the edge from the atom to the t-group + 1 */
189
190
191/****************************************************************************/
192#define INI_NUM_TCGROUPS 16
193#define INC_NUM_TCGROUPS 16
194
198typedef struct tagTCGroup {
199 int type; /* group type */
200 int ord_num; /* ordering number within the type, typically t-group number */
202 /* charge group specific */
207 int nVertexNumber; /* group vertex number; 0 = unassigned */
208 int nForwardEdge; /* edge index: from c-group to central Y-connecting vertex
209 or from supergroup to (+/-) vertex; 0 => unassigned */
210 int nBackwardEdge; /* edge index: from central Y-connecting vertex
211 to supergroup; 0 => unassigned */
212 /* tautomeric group specific */
213 short tg_num_H; /* number of H in a tautomeric group */
214 short tg_num_Minus; /* negative charge on t-group */
215 Vertex tg_set_Minus; /* the vertex+1 that has to have (-) */
216 short tg_RestoreFlags; /* Set (-) to first memberst of a t-group (usually, N) */
218
219typedef enum tagTCGroupTypes {
220 TCG_None = -1, /* so far only ord=0 is used */
221 /* group type ord */
222 TCG_Plus0 = 0, /* BNS_VT_C_POS 0 */
223 TCG_Plus1, /* BNS_VT_C_POS 1 */
224 TCG_Minus0, /* BNS_VT_C_NEG 0 */
225 TCG_Minus1, /* BNS_VT_C_NEG 1 */
226 TCG_Plus_C0, /* BNS_VT_C_POS_C 0 */
227 TCG_Plus_C1, /* BNS_VT_C_POS_C 1 */
228 TCG_Minus_C0, /* BNS_VT_C_NEG_C 0 */
229 TCG_Minus_C1, /* BNS_VT_C_NEG_C 1 */
230 TCG_Plus_M0, /* BNS_VT_C_POS_M 0 */
231 TCG_Plus_M1, /* BNS_VT_C_POS_M 1 */
232 TCG_Minus_M0, /* BNS_VT_C_NEG_M 0 */
233 TCG_Minus_M1, /* BNS_VT_C_NEG_M 1 */
234 TCG_MeFlower0, /* BNS_VT_M_GROUP 0 */ /* base */
235 TCG_MeFlower1, /* BNS_VT_M_GROUP 1 */
236 TCG_MeFlower2, /* BNS_VT_M_GROUP 2 */
237 TCG_MeFlower3, /* BNS_VT_M_GROUP 3 */
238
239 TCG_Plus, /* BNS_VT_C_POS_ALL 0 */
240 TCG_Minus, /* BNS_VT_C_NEG_ALL 0 */
241
242 NUM_TCGROUP_TYPES /* number of group types */
244
245typedef struct tagAllTCGroups {
247 int num_tc_groups; /* number of charge groups and metal-flower vertices */
248 int max_tc_groups; /* number of allocated of pTCG[] elements */
249 int nGroup[NUM_TCGROUP_TYPES]; /* tagTCGroupTypes */
250 int nVertices; /* total number of vertices */
251 int nEdges; /* total number of edges */
252 int nAddIedges; /* additional increase of number of iedges for edge switching to another group */
253 int num_atoms; /* number of atoms */
254 int num_bonds; /* number of bonds */
255 int num_tgroups; /* number t-groups */
256 int num_tgroup_edges; /* number of edges to t-groups */
257 /* charges */
258 int tgroup_charge; /* total charge of all t-groups */
259 int charge_on_atoms; /* charge permanently sitting on atoms */
260 int added_charge; /* charge added to the c-groups */
261 int total_charge; /* total charge of the component */
262 int total_electrons; /* total number of electrons on all atoms */
263 int total_electrons_metals; /* total number of electrons on unbonded metals */
264
265 int num_metal_atoms; /* number of metal atoms */
266 int num_metal_bonds; /* number of atom-metal bonds */
267 /* excess_charge = total_charge - added_charge - tgroup_charge: add to metals etc. */
268
269 int nEdge4charge; /* edge used to add charges; neighbor1=supercharge, another = (+/-) vertex */
270 int nEdgePlus; /* edge to (+) supergroup; 0 means none */
271 int nEdgeMinus; /* edge to (-) supergroup; 0 means none */
272 int iComponent; /* component number */
273 int iAtNoOffset; /* first atom number -- always 0 for now */
275
276/**************************************/
277#define EDGE_LIST_CLEAR (-1)
278#define EDGE_LIST_FREE (-2)
279
285/**************************************/
286
287#define BOND_MARK_STEREO 0x10
288#define BOND_TYPE_STEREO (BOND_TYPE_SINGLE | BOND_MARK_STEREO)
289
290/* local */
291#define RESET_EDGE_FORBIDDEN_MASK 0
292
293#define TREAT_ATOM_AS_METAL 99
294
295
296/************************************************************************************/
302
303#define MY_CONST const
304/*************************************************************************************/
316
319 NUM_H nNumRemovedIsotopicH[NUM_H_ISOTOPES]; /* isotopic H that may be exchanged and considered
320 randomly distributed, including removed protons */
322
324 /* totals for Mobile-H layer */
326 NUM_H nNumRemovedIsotopicH[NUM_H_ISOTOPES]; /* isotopic H that may be exchanged and considered
327 randomly distributed, including removed protons */
328 /* for individual components from comparing Fixed-H vs Mobile-H formulas; NULL if not available */
331
332typedef struct tagInputInChI {
337 /* s[0=non-iso, 1=iso] = 0,1,2,3 <= regular /s; -1=> "/s" (empty) */
339 inp_ATOM *atom; /* the whole restored structure made out of all components */
340 int num_atoms; /* number of atoms including explicit H */
341 int num_explicit_H; /* number of explicit H in the atom */
343 /* v. 1.05 extensions */
348
349typedef struct tagStructFromInChI {
350 /* InChI component -> Structure result */
351 inp_ATOM *at; /* length = num_atoms + num_deleted_H, zero pint struct for BNS->struct conversion */
352 inp_ATOM_STEREO *st; /* additional stereo that exists only in Mobile-H layer */
353 inp_ATOM *at2; /* length = num_atoms + num_deleted_H, the conversion result */
354
355 /* information from InChI only */
356 T_GROUP_INFO ti; /* from original InChI[0] if Mobile-H from the beginning or later from InChI[1] if Fixed-H */
357 AT_NUMB *endpoint; /* from original InChI[1] in case of Fixed-H only */
358 S_CHAR *fixed_H; /* from original InChI[0] in case of Fixed-H only */
361 int num_deleted_H; /* if requested and Fixed-H InChI is available */
362 int nNumRemovedProtonsMobHInChI; /* number of protons removed from Mobile-H struct in original InChI */
365
366 /* InChI -> Structure conversion parms and intermediate data */
370
371 /* InChI layer to reverse */
373 char iINCHI;
374 char bFixedHExists; /* fixed-H InChI exists or not */
375
376 /* InChI -> Struct component -> Full InChI result (both disconnected and connected if exist) */
378 int nRemovedProtonsByNormFromRevrs; /* number of H(+) removed by normalization after
379 Struct Restore and before Add/Remove Protons */
380 int nNumRemovedProtonsByRevrs; /* number of H(+) removed by the reconstruction,
381 before Add/Remove Protons, only from TAUT_YES */
382
383 int bExtract; /* for debugging */
384
385 /* single component InChI calculation */
386 INChI *pOneINChI[TAUT_NUM]; /* InChI of restored structure */
388 INP_ATOM_DATA *pOne_norm_data[TAUT_NUM]; /* normalized restored structure */
389 S_CHAR *pOne_fixed_H; /* !!! from normalized restored structure in case of Fixed-H only */
390 T_GROUP_INFO One_ti; /* t-groups of normalized canonicalized restored structure */
391 int nOneINChI_bMobileH; /* type of restored structure InChI */
392 int nNumRemovedProtons; /* =0 for Fixed-H, = num. removed protons in case of Mobile-H InChI */
393 /* in case of Fixed-H processing see pStruct->One_ti.tni.nNumRemovedProtons */
394 AT_NUMB *nAtno2Canon[TAUT_NUM]; /* nAtno2Canon[restored_at_no][*] = (atom canon number in restored struct)-1*/
395 AT_NUMB *nCanon2Atno[TAUT_NUM]; /* nCanon2Atno[(atom canon number in restored struct)-1][*] = restored_at_no; */
396
398 /* other parms */
399 char iInchiRec; /* index in the original InChI array */
400 char iMobileH; /* index in the original InChI array */
401 char bDeleted; /* InChI component marked as Deleted, means a proton in Mobile-H layer */
402 /* struct. ordering number "Structure: nnn" if present */
404
405 /* utility data */
408
409 int nLink; /* same as in INChI */
410 int bPostProcessed; /* recalculate after add/remove protons */
411
412 /* TAUT_YES layer charges */
413 int nChargeRevrs; /* component charge of the reconstructed structure, TAUT_YES layer */
414 int nChargeInChI; /* component charge from the original InChI, TAUT_YES layer */
415
416 int n_zy;
417 int n_pzz;
419
420
421#define EL_TYPE_O 0x0001
422#define EL_TYPE_S 0x0002
423#define EL_TYPE_N 0x0004
424#define EL_TYPE_P 0x0008
425#define EL_TYPE_C 0x0010
426#define EL_TYPE_X 0x0020 /* any not metal */
427#define EL_TYPE_MASK 0x003f
428#define EL_TYPE_OSt 0x0100 /* terminal -OH, -O(-), -SH, -S(-), ... from fix_special_bonds(...) */
429#define EL_TYPE_PT 0x0200 /* may be a tautomeric endpoint */
430
431/* the atom to which the node is attached has number 1; added atoms have numbers 2,3,... */
432#define MAX_CN_VAL 3
449
450
451#define cn_bits_N 1 /* Neutral: charge = 0 */
452#define cn_bits_P 2 /* Plus 1: charge = +1 */
453#define cn_bits_M 4 /* Minus 1: charge = -1 */
454#define cn_bits_shift 3
455#define MAX_NUM_CN_BITS 4
456#define MAKE_CN_BITS(A, B, C, D ) (( (( ((D) << cn_bits_shift | (C)) << cn_bits_shift ) | (B)) << cn_bits_shift ) | (A))
457
458#define cn_bits_PNPN MAKE_CN_BITS(cn_bits_P, cn_bits_N, cn_bits_P, cn_bits_N)
459#define cn_bits_NPNP MAKE_CN_BITS(cn_bits_N, cn_bits_P, cn_bits_N, cn_bits_P)
460#define cn_bits_NPN MAKE_CN_BITS(cn_bits_N, cn_bits_P, cn_bits_N, 0)
461#define cn_bits_PNP MAKE_CN_BITS(cn_bits_P, cn_bits_N, cn_bits_P, 0)
462#define cn_bits_MNP MAKE_CN_BITS(cn_bits_M, cn_bits_N, cn_bits_P, 0)
463#define cn_bits_PNM MAKE_CN_BITS(cn_bits_P, cn_bits_N, cn_bits_M, 0)
464#define cn_bits_EN MAKE_CN_BITS(cn_bits_P | cn_bits_M, cn_bits_N, 0, 0)
465#define cn_bits_NMN MAKE_CN_BITS(cn_bits_N, cn_bits_M, cn_bits_N, 0)
466#define cn_bits_NE MAKE_CN_BITS(cn_bits_N, cn_bits_P | cn_bits_M, 0, 0)
467#define cn_bits_NEN MAKE_CN_BITS(cn_bits_N, cn_bits_M | cn_bits_N, cn_bits_N, 0)
468#define cn_bits_NP MAKE_CN_BITS(cn_bits_N, cn_bits_P, 0, 0)
469#define cn_bits_PN MAKE_CN_BITS(cn_bits_P, cn_bits_N, 0, 0)
470#define cn_bits_NM MAKE_CN_BITS(cn_bits_N, cn_bits_M, 0, 0)
471#define cn_bits_MN MAKE_CN_BITS(cn_bits_M, cn_bits_N, 0, 0)
472#define cn_bits_P_ MAKE_CN_BITS(cn_bits_P, 0, 0, 0)
473#define cn_bits_M_ MAKE_CN_BITS(cn_bits_M, 0, 0, 0)
474#define cn_bits_N_ MAKE_CN_BITS(cn_bits_N, 0, 0, 0)
475#define cn_bits_Me (-1)
476
477#define cnListIndexMe (17) /* index of {cnMe, cn_bits_Me,... } element of cnList[] */
478
479extern const int cnListNumEl; /* number of elements in cnList[] */
480
487
488extern MY_CONST CN_LIST cnList[];
489
490/************************ fixed H comparison ******************************************************/
491#define MAX_DIFF_FIXH 256
492#define MAX_DIFF_MOBH 256
507
508typedef struct tagStructCmpTwoFixedH {
510 short len_c2at;
517 short nNumTgDiffMinus; /* number of would-be-identical t-groups that have different number of (-) */
518 short nNumTgDiffH; /* number of would-be-identical t-groups that have different number of H */
519 short nNumTgMInChI; /* number of (-) in orig. InChI t-groups */
520 short nNumTgHInChI; /* number of H in orig. InChI t-groups */
521 short nNumTgMRevrs; /* number of (-) in reversed structure t-groups */
522 short nNumTgHRevrs; /* number of H in reversed structure t-groups */
527 S_CHAR nChargeFixHRevrsNonMetal; /* charge does not include charges on metals */
528 S_CHAR nChargeMobHRevrsNonMetal; /* charge does not include charges on metals */
533
534/************************ Mobile H comparison *********************************************/
535typedef struct tagAtomsCmpTwoMobileH {
541 S_CHAR nMobHInChI; /* number of H on the atom in the orig. InChI */
542 S_CHAR nMobHRevrs; /* number of H on the atom in InChI from the reconstructed structure */
543 S_CHAR nNumHRevrs; /* number of H on the atom in the being reconstructed structure */
545 S_CHAR nValue; /* flag(s) */
547
550 short len_c2at;
557 short nNumTgDiffMinus; /* number of would-be-identical t-groups that have different number of (-) */
558 short nNumTgDiffH; /* number of would-be-identical t-groups that have different number of H */
559
560 short nNumTgMInChI; /* number of (-) in orig. InChI t-groups */
561 short nNumTgHInChI; /* number of H in orig. InChI t-groups */
562 short nNumTgOInChI; /* number of tautomeric O,S,Se in orig. InChI t-groups */
563 short nNumTgNInChI; /* number of tautomeric N in orig. InChI t-groups */
564
565 short nNumTgMRevrs; /* number of (-) in reversed structure t-groups */
566 short nNumTgHRevrs; /* number of H in reversed structure t-groups */
567 short nNumTgORevrs; /* number of tautomeric O,S,Se in reversed structure t-groups */
568 short nNumTgNRevrs; /* number of tautomeric N in reversed structure t-groups */
569
570 short nNumTgOMinusRevrs; /* number of -O(-) on endpoints found in restored structure */
571 short nNumTgOHRevrs; /* number of -OH on endpoints found in restored structure */
572 short nNumTgDBORevrs; /* number of =O on endpoints found in restored structure */
573 short nNumTgNMinusRevrs; /* number of -N(-)- on endpoints found in restored structure */
574 short nNumTgNHMinusRevrs; /* number of -NH(-) on endpoints found in restored structure */
575 short nNumTgNHRevrs; /* number of -NH- on endpoints found in restored structure */
576 short nNumTgNH2Revrs; /* number of -NH2 on endpoints found in restored structure */
577 short nNumTgDBNHRevrs; /* number of =NH on endpoints found in restored structure */
578 short nNumTgDBNMinusRevrs; /* number of =N(-) on endpoints found in restored structure */
579 short nNumTgDBNRevrs; /* number of =N- on endpoints found in restored structure */
580
581 short nNumTgOMinusInChI; /* number of -O(-) on endpoints according to original InChI */
582 short nNumTgOHInChI; /* number of -OH on endpoints according to original InChI */
583 short nNumTgDBOInChI; /* number of =O on endpoints according to original InChI */
584 short nNumTgNMinusInChI; /* number of -N(-)- on endpoints according to original InChI */
585 short nNumTgNHMinusInChI; /* number of -NH(-) on endpoints according to original InChI */
586 short nNumTgNHInChI; /* number of -NH- on endpoints according to original InChI */
587 short nNumTgNH2InChI; /* number of -NH2 on endpoints according to original InChI */
588 short nNumTgDBNHInChI; /* number of =NH on endpoints according to original InChI */
589 short nNumTgDBNMinusInChI; /* number of =N(-) on endpoints according to original InChI */
590 short nNumTgDBNInChI; /* number of =N- on endpoints according to original InChI */
591
594 S_CHAR nChargeMobHRevrsNonMetal; /* charge does not include charges on metals; later add ion pairs rejection */
599
600
601#ifndef COMPILE_ALL_CPP
602#ifdef __cplusplus
603extern "C" {
604#endif
605#endif
606
607
608struct tagCANON_GLOBALS;
609struct tagINCHI_CLOCK;
610int OneInChI2Atom( struct tagINCHI_CLOCK *ic,
611 struct tagCANON_GLOBALS *pCG,
613 STRUCT_DATA *sd,
614 const char *szCurHdr,
615 long num_inp,
616 StrFromINChI *pStruct,
617 int iComponent,
618 int iAtNoOffset,
619 int bHasSomeFixedH,
620 INChI *pInChI[] );
621
622int get_sp_element_type( int nPeriodicNumber, int *nRow );
623
624int get_bonds_valences( int nPeriodicNum,
625 int bonds_valence,
626 int num_H,
627 VAL_AT *pVA );
628
629
630/* local prototypes */
632 int jv,
633 int num_at,
634 int *iDeletedH,
635 int *iH,
636 int nNumDeletedH,
637 int bTwoStereo );
639 AT_NUMB i1,
640 AT_NUMB i2,
641 AT_NUMB nCumulene[],
642 int nMaxLen );
643int set_bond_type( inp_ATOM *at,
644 AT_NUMB i1,
645 AT_NUMB i2,
646 int bType );
648 inp_ATOM_STEREO *st,
649 int num_at,
650 int idelH1,
651 int i1,
652 int i2,
653 int idelH2,
654 int parity,
655 int len );
657 inp_ATOM_STEREO *st,
658 int num_at,
659 int num_deleted_H,
660 int i1,
661 int parity );
663 inp_ATOM *at,
664 AT_NUMB *endpoint,
665 INChI *pInChI );
666int FillOutpStructEndpointFromInChI( INChI *pInChI, AT_NUMB **pEndpoint );
667int SetStereoBondTypeFor0DParity( inp_ATOM *at, int i1, int m1 );
668int SetStereoBondTypesFrom0DStereo( StrFromINChI *pStruct, INChI *pInChI );
669void CopyAt2St( inp_ATOM *at, inp_ATOM_STEREO *st, int num_atoms );
670void CopySt2At( inp_ATOM *at, inp_ATOM_STEREO *st, int num_atoms );
672 int iComponent,
673 int iAtNoOffset,
674 INChI *pInChI,
675 INChI *pInChIMobH );
676
677int RestoreAtomMakeBNS( struct tagINCHI_CLOCK *ic,
678 struct tagCANON_GLOBALS *pCG,
680 STRUCT_DATA *sd,
681 StrFromINChI *pStruct,
682 int iComponent,
683 int iAtNoOffset,
684 INChI *pInChI[],
685 const char *szCurHdr,
686 long num_inp,
687 int bHasSomeFixedH );
688
689int nAddSuperCGroups( ALL_TC_GROUPS *pTCGroups );
690
692 StrFromINChI *pStruct,
693 VAL_AT *pVA,
694 ALL_TC_GROUPS *pTCGroups,
695 int nMaxAddEdges );
697 StrFromINChI *pStruct,
698 VAL_AT *pVA,
699 ALL_TC_GROUPS *pTCGroups,
700 int nMaxAddEdges );
702 VAL_AT *pVA,
703 ALL_TC_GROUPS *pTCGroups,
704 int nMaxAddAtoms,
705 int nMaxAddEdges,
706 int max_altp,
707 int *pNum_changed_bonds );
708int nCountBnsSizes( inp_ATOM *at,
709 int num_at,
710 int nAddEdges2eachAtom,
711 int nAddVertices,
712 T_GROUP_INFO *ti,
713 VAL_AT *pVA,
714 ICHICONST SRM *pSrm,
715 ALL_TC_GROUPS *pTCGroups );
716
717int GetAtomRestoreInfo( struct tagCANON_GLOBALS *pCG,
718 inp_ATOM *atom, int iat, VAL_AT *pVArray,
719 ICHICONST SRM *pSrm, int bMobileH, AT_NUMB *endpoint );
720
721int AddEdgeFlow( int edge_cap,
722 int edge_flow,
723 BNS_EDGE *e01,
724 BNS_VERTEX *pv0 /*src*/,
725 BNS_VERTEX *pv1/*dest*/,
726 int *tot_st_cap,
727 int *tot_st_flow );
728
729void SetEdgeCapFlow( BNS_EDGE *e, int edge_cap, int edge_flow );
730
731void AddStCapFlow( BNS_VERTEX *vert_ficpoint,
732 int *tot_st_flow,
733 int *tot_st_cap,
734 int cap,
735 int flow );
736void SetStCapFlow( BNS_VERTEX *vert_ficpoint,
737 int *tot_st_flow,
738 int *tot_st_cap,
739 int cap,
740 int flow );
741
742int ConnectSuperCGroup( int nTCG_Plus,
743 int nAddGroups[],
744 int num_add,
745 int *pcur_num_vertices,
746 int *pcur_num_edges,
747 int *tot_st_cap,
748 int *tot_st_flow,
749 BN_STRUCT *pBNS,
750 ALL_TC_GROUPS *pTCGroups );
752 BNS_VERTEX *p2,
753 BNS_EDGE *e,
754 BN_STRUCT *pBNS,
755 int bClearEdge );
756
757int nTautEndpointEdgeCap( inp_ATOM *at, VAL_AT *pVA, int i );
758
759/*
760int GetAtomBondFlow( inp_ATOM *atom, VAL_AT *pVA, ICHICONST SRM *pSrm, int iat, int ineigh );
761void GetAtomStCapFlow( inp_ATOM *atom, VAL_AT *pVA, ICHICONST SRM *pSrm, int iat, int *pCap, int *pFlow );
762int GetAtomToMCGroupInitEdgeCapFlow( EdgeFlow *nEdgeCap, EdgeFlow *nEdgeFlow, ICHICONST SRM *pSrm, inp_ATOM *at, VAL_AT *pVA, int iat );
763void GetAtomToMetalInitEdgeCapFlow( EdgeFlow *nEdgeCap, EdgeFlow *nEdgeFlow );
764*/
765
766int AtomStcapStflow( inp_ATOM *atom,
767 VAL_AT *pVA,
768 ICHICONST SRM *pSrm,
769 int iat,
770 int *pnStcap,
771 int *pnStflow,
772 EdgeFlow *pnMGroupEdgeCap,
773 EdgeFlow *pnMGroupEdgeFlow );
774
776 VAL_AT *pVA,
777 ICHICONST SRM *pSrm,
778 int iat,
779 int ineigh,
780 int *pnMaxcap,
781 int *pnMinorder,
782 int *pbNeedsFlower );
783
784
785int clean_charge_val( struct tagCANON_GLOBALS *pCG,
786 CHARGE_VAL *pChargeVal, int len,
787 inp_ATOM *atom, VAL_AT *pVA, int iat,
788 int bIsMetal, int bMobileH, AT_NUMB *endpoint );
789
790int ReallocTCGroups( ALL_TC_GROUPS *pTCGroups, int nAdd );
791int RegisterTCGroup( ALL_TC_GROUPS *pTCGroups, int nGroupType, int nGroupOrdNum,
792 int nVertexCap, int nVertexFlow, int nEdgeCap, int nEdgeFlow, int nNumEdges );
793int CopyBnsToAtom( StrFromINChI *pStruct, BN_STRUCT *pBNS, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
794 int bAllowZeroBondOrder );
795int CheckBnsConsistency( StrFromINChI *pStruct, BN_STRUCT *pBNS, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int bNoRad );
796
797int RunBnsRestore1( struct tagCANON_GLOBALS *pCG,
798 struct tagINCHI_CLOCK *ic, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, BN_STRUCT *pBNS,
799 BN_DATA *pBD, StrFromINChI *pStruct,
800 VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, INChI *pInChI[], long num_inp, int bHasSomeFixedH );
801
802int RunBnsRestoreOnce( BN_STRUCT *pBNS, BN_DATA *pBD, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups );
803int nNumEdgesToCnVertex( MY_CONST C_NODE *pCN, int len, int v );
804int ConnectMetalFlower( int *pcur_num_vertices, int *pcur_num_edges,
805 int *tot_st_cap, int *tot_st_flow, ICHICONST SRM *pSrm,
806 BN_STRUCT *pBNS, ALL_TC_GROUPS *pTCGroups );
807int AddRadicalToMetal( int *tot_st_cap, int *tot_st_flow, ICHICONST SRM *pSrm, BN_STRUCT *pBNS,
808 ALL_TC_GROUPS *pTCGroups );
809int bMayBeACationInMobileHLayer( inp_ATOM *at, VAL_AT *pVA, int iat, int bMobileH );
810
812 STRUCT_DATA *sd, StrFromINChI *pStruct, inp_ATOM *at2, inp_ATOM *at3,
813 ALL_TC_GROUPS *pTCGroups );
814void IncrZeroBondsAndClearEndpts( inp_ATOM *at, int num_at, int iComponent );
815void IncrZeroBonds( inp_ATOM *at, int num_at, int iComponent );
816void ClearEndpts( inp_ATOM *at, int num_at );
817int DisplayRestoredComponent( struct tagCANON_GLOBALS *pCG, StrFromINChI *pStruct, int iComponent, int iAtNoOffset,
818 INChI *pInChI, const char *szCurHdr );
819int cmp_charge_val( const void *a1, const void *a2, void * );
820
821int EvaluateChargeChanges( BN_STRUCT *pBNS, VAL_AT *pVA, int *pnDeltaH, int *pnDeltaCharge, int *pnNumVisitedAtoms );
822int RunBnsTestOnce( BN_STRUCT *pBNS, BN_DATA *pBD, VAL_AT *pVA, Vertex *pvFirst, Vertex *pvLast,
823 int *pPathLen, int *pnDeltaH, int *pnDeltaCharge, int *pnNumVisitedAtoms );
824int comp_cc_cand( const void *a1, const void *a2 );
825int MoveRadToAtomsAddCharges( BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct,
826 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int forbidden_mask );
827void RemoveForbiddenBondFlowBits( BN_STRUCT *pBNS, int forbidden_edge_mask_int );
828
830 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
831 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
832
833int AdjustTgroupsToForbiddenEdges2( BN_STRUCT *pBNS, inp_ATOM *at, VAL_AT *pVA, int num_atoms, int forbidden_mask );
834int AllocEdgeList( EDGE_LIST *pEdges, int nLen );
835int AddToEdgeList( EDGE_LIST *pEdges, int iedge, int nAddLen );
836int RemoveFromEdgeListByIndex( EDGE_LIST *pEdges, int index );
837int RemoveFromEdgeListByValue( EDGE_LIST *pEdges, int iedge );
838int FindInEdgeList( EDGE_LIST *pEdges, int iedge );
839int AllocBfsQueue( BFS_Q *pQ, int num_at, int min_ring_size );
840void RemoveForbiddenEdgeMask( BN_STRUCT *pBNS, EDGE_LIST *pEdges, int forbidden_edge_mask );
841void SetForbiddenEdgeMask( BN_STRUCT *pBNS, EDGE_LIST *pEdges, int forbidden_edge_mask );
842int ForbidCarbonChargeEdges( BN_STRUCT *pBNS, ALL_TC_GROUPS *pTCGroups, EDGE_LIST *pCarbonChargeEdges,
843 int forbidden_edge_mask );
844int ForbidMetalCarbonEdges( BN_STRUCT *pBNS, inp_ATOM *at, int num_at, VAL_AT *pVA,
845 ALL_TC_GROUPS *pTCGroups, EDGE_LIST *pMetalCarbonEdges, int forbidden_edge_mask );
847 VAL_AT *pVA, int min_ring_size, ALL_TC_GROUPS *pTCGroups,
848 EDGE_LIST *pNplus2BondsEdges, int forbidden_edge_mask );
850 ALL_TC_GROUPS *pTCGroups, int forbidden_edge_mask );
852 inp_ATOM *at, inp_ATOM *at2,
853 VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
854 int *pnNumRunBNS, int *pnTotalDelta,
855 int forbidden_edge_mask );
857 inp_ATOM *at, inp_ATOM *at2,
858 VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
859 int *pnNumRunBNS, int *pnTotalDelta,
860 int forbidden_edge_mask );
862 inp_ATOM *at, inp_ATOM *at2,
863 VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
864 int *pnNumRunBNS, int *pnTotalDelta,
865 int forbidden_edge_mask, int forbidden_stereo_edge_mask );
867 inp_ATOM *at, inp_ATOM *at2,
868 VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
869 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
870int RestoreCyanoGroup( BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct,
871 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
872 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
873int RestoreIsoCyanoGroup( BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct,
874 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
875 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
876int RestoreNNNgroup( BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct,
877 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
878 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
879int FixMetal_Nminus_Ominus( BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct,
880 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
881 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
883 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
884 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
885int Convert_SIV_to_SVI( BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct,
886 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
887 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
889 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
890 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
892 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
893 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
895 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
896 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
898 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
899 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
900int CheckAndRefixStereobonds( BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct,
901 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
902 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
904 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
905 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
907 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
908 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
909int SaltBondsToCoordBonds( BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct,
910 inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
911 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
912int FixLessHydrogenInFormula( BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at,
913 inp_ATOM *at2, inp_ATOM *atf, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
914 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
915int FixMoreHydrogenInFormula( BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at,
916 inp_ATOM *at2, inp_ATOM *atf, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
917 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
919 inp_ATOM *at2, inp_ATOM *atf, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, ICR *picr,
920 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
921int ConnectDisconnectedH( inp_ATOM *at, int num_atoms, int num_deleted_H );
922int DisconnectedConnectedH( inp_ATOM *at, int num_atoms, int num_deleted_H );
923
925 STRUCT_DATA *sd_inp, StrFromINChI *pStruct,
926 int iComponent, int iAtNoOffset, long num_inp );
927
928int GetChargeFlowerUpperEdge( BN_STRUCT *pBNS, VAL_AT *pVA, int nChargeEdge );
929int get_pVA_atom_type( VAL_AT *pVA, inp_ATOM *at, int iat, int bond_type );
930
932 STRUCT_DATA *sd, BN_STRUCT *pBNS, BN_DATA *pBD,
933 StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, inp_ATOM *at3, VAL_AT *pVA,
934 ALL_TC_GROUPS *pTCGroups, INChI *pInChI[], long num_inp, int bHasSomeFixedH,
935 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask, int forbidden_stereo_edge_mask );
936
937/* call InChI normalization only */
939 StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2,
940 VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
941 inp_ATOM *at_norm, inp_ATOM *at_fixed_bonds_out, T_GROUP_INFO *t_group_info );
942/* create one InChI */
944 STRUCT_DATA *sd, BN_STRUCT *pBNS, StrFromINChI *pStruct,
945 inp_ATOM *at, inp_ATOM *at2, inp_ATOM *at3, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
946 T_GROUP_INFO **t_group_info, inp_ATOM **at_norm, inp_ATOM **at_prep );
947
948/* fixed-H */
950int FillOutExtraFixedHDataInChI( StrFromINChI *pStruct, INChI *pInChI[] );
951
953 struct tagINCHI_CLOCK *ic,
955 STRUCT_DATA *sd,
956 BN_STRUCT *pBNS, BN_DATA *pBD,
957 StrFromINChI *pStruct,
958 inp_ATOM *at, inp_ATOM *at2, inp_ATOM *at3,
959 VAL_AT *pVA,
960 ALL_TC_GROUPS *pTCGroups, T_GROUP_INFO **ti,
961 inp_ATOM **at_norm, inp_ATOM **at_prep,
962 INChI *pInChI[], long num_inp,
963 int bHasSomeFixedH, int *pnNumRunBNS,
964 int *pnTotalDelta,
965 int forbidden_edge_mask,
966 int forbidden_stereo_edge_mask );
967
969 inp_ATOM *at2, inp_ATOM *atf, inp_ATOM *atn, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups,
970 ICR *picr,
971 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask );
972int FillOutCMP2FHINCHI( StrFromINChI *pStruct, inp_ATOM *at2, VAL_AT *pVA, INChI *pInChI[], CMP2FHINCHI *pc2i );
973int FillOutCMP2MHINCHI( StrFromINChI *pStruct, ALL_TC_GROUPS *pTCGroups, inp_ATOM *at2,
974 VAL_AT *pVA, INChI *pInChI[], CMP2MHINCHI *pc2i );
975
976int bHas_N_V( inp_ATOM *at2, int num_atoms );
977
978int GetPlusMinusVertex( BN_STRUCT *pBNS, ALL_TC_GROUPS *pTCGroups, int bCheckForbiddenPlus, int bCheckForbiddenMinus );
979
981 struct tagINCHI_CLOCK *ic,
983 STRUCT_DATA *sd,
984 BN_STRUCT *pBNS,
985 BN_DATA *pBD,
986 StrFromINChI *pStruct,
987 inp_ATOM *at,
988 inp_ATOM *at2,
989 inp_ATOM *at3,
990 VAL_AT *pVA,
991 ALL_TC_GROUPS *pTCGroups,
992 T_GROUP_INFO **ppt_group_info,
993 inp_ATOM **ppat_norm,
994 inp_ATOM **ppat_prep,
995 INChI *pInChI[],
996 long num_inp,
997 int bHasSomeFixedH,
998 int *pnNumRunBNS,
999 int *pnTotalDelta,
1000 int forbidden_edge_mask,
1001 int forbidden_stereo_edge_mask );
1002
1003int FixRestoredStructureStereo( struct tagCANON_GLOBALS *pCG, struct tagINCHI_CLOCK *ic, INCHI_MODE cmpInChI, ICR *icr,
1004 INCHI_MODE cmpInChI2, ICR *icr2,
1005 ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, BN_STRUCT *pBNS, BN_DATA *pBD,
1006 StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, inp_ATOM *at3, VAL_AT *pVA,
1007 ALL_TC_GROUPS *pTCGroups, T_GROUP_INFO **ppt_group_info, inp_ATOM **ppat_norm,
1008 inp_ATOM **ppat_prep, INChI *pInChI[], long num_inp,
1009 int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask,
1010 int forbidden_stereo_edge_mask );
1011
1013 STRUCT_DATA *sd, long num_inp,
1014 int bHasSomeFixedH,
1015 StrFromINChI *pStruct, int num_components,
1016 StrFromINChI *pStructR, int num_componentsR,
1017 NUM_H *pProtonBalance, int *recmet_change_balance );
1019 STRUCT_DATA *sd, long num_inp, char *szCurHdr,
1020 ICHICONST SRM *pSrm, int bReqNonTaut, StrFromINChI *pStruct[INCHI_NUM][TAUT_NUM],
1021 InpInChI *pOneInput );
1023 struct tagCANON_GLOBALS *pCG,
1025 long num_inp, int bHasSomeFixedH,
1026 char *szCurHdr,
1027 StrFromINChI *pStruct[INCHI_NUM][TAUT_NUM],
1028 InpInChI *pOneInput );
1029int InChI2Atom( struct tagINCHI_CLOCK *ic, struct tagCANON_GLOBALS *pCG,
1031 const char *szCurHdr, long num_inp,
1032 StrFromINChI *pStruct, int iComponent,
1033 int iAtNoOffset, int bI2A_Flag, int bHasSomeFixedH,
1034 InpInChI *pOneInput );
1035
1036
1038void RemoveFixHInChIIdentical2MobH( InpInChI *pOneInput );
1039void SetUpSrm( SRM *pSrm );
1041void FreeStrFromINChI( StrFromINChI *pStruct[INCHI_NUM][TAUT_NUM], int nNumComponents[INCHI_NUM][TAUT_NUM] );
1043 int iComponent, long num_inp, char *szCurHdr );
1044int CompareOneOrigInchiToRevInChI( StrFromINChI *pStruct, INChI *pInChI[TAUT_NUM], int bMobileH, int iComponent,
1045 long num_inp, char *szCurHdr,
1046 COMPONENT_REM_PROTONS *nCurRemovedProtons, INCHI_MODE CompareInchiFlags[] );
1047int CompareTwoPairsOfInChI( INChI *pInChI1[TAUT_NUM], INChI *pInChI2[TAUT_NUM],
1048 int bMobileH, INCHI_MODE CompareInchiFlags[] );
1049INCHI_MODE CompareReversedINChI3( INChI *i1 /* InChI from reversed struct */, INChI *i2 /* input InChI */,
1050 INChI_Aux *a1, INChI_Aux *a2, int *err );
1051INCHI_MODE CompareReversedStereoINChI3( INChI_Stereo *s1/* InChI from reversed struct */,
1052 INChI_Stereo *s2 /* input InChI */, ICR *picr );
1053int CompareAllOrigInchiToRevInChI( StrFromINChI *pStruct[INCHI_NUM][TAUT_NUM], InpInChI *pOneInput, int bReqNonTaut,
1054 long num_inp, char *szCurHdr );
1056 InpInChI *pOneInput, int bHasSomeFixedH,
1057 long num_inp, char *szCurHdr );
1058int insertions_sort_AT_NUMB( AT_NUMB *base, int num );
1059
1061 struct tagCANON_GLOBALS *pCG,
1063 long num_inp, int bHasSomeFixedH,
1064 StrFromINChI *pStruct, int num_components,
1065 StrFromINChI *pStructR, int num_componentsR,
1066 NUM_H pProtonBalance[],
1067 NUM_H recmet_change_balance[] );
1068
1070 struct tagCANON_GLOBALS *pCG,
1071 ICHICONST INPUT_PARMS *ip_inp,
1072 STRUCT_DATA *sd_inp,
1073 long num_inp, int bINChIOutputOptions,
1074 INCHI_IOSTREAM *pout, INCHI_IOSTREAM *plog,
1075 InpInChI *pOneInput, int bHasSomeFixedH,
1076 unsigned char save_opt_bits );
1077
1078int MergeStructureComponents( ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, long num_inp, char *szCurHdr,
1079 ICHICONST SRM *pSrm, int bReqNonTaut, StrFromINChI *pStruct[INCHI_NUM][TAUT_NUM],
1080 InpInChI *pOneInput );
1081int AddOneMsg( char *szMsg, int used_len, int tot_len, const char *szAddMsg, const char *szDelim );
1082int FillOutCompareMessage( char *szMsg, int nLenMsg, INCHI_MODE bits[] );
1084int bInpInchiComponentExists( InpInChI *pOneInput, int iINCHI, int bMobileH, int k );
1085int bInpInchiComponentDeleted( InpInChI *pOneInput, int iInChI, int bMobileH, int k );
1086int bRevInchiComponentExists( StrFromINChI *pStruct, int iInChI, int bMobileH, int k );
1087int bRevInchiComponentDeleted( StrFromINChI *pStruct, int iInChI, int bMobileH, int k );
1088int DetectInpInchiCreationOptions( InpInChI *pOneInput, int *bHasReconnected, int *bHasMetal,
1089 int *bHasFixedH, int *sFlag, int *bTautFlag );
1090
1093 long num_inp, char *szCurHdr,
1094 ICHICONST SRM *pSrm,
1095 int bReqNonTaut,
1096 StrFromINChI *pStruct[INCHI_NUM][TAUT_NUM],
1097 InpInChI *pOneInput );
1099 StrFromINChI *pStruct, inp_ATOM *at,
1100 int iComponent, int nNumComponents, int bMobileH,
1101 const char *szCurHdr );
1103 inp_ATOM *at, int num_at, const char *szCurHdr );
1104
1105int CountStereoTypes( INChI *pInChI, int *num_known_SB, int *num_known_SC,
1106 int *num_unk_und_SB, int *num_unk_und_SC,
1107 int *num_SC_PIII, int *num_SC_AsIII );
1108int GetNumNeighborsFromInchi( INChI *pInChI, AT_NUMB nAtNumber );
1109int bIsUnsatCarbonInASmallRing( inp_ATOM *at, VAL_AT *pVA, int iat, BFS_Q *pbfsq, int min_ring_size );
1110
1111int MakeProtonComponent( StrFromINChI *pStruct, int iComponent, int num_prot );
1112
1113void FreeInpInChI( InpInChI *pOneInput );
1114
1115
1116/* extra configurarion */
1117#define KEEP_METAL_EDGE_FLOW 0 /* counterexample: mdb0-1738.sdf.txt */
1118#define MOVE_CHARGES_FROM_HETEREO_TO_METAL 0 /* disabled */
1119#define FIX_ADD_PROTON_FOR_ADP 0 /* not used */
1120
1121#ifndef COMPILE_ALL_CPP
1122#ifdef __cplusplus
1123}
1124#endif
1125#endif
1126
1127
1128#endif /* _ICHIRVRS_H_ */
INChI * PINChI2[TAUT_NUM]
Definition ichi.h:259
INChI_Aux * PINChI_Aux2[TAUT_NUM]
Definition ichi.h:302
int EdgeIndex
Definition ichi_bns.h:67
int EdgeFlow
Definition ichi_bns.h:70
int Vertex
Definition ichi_bns.h:66
#define MY_CONST
Definition ichirvrs.h:303
int RestoreAtomConnectionsSetStereo(StrFromINChI *pStruct, int iComponent, int iAtNoOffset, INChI *pInChI, INChI *pInChIMobH)
Definition ichirvr2.c:106
int EliminateChargeSeparationOnHeteroatoms(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask, int forbidden_stereo_edge_mask)
Definition ichirvr2.c:3883
struct tagChargeNodeList CN_LIST
int bIsUnsatCarbonInASmallRing(inp_ATOM *at, VAL_AT *pVA, int iat, BFS_Q *pbfsq, int min_ring_size)
Definition ichirvr5.c:92
int MoveChargeToRemoveCenerpoints(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr4.c:1860
int ConnectDisconnectedH(inp_ATOM *at, int num_atoms, int num_deleted_H)
Definition ichirvr1.c:5477
struct tagAtomsCmpTwoFixedH CMP2FHATOMS
struct tagBfsQueue BFS_Q
int AddCGroups2TCGBnStruct(BN_STRUCT *pBNS, StrFromINChI *pStruct, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int nMaxAddEdges)
Definition ichirvr1.c:3249
int AdjustTgroupsToForbiddenEdges2(BN_STRUCT *pBNS, inp_ATOM *at, VAL_AT *pVA, int num_atoms, int forbidden_mask)
Definition ichirvr2.c:2133
int bRevInchiComponentDeleted(StrFromINChI *pStruct, int iInChI, int bMobileH, int k)
Definition ichiread.c:1859
int AddEdgeFlow(int edge_cap, int edge_flow, BNS_EDGE *e01, BNS_VERTEX *pv0, BNS_VERTEX *pv1, int *tot_st_cap, int *tot_st_flow)
Definition ichirvr1.c:2923
int OldPrintCompareOneOrigInchiToRevInChI(StrFromINChI *pStruct, INChI *pInChI[TAUT_NUM], int bMobileH, int iComponent, long num_inp, char *szCurHdr)
#define MAX_CN_VAL
Definition ichirvrs.h:432
int RestoreIsoCyanoGroup(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr2.c:4662
struct tagXYZCoord XYZ_COORD
struct tagReversedInChI REV_INCHI
struct tagVertCapFlow VCF
int set_cumulene_0D_parity(inp_ATOM *at, inp_ATOM_STEREO *st, int num_at, int idelH1, int i1, int i2, int idelH2, int parity, int len)
Definition ichirvr2.c:1639
void RemoveForbiddenBondFlowBits(BN_STRUCT *pBNS, int forbidden_edge_mask_int)
Definition ichirvr1.c:4888
struct tagStructCmpTwoMobileH CMP2MHINCHI
int EliminateNitrogen5Val3Bonds(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr2.c:5809
int IncrementZeroOrderBondsToHeteroat(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr2.c:3519
struct tagAtomIonPrperies VAL_AT
void SetUpSrm(SRM *pSrm)
Definition ichirvr7.c:364
struct tagAtomsCmpTwoMobileH CMP2MHATOMS
int RestoreAtomMakeBNS(struct tagINCHI_CLOCK *ic, struct tagCANON_GLOBALS *pCG, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, StrFromINChI *pStruct, int iComponent, int iAtNoOffset, INChI *pInChI[], const char *szCurHdr, long num_inp, int bHasSomeFixedH)
Definition ichirvr4.c:3197
int RegisterTCGroup(ALL_TC_GROUPS *pTCGroups, int nGroupType, int nGroupOrdNum, int nVertexCap, int nVertexFlow, int nEdgeCap, int nEdgeFlow, int nNumEdges)
Definition ichirvr1.c:1527
int nNumEdgesToCnVertex(MY_CONST C_NODE *pCN, int len, int v)
Definition ichirvr1.c:3824
struct tagInpAtomAddParities inp_ATOM_STEREO
int FillOutCMP2MHINCHI(StrFromINChI *pStruct, ALL_TC_GROUPS *pTCGroups, inp_ATOM *at2, VAL_AT *pVA, INChI *pInChI[], CMP2MHINCHI *pc2i)
Definition ichirvr4.c:1021
INCHI_MODE CompareReversedStereoINChI3(INChI_Stereo *s1, INChI_Stereo *s2, ICR *picr)
Definition ichirvr7.c:2351
void FreeInpInChI(InpInChI *pOneInput)
Definition ichirvr7.c:1437
int MakeOneInChIOutOfStrFromINChI(struct tagCANON_GLOBALS *pCG, struct tagINCHI_CLOCK *ic, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, StrFromINChI *pStruct, inp_ATOM *at2, inp_ATOM *at3, ALL_TC_GROUPS *pTCGroups)
Definition ichirvr1.c:5165
int AddTGroups2TCGBnStruct(BN_STRUCT *pBNS, StrFromINChI *pStruct, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int nMaxAddEdges)
Definition ichirvr1.c:2425
int FixMetal_Nminus_Ominus(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr2.c:4964
struct tagChargeNodes C_NODE
int CompareOneOrigInchiToRevInChI(StrFromINChI *pStruct, INChI *pInChI[TAUT_NUM], int bMobileH, int iComponent, long num_inp, char *szCurHdr, COMPONENT_REM_PROTONS *nCurRemovedProtons, INCHI_MODE CompareInchiFlags[])
Definition ichirvr7.c:2239
struct tagTCGroup TC_GROUP
int FillOutExtraFixedHDataInChI(StrFromINChI *pStruct, INChI *pInChI[])
Definition ichirvr4.c:831
BN_STRUCT * AllocateAndInitTCGBnStruct(StrFromINChI *pStruct, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int nMaxAddAtoms, int nMaxAddEdges, int max_altp, int *pNum_changed_bonds)
Definition ichirvr1.c:3879
int NormalizeStructure(ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, BN_STRUCT *pBNS, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, inp_ATOM *at_norm, inp_ATOM *at_fixed_bonds_out, T_GROUP_INFO *t_group_info)
int AllocBfsQueue(BFS_Q *pQ, int num_at, int min_ring_size)
Definition ichirvr1.c:4812
int bHas_N_V(inp_ATOM *at2, int num_atoms)
Definition ichirvr3.c:92
int FixMobileHRestoredStructure(struct tagCANON_GLOBALS *pCG, struct tagINCHI_CLOCK *ic, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, inp_ATOM *at3, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, T_GROUP_INFO **ppt_group_info, inp_ATOM **ppat_norm, inp_ATOM **ppat_prep, INChI *pInChI[], long num_inp, int bHasSomeFixedH, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask, int forbidden_stereo_edge_mask)
Definition ichirvr5.c:141
int ReallocTCGroups(ALL_TC_GROUPS *pTCGroups, int nAdd)
Definition ichirvr1.c:1502
int SaltBondsToCoordBonds(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr4.c:2372
int CheckBnsConsistency(StrFromINChI *pStruct, BN_STRUCT *pBNS, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int bNoRad)
Definition ichirvr2.c:1155
void CopySt2At(inp_ATOM *at, inp_ATOM_STEREO *st, int num_atoms)
Definition ichirvr2.c:79
struct tagStructRestoreMode SRM
int insertions_sort_AT_NUMB(AT_NUMB *base, int num)
Definition ichiread.c:10516
void SetForbiddenEdgeMask(BN_STRUCT *pBNS, EDGE_LIST *pEdges, int forbidden_edge_mask)
Definition ichirvr1.c:4877
int RestoreNNNgroup(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr2.c:5114
void AddStCapFlow(BNS_VERTEX *vert_ficpoint, int *tot_st_flow, int *tot_st_cap, int cap, int flow)
Definition ichirvr1.c:3218
int PlusFromDB_N_DB_O_to_Metal(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr2.c:6269
struct tagChargeValence CHARGE_VAL
int GetPlusMinusVertex(BN_STRUCT *pBNS, ALL_TC_GROUPS *pTCGroups, int bCheckForbiddenPlus, int bCheckForbiddenMinus)
Definition ichirvr5.c:58
INCHI_MODE CompareReversedINChI3(INChI *i1, INChI *i2, INChI_Aux *a1, INChI_Aux *a2, int *err)
Definition ichirvr7.c:2633
tagTCGroupTypes
Definition ichirvrs.h:219
@ TCG_Minus_C0
Definition ichirvrs.h:228
@ TCG_Plus_M0
Definition ichirvrs.h:230
@ TCG_Plus_C1
Definition ichirvrs.h:227
@ TCG_Minus0
Definition ichirvrs.h:224
@ TCG_Plus_C0
Definition ichirvrs.h:226
@ TCG_Minus_C1
Definition ichirvrs.h:229
@ TCG_Minus1
Definition ichirvrs.h:225
@ TCG_Plus_M1
Definition ichirvrs.h:231
@ TCG_MeFlower1
Definition ichirvrs.h:235
@ TCG_MeFlower0
Definition ichirvrs.h:234
@ TCG_Plus1
Definition ichirvrs.h:223
@ TCG_Plus
Definition ichirvrs.h:239
@ TCG_Plus0
Definition ichirvrs.h:222
@ TCG_Minus
Definition ichirvrs.h:240
@ NUM_TCGROUP_TYPES
Definition ichirvrs.h:242
@ TCG_None
Definition ichirvrs.h:220
@ TCG_Minus_M0
Definition ichirvrs.h:232
@ TCG_Minus_M1
Definition ichirvrs.h:233
@ TCG_MeFlower3
Definition ichirvrs.h:237
@ TCG_MeFlower2
Definition ichirvrs.h:236
int RunBnsTestOnce(BN_STRUCT *pBNS, BN_DATA *pBD, VAL_AT *pVA, Vertex *pvFirst, Vertex *pvLast, int *pPathLen, int *pnDeltaH, int *pnDeltaCharge, int *pnNumVisitedAtoms)
Definition ichirvr1.c:4504
int AddRemProtonsInRestrStruct(struct tagINCHI_CLOCK *ic, struct tagCANON_GLOBALS *pCG, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, long num_inp, int bHasSomeFixedH, StrFromINChI *pStruct, int num_components, StrFromINChI *pStructR, int num_componentsR, NUM_H *pProtonBalance, int *recmet_change_balance)
Definition ichirvr4.c:3614
int ForbidCarbonChargeEdges(BN_STRUCT *pBNS, ALL_TC_GROUPS *pTCGroups, EDGE_LIST *pCarbonChargeEdges, int forbidden_edge_mask)
Definition ichirvr4.c:57
int ConnectMetalFlower(int *pcur_num_vertices, int *pcur_num_edges, int *tot_st_cap, int *tot_st_flow, ICHICONST SRM *pSrm, BN_STRUCT *pBNS, ALL_TC_GROUPS *pTCGroups)
Definition ichirvr1.c:2743
void FreeStrFromINChI(StrFromINChI *pStruct[INCHI_NUM][TAUT_NUM], int nNumComponents[INCHI_NUM][TAUT_NUM])
Definition ichirvr7.c:1352
void SetStCapFlow(BNS_VERTEX *vert_ficpoint, int *tot_st_flow, int *tot_st_cap, int cap, int flow)
Definition ichirvr1.c:3231
struct tagStructCmpTwoFixedH CMP2FHINCHI
int RemoveRadFromMobileHEndpointFixH(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr2.c:6962
int AddOneMsg(char *szMsg, int used_len, int tot_len, const char *szAddMsg, const char *szDelim)
Definition ichirvr7.c:3127
int RunBnsRestoreOnce(BN_STRUCT *pBNS, BN_DATA *pBD, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups)
Definition ichirvr1.c:4543
int SetStereoBondTypesFrom0DStereo(StrFromINChI *pStruct, INChI *pInChI)
Definition ichirvr2.c:844
void CopyAt2St(inp_ATOM *at, inp_ATOM_STEREO *st, int num_atoms)
Definition ichirvr2.c:57
int MarkDisconectedIdenticalToReconnected(InpInChI *pOneInput)
Definition ichirvr7.c:283
int AtomStcapStflow(inp_ATOM *atom, VAL_AT *pVA, ICHICONST SRM *pSrm, int iat, int *pnStcap, int *pnStflow, EdgeFlow *pnMGroupEdgeCap, EdgeFlow *pnMGroupEdgeFlow)
Definition ichirvr1.c:1790
int get_pVA_atom_type(VAL_AT *pVA, inp_ATOM *at, int iat, int bond_type)
Definition ichirvr1.c:4625
int set_atom_0D_parity(inp_ATOM *at, inp_ATOM_STEREO *st, int num_at, int num_deleted_H, int i1, int parity)
Definition ichirvr2.c:1773
void FreeInputInChI2Struct(InpInChI *pOneInput)
int FixRemoveExtraTautEndpoints(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, inp_ATOM *atf, inp_ATOM *atn, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, ICR *picr, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr4.c:589
int NormalizeAndCompare(struct tagCANON_GLOBALS *pCG, struct tagINCHI_CLOCK *ic, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, inp_ATOM *at3, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, INChI *pInChI[], long num_inp, int bHasSomeFixedH, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask, int forbidden_stereo_edge_mask)
Definition ichirvr4.c:1274
int CompareAllDisconnectedOrigInchiToRevInChI(StrFromINChI *pStruct[INCHI_NUM][TAUT_NUM], InpInChI *pOneInput, int bHasSomeFixedH, long num_inp, char *szCurHdr)
Definition ichirvr7.c:1682
int cmp_charge_val(const void *a1, const void *a2, void *)
Definition ichirvr1.c:732
int GetNumNeighborsFromInchi(INChI *pInChI, AT_NUMB nAtNumber)
Definition ichiread.c:1646
void RemoveForbiddenEdgeMask(BN_STRUCT *pBNS, EDGE_LIST *pEdges, int forbidden_edge_mask)
Definition ichirvr1.c:4866
tagTgRestoreFlags
Definition ichirvrs.h:195
@ TGRF_MINUS_FIRST
Definition ichirvrs.h:196
int AddExplicitDeletedH(inp_ATOM *at, int jv, int num_at, int *iDeletedH, int *iH, int nNumDeletedH, int bTwoStereo)
Definition ichirvr2.c:1470
void IncrZeroBonds(inp_ATOM *at, int num_at, int iComponent)
Definition ichirvr1.c:4169
struct tagEdgeList EDGE_LIST
void clear_t_group_info(T_GROUP_INFO *ti)
Definition ichirvr1.c:509
int Convert_SIV_to_SVI(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr2.c:6053
int RunBnsRestore1(struct tagCANON_GLOBALS *pCG, struct tagINCHI_CLOCK *ic, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, INChI *pInChI[], long num_inp, int bHasSomeFixedH)
Definition ichirvr4.c:2739
int OneInChI2Atom(struct tagINCHI_CLOCK *ic, struct tagCANON_GLOBALS *pCG, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, const char *szCurHdr, long num_inp, StrFromINChI *pStruct, int iComponent, int iAtNoOffset, int bHasSomeFixedH, INChI *pInChI[])
Definition ichirvr4.c:3476
int ForbidMetalCarbonEdges(BN_STRUCT *pBNS, inp_ATOM *at, int num_at, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, EDGE_LIST *pMetalCarbonEdges, int forbidden_edge_mask)
int MakeProtonComponent(StrFromINChI *pStruct, int iComponent, int num_prot)
Definition ichirvr4.c:3573
int RestoreCyanoGroup(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr2.c:4553
int RemoveRadFromMobileHEndpoint(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr2.c:6524
int RemoveFromEdgeListByIndex(EDGE_LIST *pEdges, int index)
Definition ichirvr1.c:4756
int comp_cc_cand(const void *a1, const void *a2)
Definition ichirvr1.c:4581
int nAddSuperCGroups(ALL_TC_GROUPS *pTCGroups)
Definition ichirvr1.c:2279
int MoveChargeToMakeCenerpoints(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr2.c:7657
struct tagRemovedAndExchangeableH REM_PROTONS
int AllocEdgeList(EDGE_LIST *pEdges, int nLen)
Definition ichirvr1.c:4687
int GetChargeFlowerUpperEdge(BN_STRUCT *pBNS, VAL_AT *pVA, int nChargeEdge)
Definition ichirvr1.c:4912
int DisplayStructureComponents(struct tagCANON_GLOBALS *pCG, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, long num_inp, char *szCurHdr, ICHICONST SRM *pSrm, int bReqNonTaut, StrFromINChI *pStruct[INCHI_NUM][TAUT_NUM], InpInChI *pOneInput)
int AddRemIsoProtonsInRestrStruct(struct tagINCHI_CLOCK *ic, struct tagCANON_GLOBALS *pCG, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, long num_inp, int bHasSomeFixedH, StrFromINChI *pStruct, int num_components, StrFromINChI *pStructR, int num_componentsR, NUM_H pProtonBalance[], NUM_H recmet_change_balance[])
Definition ichirvr4.c:3815
int AddToEdgeList(EDGE_LIST *pEdges, int iedge, int nAddLen)
Definition ichirvr1.c:4735
MY_CONST CN_LIST cnList[]
Definition ichirvr1.c:481
int DetectInpInchiCreationOptions(InpInChI *pOneInput, int *bHasReconnected, int *bHasMetal, int *bHasFixedH, int *sFlag, int *bTautFlag)
Definition ichiread.c:1880
int MoveMobileHToAvoidFixedBonds(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr2.c:6445
int DisplayRestoredComponent(struct tagCANON_GLOBALS *pCG, StrFromINChI *pStruct, int iComponent, int iAtNoOffset, INChI *pInChI, const char *szCurHdr)
struct tagAllTCGroups ALL_TC_GROUPS
int CompareAllOrigInchiToRevInChI(StrFromINChI *pStruct[INCHI_NUM][TAUT_NUM], InpInChI *pOneInput, int bReqNonTaut, long num_inp, char *szCurHdr)
Definition ichirvr7.c:1547
int FixLessHydrogenInFormula(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, inp_ATOM *atf, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr4.c:177
struct tagChargeChangeCandidate CC_CAND
int clean_charge_val(struct tagCANON_GLOBALS *pCG, CHARGE_VAL *pChargeVal, int len, inp_ATOM *atom, VAL_AT *pVA, int iat, int bIsMetal, int bMobileH, AT_NUMB *endpoint)
Definition ichirvr1.c:792
enum tagTgRestoreFlags TGRF
int get_bonds_valences(int nPeriodicNum, int bonds_valence, int num_H, VAL_AT *pVA)
#define MAX_DIFF_FIXH
Definition ichirvrs.h:491
int FillOutExtraFixedHDataRestr(StrFromINChI *pStruct)
Definition ichirvr4.c:754
int FillOutCMP2FHINCHI(StrFromINChI *pStruct, inp_ATOM *at2, VAL_AT *pVA, INChI *pInChI[], CMP2FHINCHI *pc2i)
Definition ichirvr4.c:870
int CountStereoTypes(INChI *pInChI, int *num_known_SB, int *num_known_SC, int *num_unk_und_SB, int *num_unk_und_SC, int *num_SC_PIII, int *num_SC_AsIII)
Definition ichiread.c:1723
int MoveChargeFromHeteroatomsToMetals(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
int FillOutpStructEndpointFromInChI(INChI *pInChI, AT_NUMB **pEndpoint)
Definition ichirvr1.c:692
int RemoveFromEdgeListByValue(EDGE_LIST *pEdges, int iedge)
Definition ichirvr1.c:4791
int bFindCumuleneChain(inp_ATOM *at, AT_NUMB i1, AT_NUMB i2, AT_NUMB nCumulene[], int nMaxLen)
Definition ichirvr2.c:1565
int MakeSingleBondsMetal2ChargedHeteroat(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr4.c:2194
int DisplayAllRestoredComponents(struct tagCANON_GLOBALS *pCG, inp_ATOM *at, int num_at, const char *szCurHdr)
int bRevInchiComponentExists(StrFromINChI *pStruct, int iInChI, int bMobileH, int k)
Definition ichiread.c:1838
void SetEdgeCapFlow(BNS_EDGE *e, int edge_cap, int edge_flow)
Definition ichirvr1.c:2911
int FindInEdgeList(EDGE_LIST *pEdges, int iedge)
Definition ichirvr1.c:4774
int MakeInChIOutOfStrFromINChI2(struct tagINCHI_CLOCK *ic, struct tagCANON_GLOBALS *pCG, ICHICONST INPUT_PARMS *ip_inp, STRUCT_DATA *sd_inp, StrFromINChI *pStruct, int iComponent, int iAtNoOffset, long num_inp)
Definition ichirvr1.c:5666
struct tagInputInChI InpInChI
void ClearEndpts(inp_ATOM *at, int num_at)
Definition ichirvr1.c:4188
struct tagOneComponentRemovedAndExchangeableH COMPONENT_REM_PROTONS
int nTautEndpointEdgeCap(inp_ATOM *at, VAL_AT *pVA, int i)
Definition ichirvr1.c:1574
int ConnectTwoVertices(BNS_VERTEX *p1, BNS_VERTEX *p2, BNS_EDGE *e, BN_STRUCT *pBNS, int bClearEdge)
Definition ichirvr1.c:2627
int FixRestoredStructureStereo(struct tagCANON_GLOBALS *pCG, struct tagINCHI_CLOCK *ic, INCHI_MODE cmpInChI, ICR *icr, INCHI_MODE cmpInChI2, ICR *icr2, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, inp_ATOM *at3, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, T_GROUP_INFO **ppt_group_info, inp_ATOM **ppat_norm, inp_ATOM **ppat_prep, INChI *pInChI[], long num_inp, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask, int forbidden_stereo_edge_mask)
Definition ichirvr6.c:59
int AllInchiToStructure(struct tagINCHI_CLOCK *ic, struct tagCANON_GLOBALS *pCG, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, long num_inp, char *szCurHdr, ICHICONST SRM *pSrm, int bReqNonTaut, StrFromINChI *pStruct[INCHI_NUM][TAUT_NUM], InpInChI *pOneInput)
Definition ichirvr7.c:1041
int bInpInchiComponentExists(InpInChI *pOneInput, int iINCHI, int bMobileH, int k)
Definition ichiread.c:1800
void IncrZeroBondsAndClearEndpts(inp_ATOM *at, int num_at, int iComponent)
Definition ichirvr1.c:4149
int MoveRadToAtomsAddCharges(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int forbidden_mask)
Definition ichirvr2.c:1841
int FixMoreHydrogenInFormula(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, inp_ATOM *atf, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr4.c:398
int MakeOneInChIOutOfStrFromINChI2(struct tagCANON_GLOBALS *pCG, struct tagINCHI_CLOCK *ic, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, BN_STRUCT *pBNS, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, inp_ATOM *at3, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, T_GROUP_INFO **t_group_info, inp_ATOM **at_norm, inp_ATOM **at_prep)
Definition ichirvr1.c:5084
#define ICHICONST
Definition ichirvrs.h:48
int CompareTwoPairsOfInChI(INChI *pInChI1[TAUT_NUM], INChI *pInChI2[TAUT_NUM], int bMobileH, INCHI_MODE CompareInchiFlags[])
Definition ichirvr7.c:2202
enum tagTCGroupTypes TCGR_TYPE
int EvaluateChargeChanges(BN_STRUCT *pBNS, VAL_AT *pVA, int *pnDeltaH, int *pnDeltaCharge, int *pnNumVisitedAtoms)
Definition ichirvr1.c:4317
int FixFixedHRestoredStructure(struct tagCANON_GLOBALS *pCG, struct tagINCHI_CLOCK *ic, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, inp_ATOM *at3, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, T_GROUP_INFO **ti, inp_ATOM **at_norm, inp_ATOM **at_prep, INChI *pInChI[], long num_inp, int bHasSomeFixedH, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask, int forbidden_stereo_edge_mask)
Definition ichirvr3.c:333
int get_sp_element_type(int nPeriodicNumber, int *nRow)
Definition ichirvr1.c:1414
int InChI2Atom(struct tagINCHI_CLOCK *ic, struct tagCANON_GLOBALS *pCG, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, const char *szCurHdr, long num_inp, StrFromINChI *pStruct, int iComponent, int iAtNoOffset, int bI2A_Flag, int bHasSomeFixedH, InpInChI *pOneInput)
Definition ichirvr7.c:101
int set_bond_type(inp_ATOM *at, AT_NUMB i1, AT_NUMB i2, int bType)
Definition ichirvr2.c:1614
int ForbidNintrogenPlus2BondsInSmallRings(BN_STRUCT *pBNS, inp_ATOM *at, int num_at, VAL_AT *pVA, int min_ring_size, ALL_TC_GROUPS *pTCGroups, EDGE_LIST *pNplus2BondsEdges, int forbidden_edge_mask)
Definition ichirvr4.c:116
int nCountBnsSizes(inp_ATOM *at, int num_at, int nAddEdges2eachAtom, int nAddVertices, T_GROUP_INFO *ti, VAL_AT *pVA, ICHICONST SRM *pSrm, ALL_TC_GROUPS *pTCGroups)
Definition ichirvr1.c:1870
int RearrangePlusMinusEdgesFlow(BN_STRUCT *pBNS, BN_DATA *pBD, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int forbidden_edge_mask)
Definition ichirvr2.c:3402
int GetTgroupInfoFromInChI(T_GROUP_INFO *ti, inp_ATOM *at, AT_NUMB *endpoint, INChI *pInChI)
Definition ichirvr1.c:575
int bMayBeACationInMobileHLayer(inp_ATOM *at, VAL_AT *pVA, int iat, int bMobileH)
Definition ichirvr1.c:749
int bInpInchiComponentDeleted(InpInChI *pOneInput, int iInChI, int bMobileH, int k)
Definition ichiread.c:1819
int DisplayOneRestoredComponent(struct tagCANON_GLOBALS *pCG, StrFromINChI *pStruct, inp_ATOM *at, int iComponent, int nNumComponents, int bMobileH, const char *szCurHdr)
int FillOutCompareMessage(char *szMsg, int nLenMsg, INCHI_MODE bits[])
Definition ichirvr7.c:3168
int MergeStructureComponents(ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, long num_inp, char *szCurHdr, ICHICONST SRM *pSrm, int bReqNonTaut, StrFromINChI *pStruct[INCHI_NUM][TAUT_NUM], InpInChI *pOneInput)
Definition ichirvr7.c:406
int GetAtomRestoreInfo(struct tagCANON_GLOBALS *pCG, inp_ATOM *atom, int iat, VAL_AT *pVArray, ICHICONST SRM *pSrm, int bMobileH, AT_NUMB *endpoint)
Definition ichirvr1.c:912
int AddRadicalToMetal(int *tot_st_cap, int *tot_st_flow, ICHICONST SRM *pSrm, BN_STRUCT *pBNS, ALL_TC_GROUPS *pTCGroups)
Definition ichirvr1.c:2706
int CheckAndRefixStereobonds(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr4.c:1678
int MovePlusFromS2DiaminoCarbon(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
Definition ichirvr2.c:3735
int OutputInChIOutOfStrFromINChI(struct tagINCHI_CLOCK *ic, struct tagCANON_GLOBALS *pCG, ICHICONST INPUT_PARMS *ip_inp, STRUCT_DATA *sd_inp, long num_inp, int bINChIOutputOptions, INCHI_IOSTREAM *pout, INCHI_IOSTREAM *plog, InpInChI *pOneInput, int bHasSomeFixedH, unsigned char save_opt_bits)
Definition ichirvr1.c:5884
int BondFlowMaxcapMinorder(inp_ATOM *atom, VAL_AT *pVA, ICHICONST SRM *pSrm, int iat, int ineigh, int *pnMaxcap, int *pnMinorder, int *pbNeedsFlower)
Definition ichirvr1.c:1690
int DisconnectedConnectedH(inp_ATOM *at, int num_atoms, int num_deleted_H)
Definition ichirvr1.c:5591
int CopyBnsToAtom(StrFromINChI *pStruct, BN_STRUCT *pBNS, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, int bAllowZeroBondOrder)
Definition ichirvr2.c:979
int ConnectSuperCGroup(int nTCG_Plus, int nAddGroups[], int num_add, int *pcur_num_vertices, int *pcur_num_edges, int *tot_st_cap, int *tot_st_flow, BN_STRUCT *pBNS, ALL_TC_GROUPS *pTCGroups)
Definition ichirvr1.c:3058
struct tagStructFromInChI StrFromINChI
int AddProtonAndIsoHBalanceToMobHStruct(struct tagINCHI_CLOCK *ic, struct tagCANON_GLOBALS *pCG, ICHICONST INPUT_PARMS *ip, STRUCT_DATA *sd, long num_inp, int bHasSomeFixedH, char *szCurHdr, StrFromINChI *pStruct[INCHI_NUM][TAUT_NUM], InpInChI *pOneInput)
Definition ichirvr7.c:1179
int SetStereoBondTypeFor0DParity(inp_ATOM *at, int i1, int m1)
Definition ichirvr2.c:790
const int cnListNumEl
Definition ichirvr1.c:504
int FixAddProtonForADP(BN_STRUCT *pBNS, BN_DATA *pBD, StrFromINChI *pStruct, inp_ATOM *at, inp_ATOM *at2, inp_ATOM *atf, VAL_AT *pVA, ALL_TC_GROUPS *pTCGroups, ICR *picr, int *pnNumRunBNS, int *pnTotalDelta, int forbidden_edge_mask)
void RemoveFixHInChIIdentical2MobH(InpInChI *pOneInput)
Definition ichirvr7.c:256
struct tagEdgeCapFlow ECF
unsigned short AT_NUMB
Definition ichisize.h:45
unsigned short AT_RANK
Definition ichisize.h:46
signed short NUM_H
Definition ichisize.h:49
unsigned long INCHI_MODE
Definition ichisize.h:60
signed char S_CHAR
Definition inchi_api.h:113
#define NUM_H_ISOTOPES
Definition inchi_api.h:107
unsigned char U_CHAR
Definition inchi_api.h:114
#define INCHI_NUM
Definition inchi_api.h:1179
#define MAX_NUM_STEREO_BONDS
Definition inchi_api.h:1176
signed short S_SHORT
Definition inchi_api.h:119
#define MAX_NUM_STEREO_ATOM_NEIGH
Definition inchi_api.h:1173
#define TAUT_NUM
Definition mode.h:593
Definition ichi_bns.h:286
Definition ichi_bns.h:233
Definition ichi_bns.h:190
Definition ichi_bns.h:214
Definition inpdef.h:240
Definition inpdef.h:274
Definition ichirvrs.h:245
int num_tgroup_edges
Definition ichirvrs.h:256
int tgroup_charge
Definition ichirvrs.h:258
int nEdgePlus
Definition ichirvrs.h:270
TC_GROUP * pTCG
Definition ichirvrs.h:246
int max_tc_groups
Definition ichirvrs.h:248
int iAtNoOffset
Definition ichirvrs.h:273
int nVertices
Definition ichirvrs.h:250
int num_tc_groups
Definition ichirvrs.h:247
int nEdgeMinus
Definition ichirvrs.h:271
int total_charge
Definition ichirvrs.h:261
int added_charge
Definition ichirvrs.h:260
int nGroup[NUM_TCGROUP_TYPES]
Definition ichirvrs.h:249
int nEdges
Definition ichirvrs.h:251
int num_tgroups
Definition ichirvrs.h:255
int num_atoms
Definition ichirvrs.h:253
int nEdge4charge
Definition ichirvrs.h:269
int num_metal_atoms
Definition ichirvrs.h:265
int iComponent
Definition ichirvrs.h:272
int nAddIedges
Definition ichirvrs.h:252
int total_electrons_metals
Definition ichirvrs.h:263
int total_electrons
Definition ichirvrs.h:262
int num_metal_bonds
Definition ichirvrs.h:266
int num_bonds
Definition ichirvrs.h:254
int charge_on_atoms
Definition ichirvrs.h:259
Definition ichirvrs.h:168
char cMaxFlowToMetal
Definition ichirvrs.h:176
int nCMinusGroupEdge
Definition ichirvrs.h:184
char cMetal
Definition ichirvrs.h:171
char cInitFreeValences
Definition ichirvrs.h:177
S_CHAR cnListIndex
Definition ichirvrs.h:183
char cMinRingSize
Definition ichirvrs.h:181
S_CHAR cInitCharge
Definition ichirvrs.h:178
char cNumBondsToMetal
Definition ichirvrs.h:172
char cInitFlowToMetal
Definition ichirvrs.h:173
char cNumValenceElectrons
Definition ichirvrs.h:179
int nCPlusGroupEdge
Definition ichirvrs.h:185
char cInitValenceToMetal
Definition ichirvrs.h:174
char cPeriodicRowNumber
Definition ichirvrs.h:180
char cDoNotAddH
Definition ichirvrs.h:170
U_CHAR cPeriodicNumber
Definition ichirvrs.h:182
int nTautGroupEdge
Definition ichirvrs.h:187
int nMetalGroupEdge
Definition ichirvrs.h:186
char cInitOrigValenceToMetal
Definition ichirvrs.h:175
Definition ichirvrs.h:493
S_CHAR nMobHInChI
Definition ichirvrs.h:501
U_CHAR nValElectr
Definition ichirvrs.h:497
S_CHAR nFixHInChI
Definition ichirvrs.h:499
S_CHAR nMobHRevrs
Definition ichirvrs.h:502
U_CHAR nPeriodNum
Definition ichirvrs.h:498
AT_NUMB endptRevrs
Definition ichirvrs.h:495
S_CHAR nValue
Definition ichirvrs.h:505
S_CHAR nAtChargeRevrs
Definition ichirvrs.h:504
S_CHAR nFixHRevrs
Definition ichirvrs.h:500
AT_NUMB atomNumber
Definition ichirvrs.h:496
AT_NUMB endptInChI
Definition ichirvrs.h:494
S_CHAR nNumHRevrs
Definition ichirvrs.h:503
Definition ichirvrs.h:535
U_CHAR nValElectr
Definition ichirvrs.h:539
S_CHAR nAtChargeRevrs
Definition ichirvrs.h:544
S_CHAR nValue
Definition ichirvrs.h:545
U_CHAR nPeriodNum
Definition ichirvrs.h:540
AT_NUMB atomNumber
Definition ichirvrs.h:538
AT_NUMB endptInChI
Definition ichirvrs.h:536
S_CHAR nMobHRevrs
Definition ichirvrs.h:542
AT_NUMB endptRevrs
Definition ichirvrs.h:537
S_CHAR nMobHInChI
Definition ichirvrs.h:541
S_CHAR nNumHRevrs
Definition ichirvrs.h:543
Definition ichirvrs.h:97
AT_RANK * nAtomLevel
Definition ichirvrs.h:99
int num_at
Definition ichirvrs.h:101
S_CHAR * cSource
Definition ichirvrs.h:100
QUEUE * q
Definition ichirvrs.h:98
AT_RANK min_ring_size
Definition ichirvrs.h:102
Definition ichicant.h:338
Definition ichirvrs.h:305
char cMetal
Definition ichirvrs.h:309
char chem_valence
Definition ichirvrs.h:308
char cNumValenceElectrons
Definition ichirvrs.h:311
char num_bonds
Definition ichirvrs.h:307
char cNumBondsToMetal
Definition ichirvrs.h:310
Vertex iat
Definition ichirvrs.h:306
char cPeriodicRowNumber
Definition ichirvrs.h:312
char cNumChargeStates
Definition ichirvrs.h:313
U_CHAR el_number
Definition ichirvrs.h:314
Definition ichirvrs.h:481
int len
Definition ichirvrs.h:485
int nInitialCharge
Definition ichirvrs.h:484
int bits
Definition ichirvrs.h:483
MY_CONST C_NODE * pCN
Definition ichirvrs.h:482
Definition ichirvrs.h:445
VCF v
Definition ichirvrs.h:446
ECF e[MAX_CN_VAL]
Definition ichirvrs.h:447
Definition ichirvrs.h:297
int nCharge
Definition ichirvrs.h:299
int nValence
Definition ichirvrs.h:298
int nValenceOrderingNumber
Definition ichirvrs.h:300
Definition ichirvrs.h:439
S_CHAR flow
Definition ichirvrs.h:443
S_CHAR cap
Definition ichirvrs.h:441
S_CHAR bForbiddenEdge
Definition ichirvrs.h:442
S_SHORT neigh
Definition ichirvrs.h:440
Definition ichirvrs.h:280
EdgeIndex * pnEdges
Definition ichirvrs.h:283
int num_alloc
Definition ichirvrs.h:281
int num_edges
Definition ichirvrs.h:282
Definition ichitime.h:85
Definition ichi.h:267
Definition ichi.h:122
Definition ichi.h:209
Definition strutil.h:189
Definition ichirvrs.h:110
S_CHAR bUsed0DParity
Definition ichirvrs.h:112
S_CHAR sn_ord[MAX_NUM_STEREO_BONDS]
Definition ichirvrs.h:119
AT_NUMB sn_orig_at_num[MAX_NUM_STEREO_BONDS]
Definition ichirvrs.h:123
S_CHAR p_parity
Definition ichirvrs.h:114
S_CHAR sb_ord[MAX_NUM_STEREO_BONDS]
Definition ichirvrs.h:117
AT_NUMB p_orig_at_num[MAX_NUM_STEREO_ATOM_NEIGH]
Definition ichirvrs.h:115
S_CHAR sb_parity[MAX_NUM_STEREO_BONDS]
Definition ichirvrs.h:122
Definition inpdef.h:406
Definition inpdef.h:110
Definition ichirvrs.h:332
int s[INCHI_NUM][TAUT_NUM][2]
Definition ichirvrs.h:336
inp_ATOM * atom
Definition ichirvrs.h:339
long num_inp
Definition ichirvrs.h:338
int num_explicit_H
Definition ichirvrs.h:341
int valid_polymer
Definition ichirvrs.h:346
REM_PROTONS nNumProtons[INCHI_NUM][TAUT_NUM]
Definition ichirvrs.h:335
OAD_Polymer * polymer
Definition ichirvrs.h:344
INCHI_MODE CompareInchiFlags[INCHI_NUM][TAUT_NUM]
Definition ichirvrs.h:342
INChI * pInpInChI[INCHI_NUM][TAUT_NUM]
Definition ichirvrs.h:333
int num_atoms
Definition ichirvrs.h:340
OAD_V3000 * v3000
Definition ichirvrs.h:345
int nNumComponents[INCHI_NUM][TAUT_NUM]
Definition ichirvrs.h:334
Definition ichidrp.h:120
NUM_H nNumRemovedIsotopicH[NUM_H_ISOTOPES]
Definition ichirvrs.h:319
NUM_H nNumRemovedProtons
Definition ichirvrs.h:318
Definition mode.h:1030
Definition ichiring.h:56
Definition ichirvrs.h:323
NUM_H nNumRemovedIsotopicH[NUM_H_ISOTOPES]
Definition ichirvrs.h:326
COMPONENT_REM_PROTONS * pNumProtons
Definition ichirvrs.h:329
NUM_H nNumRemovedProtons
Definition ichirvrs.h:325
Definition ichirvrs.h:87
int nRetVal
Definition ichirvrs.h:91
PINChI2 * pINChI[INCHI_NUM]
Definition ichirvrs.h:88
int num_components[INCHI_NUM]
Definition ichirvrs.h:90
PINChI_Aux2 * pINChI_Aux[INCHI_NUM]
Definition ichirvrs.h:89
Definition ichirvrs.h:508
short nNumTgMInChI
Definition ichirvrs.h:519
S_CHAR nChargeFixHRevrsNonMetal
Definition ichirvrs.h:527
short nNumTgDiffMinus
Definition ichirvrs.h:517
char bHasDifference
Definition ichirvrs.h:530
short nNumRemHRevrs
Definition ichirvrs.h:512
S_CHAR nChargeMobHInChI
Definition ichirvrs.h:524
short nNumEndpRevrs
Definition ichirvrs.h:516
S_CHAR nChargeFixHRevrs
Definition ichirvrs.h:525
short nNumRemHInChI
Definition ichirvrs.h:511
short nNumTgRevrs
Definition ichirvrs.h:514
short len_c2at
Definition ichirvrs.h:510
CMP2FHATOMS c2at[MAX_DIFF_FIXH]
Definition ichirvrs.h:509
short nNumTgHInChI
Definition ichirvrs.h:520
U_CHAR nNumDiffMobH
Definition ichirvrs.h:531
char bFixedHLayerExistsRevrs
Definition ichirvrs.h:529
short nNumTgMRevrs
Definition ichirvrs.h:521
S_CHAR nChargeMobHRevrsNonMetal
Definition ichirvrs.h:528
S_CHAR nChargeFixHInChI
Definition ichirvrs.h:523
short nNumTgDiffH
Definition ichirvrs.h:518
short nNumEndpInChI
Definition ichirvrs.h:515
short nNumTgHRevrs
Definition ichirvrs.h:522
short nNumTgInChI
Definition ichirvrs.h:513
S_CHAR nChargeMobHRevrs
Definition ichirvrs.h:526
Definition ichirvrs.h:548
short nNumTgORevrs
Definition ichirvrs.h:567
short nNumTgDBNRevrs
Definition ichirvrs.h:579
short nNumTgDBNInChI
Definition ichirvrs.h:590
short nNumTgRevrs
Definition ichirvrs.h:554
short nNumRemHRevrs
Definition ichirvrs.h:552
char bFixedHLayerExistsRevrs
Definition ichirvrs.h:595
short nNumEndpInChI
Definition ichirvrs.h:555
short nNumTgNHRevrs
Definition ichirvrs.h:575
short nNumTgDBNHInChI
Definition ichirvrs.h:588
short nNumTgDiffH
Definition ichirvrs.h:558
short nNumTgDBNHRevrs
Definition ichirvrs.h:577
short nNumTgNH2Revrs
Definition ichirvrs.h:576
short nNumTgDBNMinusInChI
Definition ichirvrs.h:589
short nNumTgOMinusInChI
Definition ichirvrs.h:581
short nNumTgOHInChI
Definition ichirvrs.h:582
S_CHAR nChargeMobHRevrsNonMetal
Definition ichirvrs.h:594
S_CHAR nChargeMobHRevrs
Definition ichirvrs.h:593
short nNumTgNRevrs
Definition ichirvrs.h:568
short nNumTgNH2InChI
Definition ichirvrs.h:587
U_CHAR nNumDiffMobH
Definition ichirvrs.h:597
short nNumTgNMinusInChI
Definition ichirvrs.h:584
short nNumTgMInChI
Definition ichirvrs.h:560
short nNumTgDiffMinus
Definition ichirvrs.h:557
short nNumTgNInChI
Definition ichirvrs.h:563
short nNumTgNMinusRevrs
Definition ichirvrs.h:573
short nNumTgInChI
Definition ichirvrs.h:553
char bHasDifference
Definition ichirvrs.h:596
S_CHAR nChargeMobHInChI
Definition ichirvrs.h:592
short nNumTgHRevrs
Definition ichirvrs.h:566
short nNumTgOInChI
Definition ichirvrs.h:562
short nNumRemHInChI
Definition ichirvrs.h:551
short nNumEndpRevrs
Definition ichirvrs.h:556
short nNumTgDBNMinusRevrs
Definition ichirvrs.h:578
short nNumTgNHMinusRevrs
Definition ichirvrs.h:574
CMP2MHATOMS c2at[MAX_DIFF_FIXH]
Definition ichirvrs.h:549
short nNumTgHInChI
Definition ichirvrs.h:561
short nNumTgOHRevrs
Definition ichirvrs.h:571
short nNumTgMRevrs
Definition ichirvrs.h:565
short nNumTgNHMinusInChI
Definition ichirvrs.h:585
short nNumTgNHInChI
Definition ichirvrs.h:586
short nNumTgOMinusRevrs
Definition ichirvrs.h:570
short len_c2at
Definition ichirvrs.h:550
short nNumTgDBORevrs
Definition ichirvrs.h:572
short nNumTgDBOInChI
Definition ichirvrs.h:583
Definition ichimain.h:77
Definition ichirvrs.h:349
AT_NUMB * nAtno2Canon[TAUT_NUM]
Definition ichirvrs.h:394
char bMobileH
Definition ichirvrs.h:372
char iMobileH
Definition ichirvrs.h:400
BFS_Q * pbfsq
Definition ichirvrs.h:406
char iINCHI
Definition ichirvrs.h:373
int nError
Definition ichirvrs.h:397
int bPostProcessed
Definition ichirvrs.h:410
int nRemovedProtonsByNormFromRevrs
Definition ichirvrs.h:378
int nChargeRevrs
Definition ichirvrs.h:413
int num_atoms
Definition ichirvrs.h:360
INChI_Aux * pOneINChI_Aux[TAUT_NUM]
Definition ichirvrs.h:387
S_CHAR * fixed_H
Definition ichirvrs.h:358
T_GROUP_INFO ti
Definition ichirvrs.h:356
int nNumRemovedProtons
Definition ichirvrs.h:392
AT_NUMB * nCanon2Atno[TAUT_NUM]
Definition ichirvrs.h:395
int n_pzz
Definition ichirvrs.h:417
int nLink
Definition ichirvrs.h:409
char bDeleted
Definition ichirvrs.h:401
INP_ATOM_DATA * pOne_norm_data[TAUT_NUM]
Definition ichirvrs.h:388
char iInchiRec
Definition ichirvrs.h:399
S_CHAR charge
Definition ichirvrs.h:363
int bExtract
Definition ichirvrs.h:383
int nChargeInChI
Definition ichirvrs.h:414
char bFixedHExists
Definition ichirvrs.h:374
inp_ATOM * at
Definition ichirvrs.h:351
inp_ATOM_STEREO * st
Definition ichirvrs.h:352
ICHICONST SRM * pSrm
Definition ichirvrs.h:369
REV_INCHI RevInChI
Definition ichirvrs.h:377
inp_ATOM * at2
Definition ichirvrs.h:353
S_CHAR * pOne_fixed_H
Definition ichirvrs.h:389
char bIsotopic
Definition ichirvrs.h:364
BN_STRUCT * pBNS
Definition ichirvrs.h:367
int nNumRemovedProtonsByRevrs
Definition ichirvrs.h:380
T_GROUP_INFO One_ti
Definition ichirvrs.h:390
int nNumRemovedProtonsMobHInChI
Definition ichirvrs.h:362
int n_zy
Definition ichirvrs.h:416
BN_DATA * pBD
Definition ichirvrs.h:368
int num_deleted_H
Definition ichirvrs.h:361
long num_inp_actual
Definition ichirvrs.h:403
int nOneINChI_bMobileH
Definition ichirvrs.h:391
INChI * pOneINChI[TAUT_NUM]
Definition ichirvrs.h:386
VAL_AT * pVA
Definition ichirvrs.h:407
XYZ_COORD * pXYZ
Definition ichirvrs.h:359
AT_NUMB * endpoint
Definition ichirvrs.h:357
Definition ichirvrs.h:69
int nMetalMinBondOrder
Definition ichirvrs.h:72
int nMetalInitEdgeFlow
Definition ichirvrs.h:73
int nMetalInitBondOrder
Definition ichirvrs.h:75
int nMetalMaxCharge_D
Definition ichirvrs.h:81
int nMetal2EndpointInitBondOrder
Definition ichirvrs.h:78
int nMetalFlowerParam_D
Definition ichirvrs.h:80
int nMetal2EndpointInitEdgeFlow
Definition ichirvrs.h:79
int nMetal2EndpointMinBondOrder
Definition ichirvrs.h:77
int bFixStereoBonds
Definition ichirvrs.h:84
int bMetalAddFlower
Definition ichirvrs.h:70
int bStereoRemovesMetalFlag
Definition ichirvrs.h:82
Definition ichirvrs.h:198
short tg_num_Minus
Definition ichirvrs.h:214
int nBackwardEdge
Definition ichirvrs.h:210
short tg_RestoreFlags
Definition ichirvrs.h:216
int nVertexNumber
Definition ichirvrs.h:207
int ord_num
Definition ichirvrs.h:200
int st_flow
Definition ichirvrs.h:204
int num_edges
Definition ichirvrs.h:201
int type
Definition ichirvrs.h:199
int st_cap
Definition ichirvrs.h:203
int nForwardEdge
Definition ichirvrs.h:208
short tg_num_H
Definition ichirvrs.h:213
int edges_flow
Definition ichirvrs.h:206
Vertex tg_set_Minus
Definition ichirvrs.h:215
int edges_cap
Definition ichirvrs.h:205
Definition ichitaut.h:222
Definition ichirvrs.h:433
S_CHAR valence
Definition ichirvrs.h:437
S_SHORT type
Definition ichirvrs.h:434
S_CHAR cap
Definition ichirvrs.h:435
S_CHAR flow
Definition ichirvrs.h:436
Definition ichirvrs.h:65
double xyz[3]
Definition ichirvrs.h:66