InChI
 
Loading...
Searching...
No Matches
ixa_mol.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 __IXA_MOL_H__
43#define __IXA_MOL_H__
44
45#include "../../../../INCHI_BASE/src/ixa.h"
46
47typedef struct
48{
49 double x;
50 double y;
51 double z;
53 int hydrogens[4];
54 int mass;
56 int charge;
58 IXA_BONDID bonds[20];
60
61
71
72
73typedef struct
74{
76 IXA_ATOMID vertices[4]; /* All currently supported topologies have 4 vertices. */
77 void* central_entity; /* Could be an atom or a bond, depending on topology. */
80
81/************************************************************************/
82/*
83 Extended input supporting v. 1.05 extensions: V3000; polymers
84 This is a later addition to native IXA intended at this time
85 just to be a carrier which transports extension data to GetINCHI()
86*/
87typedef struct INCHIMOL_SGROUP
88{
89 int id; /* it is what is called 'Sgroup number' in CTFILE */
90 int type; /* type as by MDL format (STY) */
91 int subtype; /* subtype as by MDL format (SST) */
92 int conn; /* connection scheme as by MDL format (SCN) */
93 int label; /* it is what is called 'unique Sgroup */
94 /* identifier' in CTFILE */
95 int na; /* number of atoms in the unit */
96 int nb; /* number of bonds in the unit */
97 double xbr1[4]; /* bracket ends coordinates (SDI) */
98 double xbr2[4]; /* bracket ends coordinates (SDI) */
99 char smt[80]; /* Sgroup Subscript (SMT) */
100 int *alist; /* atoms in unit (SAL) */
101 int *blist; /* bonds in unit [atom1, atom2, atom1, atom2,.. ] */
102 /* for all bonds (as made from SBL) */
104
105typedef struct INCHIMOL_POLYMER
106{
107 INCHIMOL_SGROUP **units; /* array of pointers */
108 int n;
110
111/* Extended input supporting v. 1.05 extensions: V3000; polymers */
112typedef struct INCHIMOL_V3000
113{
116 int *atom_index_orig; /* index as supplied for atoms */
117 int *atom_index_fin; /* = index or -1 for star atom */
118 int n_sgroups; /* currently, we do not use this. */
119 int n_3d_constraints; /* currently, we do not use this. */
123 int **lists_haptic_bonds; /* haptic_bonds[i] is pointer to int* which contains*/
124 /* bond_type, non-star atom number, nendpts, */
125 /* then endpts themselves */
126 /* Enhanced stereo */
128 int **lists_steabs; /* steabs[k][0] - not used */
129 /* steabs[k][1] - number of members in collection */
130 /* steabs[k][2..] - member atom numbers */
132 int **lists_sterel; /* sterel[k][0] - n from "STERELn" tag */
133 /* sterel[k][1] - number of members in collection */
134 /* sterel[k][2..] - member atom numbers */
136 int **lists_sterac; /* sterac[k][0] - n from "STERACn" tag */
137 /* sterac[k][1] - number of members in collection */
138 /* sterac[k][0] - number from "STERACn" tag */
140/************************************************************************/
141
142
143#ifdef IXA_USES_SMART_ALLOCS
144#define INCHIMOL_ATOMS_START_SIZE 128
145#define INCHIMOL_BONDS_START_SIZE 128
146#define INCHIMOL_STEREOS_START_SIZE 64
147#define INCHIMOL_MAX_ATOMS 32767
148#define INCHIMOL_MAX_BONDS INT_MAX
149#define INCHIMOL_MAX_STEREOS INT_MAX
150#define INCHIMOL_POLYMERUNITS_START_SIZE 2
151#define INCHIMOL_MAX_POLYMERUNITS INT_MAX
152
153
171#else
172typedef struct
173{
174 int atom_count;
175 INCHIMOL_ATOM *atoms;
176 int bond_count;
177 INCHIMOL_BOND* bonds;
178 int stereo_count;
179 INCHIMOL_STEREO *stereos;
180 INCHIMOL_POLYMER *polymer;
181 INCHIMOL_V3000 *v3000;
182 IXA_BOOL chiral;
183} INCHIMOL;
184#endif
185
186
188 IXA_MOL_HANDLE HMol );
189
191 IXA_MOL_HANDLE hMolecule,
192 IXA_BONDID vBond,
193 IXA_ATOMID vAtom );
194
195/****************************************************************************/
196/* Functions for treating extended input/output */
198 IXA_MOL_HANDLE hMolecule,
199 inchi_Output_Polymer *polymer,
200 inchi_Output_V3000 *v3000,
201 int nat );
202
203
204#endif
IXA_BOOL
Definition ixa.h:124
IXA_BOND_TYPE
Definition ixa.h:138
IXA_STEREO_TOPOLOGY
Definition ixa.h:160
IXA_ATOM_RADICAL
Definition ixa.h:130
IXA_DBLBOND_CONFIG
Definition ixa.h:154
IXA_STEREO_PARITY
Definition ixa.h:168
IXA_BOND_WEDGE
Definition ixa.h:146
IXA_ATOMID MOL_GetBondOtherAtom(IXA_STATUS_HANDLE hStatus, IXA_MOL_HANDLE hMolecule, IXA_BONDID vBond, IXA_ATOMID vAtom)
Definition ixa_mol.c:692
INCHIMOL * MOL_Unpack(IXA_STATUS_HANDLE hStatus, IXA_MOL_HANDLE HMol)
Definition ixa_mol.c:678
int IXA_MOL_SetExtMolDataByInChIExtInput(IXA_STATUS_HANDLE hStatus, IXA_MOL_HANDLE hMolecule, inchi_Output_Polymer *polymer, inchi_Output_V3000 *v3000, int nat)
Definition ixa_mol.c:2429
Definition ixa_mol.h:48
int mass
Definition ixa_mol.h:54
IXA_ATOM_RADICAL radical
Definition ixa_mol.h:55
int atomic_number
Definition ixa_mol.h:52
double z
Definition ixa_mol.h:51
int bond_count
Definition ixa_mol.h:57
int charge
Definition ixa_mol.h:56
double x
Definition ixa_mol.h:49
double y
Definition ixa_mol.h:50
Definition ixa_mol.h:63
IXA_ATOMID atom2
Definition ixa_mol.h:65
IXA_BOND_WEDGE wedge_from_atom1
Definition ixa_mol.h:68
IXA_DBLBOND_CONFIG config
Definition ixa_mol.h:67
IXA_ATOMID atom1
Definition ixa_mol.h:64
IXA_BOND_WEDGE wedge_from_atom2
Definition ixa_mol.h:69
IXA_BOND_TYPE type
Definition ixa_mol.h:66
Definition ixa_mol.h:106
INCHIMOL_SGROUP ** units
Definition ixa_mol.h:107
int n
Definition ixa_mol.h:108
Definition ixa_mol.h:88
int label
Definition ixa_mol.h:93
int subtype
Definition ixa_mol.h:91
int conn
Definition ixa_mol.h:92
int * alist
Definition ixa_mol.h:100
double xbr1[4]
Definition ixa_mol.h:97
int * blist
Definition ixa_mol.h:101
int type
Definition ixa_mol.h:90
double xbr2[4]
Definition ixa_mol.h:98
int id
Definition ixa_mol.h:89
int na
Definition ixa_mol.h:95
char smt[80]
Definition ixa_mol.h:99
int nb
Definition ixa_mol.h:96
Definition ixa_mol.h:74
IXA_STEREO_PARITY parity
Definition ixa_mol.h:78
IXA_STEREO_TOPOLOGY topology
Definition ixa_mol.h:75
void * central_entity
Definition ixa_mol.h:77
Definition ixa_mol.h:113
int n_steabs
Definition ixa_mol.h:127
int * atom_index_fin
Definition ixa_mol.h:117
int n_star_atoms
Definition ixa_mol.h:115
int ** lists_haptic_bonds
Definition ixa_mol.h:123
int n_sterel
Definition ixa_mol.h:131
int * atom_index_orig
Definition ixa_mol.h:116
int n_sterac
Definition ixa_mol.h:135
int ** lists_steabs
Definition ixa_mol.h:128
int ** lists_sterac
Definition ixa_mol.h:136
int n_haptic_bonds
Definition ixa_mol.h:122
int n_non_haptic_bonds
Definition ixa_mol.h:121
int n_3d_constraints
Definition ixa_mol.h:119
int n_collections
Definition ixa_mol.h:120
int ** lists_sterel
Definition ixa_mol.h:132
int n_non_star_atoms
Definition ixa_mol.h:114
int n_sgroups
Definition ixa_mol.h:118
Definition ixa_mol.h:155
int sgroup_count
Definition ixa_mol.h:163
int reserved_atom_count
Definition ixa_mol.h:166
INCHIMOL_STEREO * stereos
Definition ixa_mol.h:161
INCHIMOL_ATOM * atoms
Definition ixa_mol.h:157
int bond_count
Definition ixa_mol.h:158
int reserved_sgroup_count
Definition ixa_mol.h:169
IXA_BOOL chiral
Definition ixa_mol.h:165
int reserved_bond_count
Definition ixa_mol.h:167
int stereo_count
Definition ixa_mol.h:160
INCHIMOL_BOND * bonds
Definition ixa_mol.h:159
int reserved_stereo_count
Definition ixa_mol.h:168
int atom_count
Definition ixa_mol.h:156
INCHIMOL_V3000 * v3000
Definition ixa_mol.h:164
INCHIMOL_POLYMER * polymer
Definition ixa_mol.h:162
Definition ixa.h:84
Definition ixa.h:87
Definition ixa.h:62
Definition ixa.h:59
Definition inchi_api.h:514
Definition inchi_api.h:528