rino 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/README +44 -0
  2. data/Rakefile +123 -0
  3. data/ext/extconf.rb +26 -0
  4. data/ext/ruby_inchi_main.so +0 -0
  5. data/ext/src/aux2atom.h +2786 -0
  6. data/ext/src/comdef.h +148 -0
  7. data/ext/src/e_0dstereo.c +3014 -0
  8. data/ext/src/e_0dstereo.h +31 -0
  9. data/ext/src/e_comdef.h +57 -0
  10. data/ext/src/e_ctl_data.h +147 -0
  11. data/ext/src/e_ichi_io.c +498 -0
  12. data/ext/src/e_ichi_io.h +40 -0
  13. data/ext/src/e_ichi_parms.c +37 -0
  14. data/ext/src/e_ichi_parms.h +41 -0
  15. data/ext/src/e_ichicomp.h +50 -0
  16. data/ext/src/e_ichierr.h +40 -0
  17. data/ext/src/e_ichimain.c +593 -0
  18. data/ext/src/e_ichisize.h +43 -0
  19. data/ext/src/e_inchi_atom.c +75 -0
  20. data/ext/src/e_inchi_atom.h +33 -0
  21. data/ext/src/e_inpdef.h +41 -0
  22. data/ext/src/e_mode.h +706 -0
  23. data/ext/src/e_mol2atom.c +649 -0
  24. data/ext/src/e_readinch.c +58 -0
  25. data/ext/src/e_readmol.c +54 -0
  26. data/ext/src/e_readmol.h +180 -0
  27. data/ext/src/e_readstru.c +251 -0
  28. data/ext/src/e_readstru.h +33 -0
  29. data/ext/src/e_util.c +284 -0
  30. data/ext/src/e_util.h +61 -0
  31. data/ext/src/extr_ct.h +251 -0
  32. data/ext/src/ichi.h +206 -0
  33. data/ext/src/ichi_bns.c +7999 -0
  34. data/ext/src/ichi_bns.h +231 -0
  35. data/ext/src/ichican2.c +5000 -0
  36. data/ext/src/ichicano.c +2195 -0
  37. data/ext/src/ichicano.h +49 -0
  38. data/ext/src/ichicans.c +1625 -0
  39. data/ext/src/ichicant.h +379 -0
  40. data/ext/src/ichicomn.h +260 -0
  41. data/ext/src/ichicomp.h +50 -0
  42. data/ext/src/ichidrp.h +119 -0
  43. data/ext/src/ichierr.h +124 -0
  44. data/ext/src/ichiisot.c +101 -0
  45. data/ext/src/ichilnct.c +286 -0
  46. data/ext/src/ichimain.h +132 -0
  47. data/ext/src/ichimak2.c +1189 -0
  48. data/ext/src/ichimake.c +3812 -0
  49. data/ext/src/ichimake.h +205 -0
  50. data/ext/src/ichimap1.c +851 -0
  51. data/ext/src/ichimap2.c +2856 -0
  52. data/ext/src/ichimap4.c +1609 -0
  53. data/ext/src/ichinorm.c +741 -0
  54. data/ext/src/ichinorm.h +67 -0
  55. data/ext/src/ichiparm.c +45 -0
  56. data/ext/src/ichiparm.h +1441 -0
  57. data/ext/src/ichiprt1.c +3612 -0
  58. data/ext/src/ichiprt2.c +1511 -0
  59. data/ext/src/ichiprt3.c +3011 -0
  60. data/ext/src/ichiqueu.c +1003 -0
  61. data/ext/src/ichiring.c +326 -0
  62. data/ext/src/ichiring.h +49 -0
  63. data/ext/src/ichisize.h +35 -0
  64. data/ext/src/ichisort.c +539 -0
  65. data/ext/src/ichister.c +3538 -0
  66. data/ext/src/ichister.h +35 -0
  67. data/ext/src/ichitaut.c +3843 -0
  68. data/ext/src/ichitaut.h +387 -0
  69. data/ext/src/ichitime.h +74 -0
  70. data/ext/src/inchi_api.h +670 -0
  71. data/ext/src/inchi_dll.c +1480 -0
  72. data/ext/src/inchi_dll.h +34 -0
  73. data/ext/src/inchi_dll_main.c +23 -0
  74. data/ext/src/inchi_dll_main.h +31 -0
  75. data/ext/src/inpdef.h +328 -0
  76. data/ext/src/lreadmol.h +1246 -0
  77. data/ext/src/mode.h +706 -0
  78. data/ext/src/ruby_inchi_main.c +558 -0
  79. data/ext/src/runichi.c +4179 -0
  80. data/ext/src/strutil.c +3861 -0
  81. data/ext/src/strutil.h +182 -0
  82. data/ext/src/util.c +1130 -0
  83. data/ext/src/util.h +85 -0
  84. data/lib/clean_tempfile.rb +220 -0
  85. data/lib/rino.rb +111 -0
  86. data/test/test.rb +386 -0
  87. metadata +130 -0
