rino 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +44 -0
- data/Rakefile +123 -0
- data/ext/extconf.rb +26 -0
- data/ext/ruby_inchi_main.so +0 -0
- data/ext/src/aux2atom.h +2786 -0
- data/ext/src/comdef.h +148 -0
- data/ext/src/e_0dstereo.c +3014 -0
- data/ext/src/e_0dstereo.h +31 -0
- data/ext/src/e_comdef.h +57 -0
- data/ext/src/e_ctl_data.h +147 -0
- data/ext/src/e_ichi_io.c +498 -0
- data/ext/src/e_ichi_io.h +40 -0
- data/ext/src/e_ichi_parms.c +37 -0
- data/ext/src/e_ichi_parms.h +41 -0
- data/ext/src/e_ichicomp.h +50 -0
- data/ext/src/e_ichierr.h +40 -0
- data/ext/src/e_ichimain.c +593 -0
- data/ext/src/e_ichisize.h +43 -0
- data/ext/src/e_inchi_atom.c +75 -0
- data/ext/src/e_inchi_atom.h +33 -0
- data/ext/src/e_inpdef.h +41 -0
- data/ext/src/e_mode.h +706 -0
- data/ext/src/e_mol2atom.c +649 -0
- data/ext/src/e_readinch.c +58 -0
- data/ext/src/e_readmol.c +54 -0
- data/ext/src/e_readmol.h +180 -0
- data/ext/src/e_readstru.c +251 -0
- data/ext/src/e_readstru.h +33 -0
- data/ext/src/e_util.c +284 -0
- data/ext/src/e_util.h +61 -0
- data/ext/src/extr_ct.h +251 -0
- data/ext/src/ichi.h +206 -0
- data/ext/src/ichi_bns.c +7999 -0
- data/ext/src/ichi_bns.h +231 -0
- data/ext/src/ichican2.c +5000 -0
- data/ext/src/ichicano.c +2195 -0
- data/ext/src/ichicano.h +49 -0
- data/ext/src/ichicans.c +1625 -0
- data/ext/src/ichicant.h +379 -0
- data/ext/src/ichicomn.h +260 -0
- data/ext/src/ichicomp.h +50 -0
- data/ext/src/ichidrp.h +119 -0
- data/ext/src/ichierr.h +124 -0
- data/ext/src/ichiisot.c +101 -0
- data/ext/src/ichilnct.c +286 -0
- data/ext/src/ichimain.h +132 -0
- data/ext/src/ichimak2.c +1189 -0
- data/ext/src/ichimake.c +3812 -0
- data/ext/src/ichimake.h +205 -0
- data/ext/src/ichimap1.c +851 -0
- data/ext/src/ichimap2.c +2856 -0
- data/ext/src/ichimap4.c +1609 -0
- data/ext/src/ichinorm.c +741 -0
- data/ext/src/ichinorm.h +67 -0
- data/ext/src/ichiparm.c +45 -0
- data/ext/src/ichiparm.h +1441 -0
- data/ext/src/ichiprt1.c +3612 -0
- data/ext/src/ichiprt2.c +1511 -0
- data/ext/src/ichiprt3.c +3011 -0
- data/ext/src/ichiqueu.c +1003 -0
- data/ext/src/ichiring.c +326 -0
- data/ext/src/ichiring.h +49 -0
- data/ext/src/ichisize.h +35 -0
- data/ext/src/ichisort.c +539 -0
- data/ext/src/ichister.c +3538 -0
- data/ext/src/ichister.h +35 -0
- data/ext/src/ichitaut.c +3843 -0
- data/ext/src/ichitaut.h +387 -0
- data/ext/src/ichitime.h +74 -0
- data/ext/src/inchi_api.h +670 -0
- data/ext/src/inchi_dll.c +1480 -0
- data/ext/src/inchi_dll.h +34 -0
- data/ext/src/inchi_dll_main.c +23 -0
- data/ext/src/inchi_dll_main.h +31 -0
- data/ext/src/inpdef.h +328 -0
- data/ext/src/lreadmol.h +1246 -0
- data/ext/src/mode.h +706 -0
- data/ext/src/ruby_inchi_main.c +558 -0
- data/ext/src/runichi.c +4179 -0
- data/ext/src/strutil.c +3861 -0
- data/ext/src/strutil.h +182 -0
- data/ext/src/util.c +1130 -0
- data/ext/src/util.h +85 -0
- data/lib/clean_tempfile.rb +220 -0
- data/lib/rino.rb +111 -0
- data/test/test.rb +386 -0
- metadata +130 -0
data/ext/src/ichitaut.h
ADDED
@@ -0,0 +1,387 @@
|
|
1
|
+
/*
|
2
|
+
* International Union of Pure and Applied Chemistry (IUPAC)
|
3
|
+
* International Chemical Identifier (InChI)
|
4
|
+
* Version 1
|
5
|
+
* Software version 1.00
|
6
|
+
* April 13, 2005
|
7
|
+
* Developed at NIST
|
8
|
+
*/
|
9
|
+
|
10
|
+
#ifndef __INCHITAUT_H__
|
11
|
+
#define __INCHITAUT_H__
|
12
|
+
|
13
|
+
#include "inpdef.h"
|
14
|
+
#include "ichi_bns.h"
|
15
|
+
|
16
|
+
/*******************************************************
|
17
|
+
--- Header of tautomers groups ---
|
18
|
+
--- Each entry is AT_TAUTOMER_HDR type ---
|
19
|
+
number of tautomer groups (nNumTautGroups)
|
20
|
+
index of the first tautomer group (#1)
|
21
|
+
...
|
22
|
+
index of the last tautomer group (#nNumTautGroups)
|
23
|
+
--- end of the Header of tautomers groups description ---
|
24
|
+
|
25
|
+
--- One endpoint group description ---
|
26
|
+
--- Each entry has AT_TAUTOMER type members ---
|
27
|
+
<fixed portion (6 entries)>
|
28
|
+
number of endpoints (0=end of list)
|
29
|
+
number of mobile groups, including number of negative charges (=num(H)+num(-))
|
30
|
+
number of negative charges
|
31
|
+
number of 1H atoms
|
32
|
+
number of 2H (deuterium) atoms
|
33
|
+
number of 3H (tritium) atoms
|
34
|
+
<variable portion, sorted in ascending order>
|
35
|
+
atom rank #1 (ascending order)
|
36
|
+
...
|
37
|
+
atom rank #endpoints
|
38
|
+
--- end of the endpoint group description ----
|
39
|
+
|
40
|
+
----------------------------------------------
|
41
|
+
Note:
|
42
|
+
In the following Linear CT Tautomer descriptions
|
43
|
+
we assume the tautomeric groups and the endpoints
|
44
|
+
within them have been properly sorted
|
45
|
+
|
46
|
+
--------- Linear CT Tautomer description -----
|
47
|
+
<for each tautomeric group>
|
48
|
+
-- fixed length part, non-isotopic --
|
49
|
+
number of endpoints = t_group->nNumEndpoints
|
50
|
+
number of mobile atoms = t_group->num[0]
|
51
|
+
...
|
52
|
+
number of negative charges = t_group->num[T_NUM_NO_ISOTOPIC-1]
|
53
|
+
-- fixed length part, isotopic --
|
54
|
+
number of T (3H) = t_group->num[T_NUM_NO_ISOTOPIC]
|
55
|
+
...
|
56
|
+
number of 1H = t_group->num[T_NUM_NO_ISOTOPIC+T_NUM_ISOTOPIC-1]
|
57
|
+
-- variable length part --
|
58
|
+
rank of the first endpoint = nRank[t_group_info->nEndpointAtomNumber[t_group->nFirstEndpointAtNoPos]];
|
59
|
+
...
|
60
|
+
rank of the last endpoint = nRank[t_group_info->nEndpointAtomNumber[t_group->nFirstEndpointAtNoPos+t_group->nNumEndpoints-1]];
|
61
|
+
|
62
|
+
--------- Linear CT Isotopic Tautomer description -----
|
63
|
+
<for each isotopic tautomeric group>
|
64
|
+
number of T (3H) = t_group->num[T_NUM_NO_ISOTOPIC]
|
65
|
+
...
|
66
|
+
number of 1H = t_group->num[T_NUM_NO_ISOTOPIC+T_NUM_ISOTOPIC-1]
|
67
|
+
t-group ordering number in the Linear CT Tautomer, starts from 1
|
68
|
+
|
69
|
+
***************************************************************/
|
70
|
+
|
71
|
+
|
72
|
+
#define T_NUM_NO_ISOTOPIC 2
|
73
|
+
#define T_NUM_ISOTOPIC NUM_H_ISOTOPES /* was 2, now 3 */
|
74
|
+
|
75
|
+
#define T_GROUP_HDR_LEN (1+T_NUM_NO_ISOTOPIC /*+T_NUM_ISOTOPIC*/) /* LinearCTTautomer */
|
76
|
+
|
77
|
+
typedef AT_NUMB AT_TAUTOMER; /* LinearCTTautomer */
|
78
|
+
|
79
|
+
typedef AT_ISO_SORT_KEY T_GROUP_ISOWT; /* must hold value up to T_GROUP_ISOWT_MULT^3-1 */
|
80
|
+
/* similar to AT_ISO_SORT_KEY */
|
81
|
+
/* = num_1H + T_GROUP_ISOWT_MULT*(num_D + T_GROUP_ISOWT_MULT*num_T) */
|
82
|
+
|
83
|
+
|
84
|
+
#define T_GROUP_ISOWT_MULT 1024 /* (max. number of identical isotopic hydrogens in a taut. group) + 1 */
|
85
|
+
/* changed from 256U 9-12-2003 */
|
86
|
+
/* (similar to AT_ISO_SORT_KEY_MULT ) */
|
87
|
+
/* note: (long)T_GROUP_ISOWT should always be positive (have zero sign bit) */
|
88
|
+
|
89
|
+
typedef struct tagIsotopicTautomerGroup {
|
90
|
+
AT_NUMB tgroup_num; /* ordering number of a tautomer group with isotopes > 0 */
|
91
|
+
/*
|
92
|
+
union {
|
93
|
+
struct {
|
94
|
+
AT_NUMB num_T;
|
95
|
+
AT_NUMB num_D;
|
96
|
+
AT_NUMB num_1H;
|
97
|
+
};
|
98
|
+
AT_NUMB num[T_NUM_ISOTOPIC];
|
99
|
+
};
|
100
|
+
*/
|
101
|
+
AT_NUMB num[T_NUM_ISOTOPIC]; /* inverted order: num_T, num_D, num_1H */
|
102
|
+
} AT_ISO_TGROUP;
|
103
|
+
|
104
|
+
typedef enum tagTG_NumDA { /* 2004-02-26 */
|
105
|
+
TG_Num_dH, /* number of H donors that have only H (all single bonds) */
|
106
|
+
TG_Num_dM, /* number of H donors that have (-) (all single bonds) */
|
107
|
+
TG_Num_aH, /* number of H acceptors that have H and no (-) (+a double bond) */
|
108
|
+
TG_Num_aM, /* number of H acceptors that have (-) and possibly H (+ one double bond) */
|
109
|
+
TG_Num_dO, /* number of H donors =C-OH or =C-O(-) */
|
110
|
+
TG_Num_aO, /* number of H acceptors -C=O */
|
111
|
+
TG_NUM_DA /* number of elements in an array */
|
112
|
+
} TGNUMDA;
|
113
|
+
|
114
|
+
typedef struct tagTautomerGroup {
|
115
|
+
/*
|
116
|
+
union {
|
117
|
+
struct {
|
118
|
+
// T_NUM_NO_ISOTOPIC = 2 elements:
|
119
|
+
AT_RANK num_Mobile; // Num_H+num_D+num_T+num_NegCharges
|
120
|
+
AT_RANK num_NegCharges;
|
121
|
+
// T_NUM_ISOTOPIC = 3 elements
|
122
|
+
AT_RANK num_T; // here the isotopic part (num+T_NUM_NO_ISOTOPIC) starts
|
123
|
+
AT_RANK num_D;
|
124
|
+
AT_RANK num_1H;
|
125
|
+
};
|
126
|
+
AT_RANK num[T_NUM_NO_ISOTOPIC+T_NUM_ISOTOPIC]; // same size and meaning as num[] in T_ENDPOINT
|
127
|
+
};
|
128
|
+
*/
|
129
|
+
AT_RANK num[T_NUM_NO_ISOTOPIC+T_NUM_ISOTOPIC]; /* same size and meaning as num[] in T_ENDPOINT */
|
130
|
+
/* isotopic inv. order: num_T, num_D, num_1H */
|
131
|
+
AT_RANK num_DA[TG_NUM_DA];
|
132
|
+
T_GROUP_ISOWT iWeight; /* isotopic "weight" = T_GROUP_ISOWT_MULT*(T_GROUP_ISOWT_MULT*num_T + num_D)+num_1H; */
|
133
|
+
AT_NUMB nGroupNumber; /* positive tautomer group ID = atom->endpoint */
|
134
|
+
AT_NUMB nNumEndpoints; /* number of the atom numbers in T_GROUP_INFO::nEndpointAtomNumber[] */
|
135
|
+
AT_NUMB nFirstEndpointAtNoPos; /* the first index of the atom number in T_GROUP_INFO::nEndpointAtomNumber[] */
|
136
|
+
} T_GROUP;
|
137
|
+
|
138
|
+
/* offsets/num_t_groups within T_GROUP_INFO::tGroupNumber */
|
139
|
+
#define TGSO_CURR_ORDER 0 /* tGroupNumber: current sorting order */
|
140
|
+
#define TGSO_PREV_ORDER 1 /* tPrevGroupNumber: previous sorting order; symmetry rank sorting order */
|
141
|
+
/* #define TGSO_CURR_IORDER 1 */ /* tiGroupNumber: isotopic sort order */
|
142
|
+
#define TGSO_SYMM_RANK 2 /* tSymmRank: symmetry ranks (no isotopes) = min. ordering number > 0. */
|
143
|
+
#define TGSO_SORT_RANK 3 /* tSortRank: current rank (positive ordering number) */
|
144
|
+
#define TGSO_SYMM_IORDER 4 /* tiGroupNumber: isotopic symmetry rank sorting order */
|
145
|
+
#define TGSO_SYMM_IRANK 5 /* tiSymmRank: isotopic symmetry ranks */
|
146
|
+
#define TGSO_SORT_IRANK 6 /* tiSortRank: current isotopic rank (positive ordering number) */
|
147
|
+
#define TGSO_MARK_IRANK 7 /* tiMarkGroup: the min. canonical number has been mapped on the endpoint */
|
148
|
+
#define TGSO_TOTAL_LEN 8
|
149
|
+
|
150
|
+
/***************************************************/
|
151
|
+
/* flags for t_group_info->tni.bNormalizationFlags */
|
152
|
+
/***************************************************/
|
153
|
+
#define FLAG_PROTON_NPO_SIMPLE_REMOVED 0x0001
|
154
|
+
#define FLAG_PROTON_NP_HARD_REMOVED 0x0002
|
155
|
+
#define FLAG_PROTON_AC_SIMPLE_ADDED 0x0004
|
156
|
+
#define FLAG_PROTON_AC_SIMPLE_REMOVED 0x0008
|
157
|
+
#define FLAG_PROTON_AC_HARD_REMOVED 0x0010
|
158
|
+
#define FLAG_PROTON_AC_HARD_ADDED 0x0020
|
159
|
+
#define FLAG_PROTON_CHARGE_CANCEL 0x0040
|
160
|
+
#define FLAG_PROTON_SINGLE_REMOVED 0x0080
|
161
|
+
|
162
|
+
/* signifies tautomeric structure even though no t-group discovered */
|
163
|
+
#define FLAG_NORM_CONSIDER_TAUT ( FLAG_PROTON_NPO_SIMPLE_REMOVED | \
|
164
|
+
FLAG_PROTON_NP_HARD_REMOVED | \
|
165
|
+
FLAG_PROTON_AC_SIMPLE_ADDED | \
|
166
|
+
FLAG_PROTON_AC_SIMPLE_REMOVED | \
|
167
|
+
FLAG_PROTON_AC_HARD_REMOVED | \
|
168
|
+
FLAG_PROTON_AC_HARD_ADDED | \
|
169
|
+
FLAG_PROTON_SINGLE_REMOVED | \
|
170
|
+
FLAG_PROTON_CHARGE_CANCEL )
|
171
|
+
|
172
|
+
/* force salt tautomerism exploration */
|
173
|
+
#define FLAG_FORCE_SALT_TAUT ( FLAG_PROTON_NP_HARD_REMOVED | \
|
174
|
+
FLAG_PROTON_AC_HARD_REMOVED | \
|
175
|
+
FLAG_PROTON_AC_HARD_ADDED )
|
176
|
+
|
177
|
+
typedef struct tagTautomerNormInfo {
|
178
|
+
NUM_H nNumRemovedExplicitH; /* keeps track of explicit H */
|
179
|
+
NUM_H nNumRemovedProtons;
|
180
|
+
NUM_H nNumRemovedProtonsIsotopic[NUM_H_ISOTOPES];
|
181
|
+
INCHI_MODE bNormalizationFlags;
|
182
|
+
} TNI;
|
183
|
+
|
184
|
+
/***************************************************/
|
185
|
+
/* t_group_info definition */
|
186
|
+
/***************************************************/
|
187
|
+
typedef struct tagTautomerGroupsInfo {
|
188
|
+
T_GROUP *t_group; /* max_num_t_groups elements */
|
189
|
+
AT_NUMB *nEndpointAtomNumber; /* nNumEndpoints elements; also see comments to T_GROUP */
|
190
|
+
AT_NUMB *tGroupNumber;
|
191
|
+
int nNumEndpoints;
|
192
|
+
int num_t_groups;
|
193
|
+
int max_num_t_groups;
|
194
|
+
int bIgnoreIsotopic;
|
195
|
+
|
196
|
+
AT_NUMB *nIsotopicEndpointAtomNumber; /* [0]: number of the following atoms; [1...]: non-tautomeric atoms that may have isotopic H */
|
197
|
+
int nNumIsotopicEndpoints; /* allocated length of nIsotopicEndpointAtomNumber */
|
198
|
+
NUM_H num_iso_H[NUM_H_ISOTOPES]; /* isotopic H on tautomeric atoms and those in nIsotopicEndpointAtomNumber */
|
199
|
+
|
200
|
+
TNI tni;
|
201
|
+
|
202
|
+
INCHI_MODE bTautFlags;
|
203
|
+
INCHI_MODE bTautFlagsDone;
|
204
|
+
} T_GROUP_INFO;
|
205
|
+
|
206
|
+
#define CANON_FLAG_NO_H_RECANON 0x0001 /* iOther: second canonicalization of the no H structure */
|
207
|
+
#define CANON_FLAG_NO_TAUT_H_DIFF 0x0002 /* iOther: NoTautH eq. partition differs from NoH */
|
208
|
+
#define CANON_FLAG_ISO_ONLY_NON_TAUT_DIFF 0x0004 /* iOther: eq. partition in isotopic only non-taut differs from non-isotopic */
|
209
|
+
#define CANON_FLAG_ISO_TAUT_DIFF 0x0008 /* iBase: isotopic eq. partition in isotopic taut differs from non-isotopic taut */
|
210
|
+
#define CANON_FLAG_ISO_FIXED_H_DIFF 0x0010 /* iOther: isotopic eq. partition in fixed H non-taut differs from non-isotopic fixed H */
|
211
|
+
|
212
|
+
/* Note: rank of tautomer atom #i = Rank[nEndpointAtomNumber[i]] */
|
213
|
+
/* for each tautomer atom group (t_group) t_group.nFirstEndpointAtNoPos */
|
214
|
+
/* is the first index of the atom number in nEndpointAtomNumber[] */
|
215
|
+
|
216
|
+
typedef struct tagTautomerEndpoint {
|
217
|
+
/*
|
218
|
+
union {
|
219
|
+
struct {
|
220
|
+
AT_RANK num_Mobile; // Num_H+num_D+num_T+num_NegCharges
|
221
|
+
AT_RANK num_NegCharges;
|
222
|
+
AT_RANK num_T;
|
223
|
+
AT_RANK num_D;
|
224
|
+
};
|
225
|
+
AT_RANK num[T_NUM_NO_ISOTOPIC+T_NUM_ISOTOPIC]; // same size and meaning as num[] in T_GROUP
|
226
|
+
};
|
227
|
+
*/
|
228
|
+
AT_RANK num[T_NUM_NO_ISOTOPIC+T_NUM_ISOTOPIC]; /* same size and meaning as num[] in T_GROUP */
|
229
|
+
AT_RANK num_DA[TG_NUM_DA];
|
230
|
+
AT_NUMB nGroupNumber;
|
231
|
+
AT_NUMB nEquNumber; /* same for endpoints connected by alt paths */
|
232
|
+
AT_NUMB nAtomNumber;
|
233
|
+
/*AT_NUMB neighbor_index; */
|
234
|
+
} T_ENDPOINT;
|
235
|
+
|
236
|
+
typedef struct tagTautomerBondLocation {
|
237
|
+
AT_NUMB nAtomNumber;
|
238
|
+
AT_NUMB neighbor_index;
|
239
|
+
} T_BONDPOS;
|
240
|
+
|
241
|
+
typedef struct tagEndpointInfo {
|
242
|
+
S_CHAR cMoveableCharge;
|
243
|
+
S_CHAR cNeutralBondsValence;
|
244
|
+
S_CHAR cMobile;
|
245
|
+
S_CHAR cDonor;
|
246
|
+
S_CHAR cAcceptor;
|
247
|
+
} ENDPOINT_INFO;
|
248
|
+
|
249
|
+
|
250
|
+
/* positive charge group (extended onium) */
|
251
|
+
|
252
|
+
#define CHARGED_CPOINT(X,i) ((X)[i].charge==1)
|
253
|
+
|
254
|
+
typedef struct tagChargeCandidate {
|
255
|
+
AT_NUMB atnumber;
|
256
|
+
S_CHAR type;
|
257
|
+
S_CHAR subtype;
|
258
|
+
} C_CANDIDATE;
|
259
|
+
|
260
|
+
typedef struct tagChargeGroup {
|
261
|
+
AT_RANK num[2]; /* [0]: number of (+), [1]: number atoms that have H, including H accessible through tautomerism */
|
262
|
+
AT_RANK num_CPoints;
|
263
|
+
AT_NUMB nGroupNumber;
|
264
|
+
U_CHAR cGroupType;
|
265
|
+
} C_GROUP;
|
266
|
+
|
267
|
+
typedef struct tagChargeGroupsInfo {
|
268
|
+
C_GROUP *c_group;
|
269
|
+
int num_c_groups;
|
270
|
+
int max_num_c_groups;
|
271
|
+
|
272
|
+
C_CANDIDATE *c_candidate;
|
273
|
+
int max_num_candidates;
|
274
|
+
int num_candidates; /* 0=>unimitialized, -1=>no candidates found */
|
275
|
+
} C_GROUP_INFO;
|
276
|
+
|
277
|
+
/* salts */
|
278
|
+
typedef struct tagSaltChargeCandidate {
|
279
|
+
AT_NUMB atnumber;
|
280
|
+
S_CHAR type;
|
281
|
+
S_CHAR subtype;
|
282
|
+
AT_NUMB endpoint; /* MAX_ATOMS+1 => found alt path to the candidate */
|
283
|
+
} S_CANDIDATE;
|
284
|
+
|
285
|
+
typedef struct tagSaltGroupInfo {
|
286
|
+
S_CANDIDATE *s_candidate;
|
287
|
+
int max_num_candidates;
|
288
|
+
int num_candidates; /* 0=>unimitialized, -1=>no candidates found */
|
289
|
+
int num_other_candidates; /* num. non-"acidic O" candidates */
|
290
|
+
int num_p_only_candidates; /* num. non-tautomeric p-donor/acceptor candidates like -CH2-SH */
|
291
|
+
} S_GROUP_INFO;
|
292
|
+
|
293
|
+
/********************* ATOM_SIZES *******************************/
|
294
|
+
/* sizes of a component */
|
295
|
+
typedef struct tagAtomSizes {
|
296
|
+
/* for tautomeric and non-tautomeric structures */
|
297
|
+
int nMaxNumStereoAtoms; /* max. number of stereo atoms in isotopic case */
|
298
|
+
int nMaxNumStereoBonds; /* max. number of stereo bonds in isotopic case */
|
299
|
+
int num_isotopic_atoms; /* includes atoms that have isotopic tautomeric H */
|
300
|
+
int nLenCT;
|
301
|
+
int nLenBonds;
|
302
|
+
int nLenIsotopic;
|
303
|
+
int nLenCTAtOnly;
|
304
|
+
int nLenLinearCTStereoDble; /* max. number of stereo bonds in non-isotopic case */
|
305
|
+
int nLenLinearCTStereoCarb; /* max. number of stereo atoms in non-isotopic case */
|
306
|
+
/* int bHasIsotopicAtoms; */
|
307
|
+
int bMayHaveStereo;
|
308
|
+
|
309
|
+
int bIgnoreIsotopic;
|
310
|
+
|
311
|
+
/* tautomeric structure only; zeroes in non-tautomeric */
|
312
|
+
int nLenLinearCTTautomer;
|
313
|
+
int nLenLinearCTIsotopicTautomer;
|
314
|
+
int bHasIsotopicTautGroups;
|
315
|
+
int nLenIsotopicEndpoints;
|
316
|
+
|
317
|
+
} ATOM_SIZES;
|
318
|
+
|
319
|
+
|
320
|
+
typedef struct tagDfsPath {
|
321
|
+
AT_RANK at_no;
|
322
|
+
AT_RANK nDfsLevel;
|
323
|
+
U_CHAR bond_type;
|
324
|
+
S_CHAR bond_pos;
|
325
|
+
} DFS_PATH;
|
326
|
+
|
327
|
+
|
328
|
+
#ifndef INCHI_ALL_CPP
|
329
|
+
#ifdef __cplusplus
|
330
|
+
extern "C" {
|
331
|
+
#endif
|
332
|
+
#endif
|
333
|
+
|
334
|
+
int is_centerpoint_elem( U_CHAR el_number );
|
335
|
+
int is_centerpoint_elem_strict( U_CHAR el_number );
|
336
|
+
|
337
|
+
int bIsCenterPointStrict( inp_ATOM *atom, int iat );
|
338
|
+
|
339
|
+
int nGetEndpointInfo( inp_ATOM *atom, int iat, ENDPOINT_INFO *eif );
|
340
|
+
void AddAtom2DA( AT_RANK num_DA[], inp_ATOM *atom, int at_no, int bSubtract );
|
341
|
+
int AddAtom2num( AT_RANK num[], inp_ATOM *atom, int at_no, int bSubtract );
|
342
|
+
int AddEndPoint( T_ENDPOINT *pEndPoint, inp_ATOM *at, int iat );
|
343
|
+
int bHasAcidicHydrogen( inp_ATOM *at, int i );
|
344
|
+
int bHasOtherExchangableH ( inp_ATOM *at, int i );
|
345
|
+
int bHasAcidicMinus( inp_ATOM *at, int i );
|
346
|
+
|
347
|
+
|
348
|
+
int nGet15TautIn6MembAltRing( inp_ATOM *atom, int nStartAtom, AT_RANK *nBfsTreePos,
|
349
|
+
DFS_PATH *DfsPath, int nMaxLenBfsTree,
|
350
|
+
T_ENDPOINT *EndPoint, int nMaxNumEndPoint,
|
351
|
+
T_BONDPOS *BondPos, int nMaxNumBondPos,
|
352
|
+
int *pnNumEndPoint, int *pnNumBondPos,
|
353
|
+
struct BalancedNetworkStructure *pBNS,
|
354
|
+
struct BalancedNetworkData *pBD, int num_atoms );
|
355
|
+
|
356
|
+
int nGet12TautIn5MembAltRing( inp_ATOM *atom, int nStartAtom, int nStartAtomNeighbor,
|
357
|
+
AT_RANK *nBfsTreePos, DFS_PATH *DfsPath, int nMaxLenBfsTree,
|
358
|
+
T_ENDPOINT *EndPoint, int nMaxNumEndPoint,
|
359
|
+
T_BONDPOS *BondPos, int nMaxNumBondPos,
|
360
|
+
int *pnNumEndPoint, int *pnNumBondPos,
|
361
|
+
struct BalancedNetworkStructure *pBNS,
|
362
|
+
struct BalancedNetworkData *pBD, int num_atoms );
|
363
|
+
int nGet14TautIn7MembAltRing( inp_ATOM *atom, int nStartAtom, int nStartAtomNeighbor,
|
364
|
+
int nStartAtomNeighborEndpoint, int nStartAtomNeighborNeighborEndpoint,
|
365
|
+
AT_RANK *nDfsPathPos, DFS_PATH *DfsPath, int nMaxLenDfsPath,
|
366
|
+
T_ENDPOINT *EndPoint, int nMaxNumEndPoint,
|
367
|
+
T_BONDPOS *BondPos, int nMaxNumBondPos,
|
368
|
+
int *pnNumEndPoint, int *pnNumBondPos,
|
369
|
+
struct BalancedNetworkStructure *pBNS,
|
370
|
+
struct BalancedNetworkData *pBD, int num_atoms );
|
371
|
+
int nGet14TautIn5MembAltRing( inp_ATOM *atom, int nStartAtom, int nStartAtomNeighbor,
|
372
|
+
int nStartAtomNeighborEndpoint, int nStartAtomNeighborNeighborEndpoint,
|
373
|
+
AT_RANK *nDfsPathPos, DFS_PATH *DfsPath, int nMaxLenDfsPath,
|
374
|
+
T_ENDPOINT *EndPoint, int nMaxNumEndPoint,
|
375
|
+
T_BONDPOS *BondPos, int nMaxNumBondPos,
|
376
|
+
int *pnNumEndPoint, int *pnNumBondPos,
|
377
|
+
struct BalancedNetworkStructure *pBNS,
|
378
|
+
struct BalancedNetworkData *pBD, int num_atoms );
|
379
|
+
|
380
|
+
#ifndef INCHI_ALL_CPP
|
381
|
+
#ifdef __cplusplus
|
382
|
+
}
|
383
|
+
#endif
|
384
|
+
#endif
|
385
|
+
|
386
|
+
#endif /* __INCHITAUT_H__ */
|
387
|
+
|
data/ext/src/ichitime.h
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
/*
|
2
|
+
* International Union of Pure and Applied Chemistry (IUPAC)
|
3
|
+
* International Chemical Identifier (InChI)
|
4
|
+
* Version 1
|
5
|
+
* Software version 1.00
|
6
|
+
* April 13, 2005
|
7
|
+
* Developed at NIST
|
8
|
+
*/
|
9
|
+
|
10
|
+
#ifndef __ICHITIME_H__
|
11
|
+
#define __ICHITIME_H__
|
12
|
+
|
13
|
+
|
14
|
+
#ifdef INCHI_ANSI_ONLY
|
15
|
+
|
16
|
+
#ifdef __FreeBSD__
|
17
|
+
#include <sys/time.h>
|
18
|
+
#endif
|
19
|
+
|
20
|
+
/* get times() */
|
21
|
+
#ifdef INCHI_USETIMES
|
22
|
+
#include <sys/times.h>
|
23
|
+
#endif
|
24
|
+
|
25
|
+
/*#include <sys/timeb.h>*/
|
26
|
+
|
27
|
+
#include <time.h>
|
28
|
+
|
29
|
+
typedef struct tagInchiTime {
|
30
|
+
clock_t clockTime;
|
31
|
+
} inchiTime;
|
32
|
+
|
33
|
+
#else
|
34
|
+
|
35
|
+
/* Win32 _ftime(): */
|
36
|
+
#include <sys/timeb.h>
|
37
|
+
|
38
|
+
typedef struct tagInchiTime {
|
39
|
+
unsigned long clockTime; /* Time in seconds since midnight (00:00:00), January 1, 1970;
|
40
|
+
signed long overflow expected in 2038 */
|
41
|
+
long millitime; /* milliseconds */
|
42
|
+
|
43
|
+
} inchiTime;
|
44
|
+
|
45
|
+
#endif
|
46
|
+
|
47
|
+
|
48
|
+
#ifdef INCHI_MAIN
|
49
|
+
|
50
|
+
#define InchiTimeGet e_InchiTimeGet
|
51
|
+
#define InchiTimeMsecDiff e_InchiTimeMsecDiff
|
52
|
+
#define InchiTimeAddMsec e_InchiTimeAddMsec
|
53
|
+
#define bInchiTimeIsOver e_bInchiTimeIsOver
|
54
|
+
#define InchiTimeElapsed e_InchiTimeElapsed
|
55
|
+
|
56
|
+
#define FullMaxClock e_FullMaxClock
|
57
|
+
#define HalfMaxClock e_HalfMaxClock
|
58
|
+
#define MaxPositiveClock e_MaxPositiveClock
|
59
|
+
#define MinNegativeClock e_MinNegativeClock
|
60
|
+
#define HalfMaxPositiveClock e_HalfMaxPositiveClock
|
61
|
+
#define HalfMinNegativeClock e_HalfMinNegativeClock
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
#endif
|
66
|
+
|
67
|
+
void InchiTimeGet( inchiTime *TickEnd );
|
68
|
+
long InchiTimeMsecDiff( inchiTime *TickEnd, inchiTime *TickStart );
|
69
|
+
void InchiTimeAddMsec( inchiTime *TickEnd, unsigned long nNumMsec );
|
70
|
+
int bInchiTimeIsOver( inchiTime *TickEnd );
|
71
|
+
long InchiTimeElapsed( inchiTime *TickStart );
|
72
|
+
|
73
|
+
#endif /* __ICHITIME_H__ */
|
74
|
+
|