@@ -0,0 +1,31 @@
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 __0DSTEREO_H__
11
+ #define __0DSTEREO_H__
12
+
13
+
14
+ #ifndef INCHI_ALL_CPP
15
+ #ifdef __cplusplus
16
+ extern "C" {
17
+ #endif
18
+ #endif
19
+
20
+
21
+ int Clear3D2Dstereo(inchi_Input *pInp);
22
+ int set_0D_stereo_parities( inchi_Input *pInp, int bPointedEdgeStereo );
23
+
24
+ #ifndef INCHI_ALL_CPP
25
+ #ifdef __cplusplus
26
+ }
27
+ #endif
28
+ #endif
29
+
30
+
31
+ #endif /* __0DSTEREO_H__ */
@@ -0,0 +1,57 @@
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
+ /* common definitions -- do not change */
11
+ #ifndef __COMDEF_H__
12
+ #define __COMDEF_H__
13
+
14
+ /* input bond type definition */
15
+ #define MIN_INPUT_BOND_TYPE INCHI_BOND_TYPE_SINGLE
16
+ #define MAX_INPUT_BOND_TYPE INCHI_BOND_TYPE_ALTERN
17
+
18
+ /* MOlfile */
19
+ #define INPUT_STEREO_SNGL_UP 1
20
+ #define INPUT_STEREO_SNGL_EITHER 4
21
+ #define INPUT_STEREO_SNGL_DOWN 6
22
+ #define INPUT_STEREO_DBLE_EITHER 3
23
+
24
+ /* radical definitions */
25
+ #define RADICAL_SINGLET 1
26
+ #define RADICAL_DOUBLET 2
27
+ #define RADICAL_TRIPLET 3
28
+
29
+
30
+ /* BILLY 8/6/04 */
31
+ #ifndef INCHI_ALL_CPP
32
+ #ifdef __cplusplus
33
+ extern "C" {
34
+ #endif
35
+ #endif
36
+
37
+
38
+
39
+ int e_AddMOLfileError( char *pStrErr, const char *szMsg );
40
+
41
+ #define MOLFILE_ERR_FIN(err, new_err, err_fin, msg) \
42
+ if ( !(err) && (new_err) ) { (err) = (new_err);} e_AddMOLfileError(pStrErr, (msg)); goto err_fin
43
+ #define MOLFILE_ERR_SET(err, new_err, msg) \
44
+ if ( !(err) && (new_err) ) { (err) = (new_err);} e_AddMOLfileError(pStrErr, (msg))
45
+
46
+
47
+
48
+
49
+ /* BILLY 8/6/04 */
50
+ #ifndef INCHI_ALL_CPP
51
+ #ifdef __cplusplus
52
+ }
53
+ #endif
54
+ #endif
55
+
56
+ #endif /* __COMDEF_H__ */
57
+
@@ -0,0 +1,147 @@
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 __CTL_DATA_H__
11
+ #define __CTL_DATA_H__
12
+ #include "e_ichisize.h"
13
+ /***********************************************/
14
+ #define STR_ERR_LEN 256
15
+
16
+ typedef struct tagStructData {
17
+ unsigned long ulStructTime;
18
+ int nErrorCode;
19
+ int nErrorType;
20
+ int nStructReadError;
21
+ int bChiralFlag;
22
+ char pStrErrStruct[STR_ERR_LEN];
23
+ long fPtrStart;
24
+ long fPtrEnd;
25
+ /* debugging info */
26
+ #if( bRELEASE_VERSION == 0 )
27
+ int bExtract;
28
+ #endif
29
+
30
+ } STRUCT_DATA;
31
+ /***********************************************/
32
+
33
+ #if( ACD_LABS_VERSION == 1 )
34
+ #define MAX_NUM_PATHS 5
35
+ #else
36
+ #define MAX_NUM_PATHS 4
37
+ #endif
38
+
39
+ /* SDF treatment */
40
+ #define MAX_SDF_VALUE 255 /* max lenght of the SDFile data value */
41
+ #define MAX_SDF_HEADER 64 /* max length of the SDFile data header */
42
+
43
+ /***********************************************/
44
+
45
+ typedef struct tagInputParms {
46
+ char szSdfDataHeader[MAX_SDF_HEADER+1];
47
+ char *pSdfLabel;
48
+ char *pSdfValue;
49
+ long lSdfId;
50
+ long lMolfileNumber;
51
+ /*#ifndef INCHI_ANSI_ONLY
52
+ DRAW_PARMS dp;
53
+ PER_DRAW_PARMS pdp;
54
+ TBL_DRAW_PARMS tdp;
55
+ #endif*/
56
+ /*
57
+ -- Files --
58
+ ip->path[0] => Input
59
+ ip->path[1] => Output (INChI)
60
+ ip->path[2] => Log
61
+ ip->path[3] => Problem structures
62
+ ip->path[4] => Errors file (ACD(
63
+
64
+ */
65
+ const char *path[MAX_NUM_PATHS];
66
+ int num_paths;
67
+ int first_struct_number;
68
+ int last_struct_number;
69
+ INPUT_TYPE nInputType;
70
+ INCHI_MODE nMode;
71
+ int bAbcNumbers;
72
+ /*int bXml;*/
73
+ int bINChIOutputOptions; /* !(ip->bINChIOutputOptions & INCHI_OUT_PLAIN_TEXT) */
74
+ int bCtPredecessors;
75
+ int bXmlStarted;
76
+ int bDisplayEachComponentINChI;
77
+
78
+ long msec_MaxTime; /* was ulMaxTime; max time to run ProsessOneStructure */
79
+ long msec_LeftTime;
80
+
81
+ unsigned long ulDisplTime;
82
+ int bDisplay;
83
+ int bMergeAllInputStructures;
84
+ int bSaveWarningStructsAsProblem;
85
+ int bSaveAllGoodStructsAsProblem;
86
+ int bGetSdfileId;
87
+ int bGetMolfileNumber; /* read molfile number from the name line like "Structure #22" */
88
+ int bCompareComponents; /* see flags CMP_COMPONENTS, etc. */
89
+ int bDisplayCompositeResults;
90
+ int bDoNotAddH;
91
+ int bNoStructLabels;
92
+ int bChiralFlag;
93
+ int bAllowEmptyStructure;
94
+ INCHI_MODE bTautFlags;
95
+ INCHI_MODE bTautFlagsDone;
96
+ } INPUT_PARMS;
97
+
98
+ /*************************** INChI mode *******************************/
99
+ /* ip->nMode */
100
+ #define REQ_MODE_BASIC 0x000001 /* B */
101
+ #define REQ_MODE_TAUT 0x000002 /* T */
102
+ #define REQ_MODE_ISO 0x000004 /* I */
103
+ #define REQ_MODE_NON_ISO 0x000008 /* NI */
104
+ #define REQ_MODE_STEREO 0x000010 /* S */
105
+ #define REQ_MODE_ISO_STEREO 0x000020 /* IS */
106
+ #define REQ_MODE_NOEQ_STEREO 0x000040 /* SS */
107
+ #define REQ_MODE_REDNDNT_STEREO 0x000080 /* RS */
108
+ #define REQ_MODE_NO_ALT_SBONDS 0x000100 /* NASB */
109
+ /* new 10-10-2003 */
110
+ #define REQ_MODE_RELATIVE_STEREO 0x000200 /* REL All Relative Stereo */
111
+ #define REQ_MODE_RACEMIC_STEREO 0x000400 /* RAC All Racemic Stereo */
112
+ #define REQ_MODE_SC_IGN_ALL_UU 0x000800 /* IAUSC Ignore stereocenters if All Undef/Unknown */
113
+ #define REQ_MODE_SB_IGN_ALL_UU 0x001000 /* IAUSC Ignore stereobonds if All Undef/Unknown */
114
+ #define REQ_MODE_CHIR_FLG_STEREO 0x002000 /* SUCF If Chiral flag then Abs otherwise Rel stereo */
115
+ /* end of 10-10-2003 */
116
+ #define REQ_MODE_MIN_SB_RING_MASK 0x0F0000 /* RSB */
117
+ #define REQ_MODE_MIN_SB_RING_SHFT 16
118
+
119
+ #define REQ_MODE_DEFAULT (REQ_MODE_BASIC | REQ_MODE_TAUT | REQ_MODE_ISO | REQ_MODE_NON_ISO | REQ_MODE_STEREO)
120
+
121
+ /*********** compare components flags **********************************/
122
+ /* ip->bCompareComponents */
123
+ #define CMP_COMPONENTS 0x0001 /* perform compare components */
124
+ #define CMP_COMPONENTS_NONISO 0x0002 /* ignore isotopic */
125
+ #define CMP_COMPONENTS_NONTAUT 0x0004 /* compare non-tautomeric */
126
+
127
+ /****************** chemical identifier member definitions *************/
128
+ /* ip->bINChIOutputOptions */
129
+ #define INCHI_OUT_NO_AUX_INFO 0x0001 /* do not output Aux Info */
130
+ #define INCHI_OUT_SHORT_AUX_INFO 0x0002 /* output short version of Aux Info */
131
+ #define INCHI_OUT_ONLY_AUX_INFO 0x0004 /* output only Aux Info */
132
+ #define INCHI_OUT_EMBED_REC 0x0008 /* embed reconnected INChI into disconnected INChI */
133
+ #define INCHI_OUT_SDFILE_ONLY 0x0010 /* save input data in a Molfile instead of creating INChI */
134
+ #define INCHI_OUT_XML 0x0020 /* output xml INChI */
135
+ #define INCHI_OUT_PLAIN_TEXT 0x0040 /* output plain text INChI */
136
+ #define INCHI_OUT_PLAIN_TEXT_COMMENTS 0x0080 /* output plain text annotation */
137
+ #define INCHI_OUT_XML_TEXT_COMMENTS 0x0100 /* output xml text annotation */
138
+ #define INCHI_OUT_WINCHI_WINDOW 0x0200 /* output into wINChI text window */
139
+ #define INCHI_OUT_TABBED_OUTPUT 0x0400 /* tab-delimited (only for plain text) */
140
+
141
+ #define FLAG_INP_AT_CHIRAL 1
142
+ #define FLAG_INP_AT_NONCHIRAL 2
143
+ #define FLAG_SET_INP_AT_CHIRAL 4
144
+ #define FLAG_SET_INP_AT_NONCHIRAL 8
145
+
146
+
147
+ #endif /* __CTL_DATA_H__ */