InChI
 
Loading...
Searching...
No Matches
ixa_mol.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: MIT
3 * Copyright (c) 2024 IUPAC and InChI Trust
4 */
5
6
7#ifndef __IXA_MOL_H__
8#define __IXA_MOL_H__
9
10#include "../../../../INCHI_BASE/src/ixa.h"
11
12typedef struct
13{
14 double x;
15 double y;
16 double z;
18 int hydrogens[4];
19 int mass;
21 int charge;
23 IXA_BONDID bonds[20];
25
26
36
37
38typedef struct
39{
41 IXA_ATOMID vertices[4]; /* All currently supported topologies have 4 vertices. */
42 void* central_entity; /* Could be an atom or a bond, depending on topology. */
45
46/************************************************************************/
47/*
48 Extended input supporting v. 1.05 extensions: V3000; polymers
49 This is a later addition to native IXA intended at this time
50 just to be a carrier which transports extension data to GetINCHI()
51*/
52typedef struct INCHIMOL_SGROUP
53{
54 int id; /* it is what is called 'Sgroup number' in CTFILE */
55 int type; /* type as by MDL format (STY) */
56 int subtype; /* subtype as by MDL format (SST) */
57 int conn; /* connection scheme as by MDL format (SCN) */
58 int label; /* it is what is called 'unique Sgroup */
59 /* identifier' in CTFILE */
60 int na; /* number of atoms in the unit */
61 int nb; /* number of bonds in the unit */
62 double xbr1[4]; /* bracket ends coordinates (SDI) */
63 double xbr2[4]; /* bracket ends coordinates (SDI) */
64 char smt[80]; /* Sgroup Subscript (SMT) */
65 int *alist; /* atoms in unit (SAL) */
66 int *blist; /* bonds in unit [atom1, atom2, atom1, atom2,.. ] */
67 /* for all bonds (as made from SBL) */
69
70typedef struct INCHIMOL_POLYMER
71{
72 INCHIMOL_SGROUP **units; /* array of pointers */
73 int n;
75
76/* Extended input supporting v. 1.05 extensions: V3000; polymers */
77typedef struct INCHIMOL_V3000
78{
81 int *atom_index_orig; /* index as supplied for atoms */
82 int *atom_index_fin; /* = index or -1 for star atom */
83 int n_sgroups; /* currently, we do not use this. */
84 int n_3d_constraints; /* currently, we do not use this. */
88 int **lists_haptic_bonds; /* haptic_bonds[i] is pointer to int* which contains*/
89 /* bond_type, non-star atom number, nendpts, */
90 /* then endpts themselves */
91 /* Enhanced stereo */
93 int **lists_steabs; /* steabs[k][0] - not used */
94 /* steabs[k][1] - number of members in collection */
95 /* steabs[k][2..] - member atom numbers */
97 int **lists_sterel; /* sterel[k][0] - n from "STERELn" tag */
98 /* sterel[k][1] - number of members in collection */
99 /* sterel[k][2..] - member atom numbers */
101 int **lists_sterac; /* sterac[k][0] - n from "STERACn" tag */
102 /* sterac[k][1] - number of members in collection */
103 /* sterac[k][0] - number from "STERACn" tag */
105/************************************************************************/
106
107
108#ifdef IXA_USES_SMART_ALLOCS
109#define INCHIMOL_ATOMS_START_SIZE 128
110#define INCHIMOL_BONDS_START_SIZE 128
111#define INCHIMOL_STEREOS_START_SIZE 64
112#define INCHIMOL_MAX_ATOMS 32767
113#define INCHIMOL_MAX_BONDS INT_MAX
114#define INCHIMOL_MAX_STEREOS INT_MAX
115#define INCHIMOL_POLYMERUNITS_START_SIZE 2
116#define INCHIMOL_MAX_POLYMERUNITS INT_MAX
117
118
136#else
137typedef struct
138{
139 int atom_count;
140 INCHIMOL_ATOM *atoms;
141 int bond_count;
142 INCHIMOL_BOND* bonds;
143 int stereo_count;
144 INCHIMOL_STEREO *stereos;
145 INCHIMOL_POLYMER *polymer;
146 INCHIMOL_V3000 *v3000;
147 IXA_BOOL chiral;
148} INCHIMOL;
149#endif
150
151
153 IXA_MOL_HANDLE HMol );
154
156 IXA_MOL_HANDLE hMolecule,
157 IXA_BONDID vBond,
158 IXA_ATOMID vAtom );
159
160/****************************************************************************/
161/* Functions for treating extended input/output */
163 IXA_MOL_HANDLE hMolecule,
164 inchi_Output_Polymer *polymer,
165 inchi_Output_V3000 *v3000,
166 int nat );
167
168
169#endif
IXA_BOOL
Definition ixa.h:89
IXA_BOND_TYPE
Definition ixa.h:103
IXA_STEREO_TOPOLOGY
Definition ixa.h:125
IXA_ATOM_RADICAL
Definition ixa.h:95
IXA_DBLBOND_CONFIG
Definition ixa.h:119
IXA_STEREO_PARITY
Definition ixa.h:133
IXA_BOND_WEDGE
Definition ixa.h:111
IXA_ATOMID MOL_GetBondOtherAtom(IXA_STATUS_HANDLE hStatus, IXA_MOL_HANDLE hMolecule, IXA_BONDID vBond, IXA_ATOMID vAtom)
Definition ixa_mol.c:657
INCHIMOL * MOL_Unpack(IXA_STATUS_HANDLE hStatus, IXA_MOL_HANDLE HMol)
Definition ixa_mol.c:643
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:2394
Definition ixa_mol.h:13
int mass
Definition ixa_mol.h:19
IXA_ATOM_RADICAL radical
Definition ixa_mol.h:20
int atomic_number
Definition ixa_mol.h:17
double z
Definition ixa_mol.h:16
int bond_count
Definition ixa_mol.h:22
int charge
Definition ixa_mol.h:21
double x
Definition ixa_mol.h:14
double y
Definition ixa_mol.h:15
Definition ixa_mol.h:28
IXA_ATOMID atom2
Definition ixa_mol.h:30
IXA_BOND_WEDGE wedge_from_atom1
Definition ixa_mol.h:33
IXA_DBLBOND_CONFIG config
Definition ixa_mol.h:32
IXA_ATOMID atom1
Definition ixa_mol.h:29
IXA_BOND_WEDGE wedge_from_atom2
Definition ixa_mol.h:34
IXA_BOND_TYPE type
Definition ixa_mol.h:31
Definition ixa_mol.h:71
INCHIMOL_SGROUP ** units
Definition ixa_mol.h:72
int n
Definition ixa_mol.h:73
Definition ixa_mol.h:53
int label
Definition ixa_mol.h:58
int subtype
Definition ixa_mol.h:56
int conn
Definition ixa_mol.h:57
int * alist
Definition ixa_mol.h:65
double xbr1[4]
Definition ixa_mol.h:62
int * blist
Definition ixa_mol.h:66
int type
Definition ixa_mol.h:55
double xbr2[4]
Definition ixa_mol.h:63
int id
Definition ixa_mol.h:54
int na
Definition ixa_mol.h:60
char smt[80]
Definition ixa_mol.h:64
int nb
Definition ixa_mol.h:61
Definition ixa_mol.h:39
IXA_STEREO_PARITY parity
Definition ixa_mol.h:43
IXA_STEREO_TOPOLOGY topology
Definition ixa_mol.h:40
void * central_entity
Definition ixa_mol.h:42
Definition ixa_mol.h:78
int n_steabs
Definition ixa_mol.h:92
int * atom_index_fin
Definition ixa_mol.h:82
int n_star_atoms
Definition ixa_mol.h:80
int ** lists_haptic_bonds
Definition ixa_mol.h:88
int n_sterel
Definition ixa_mol.h:96
int * atom_index_orig
Definition ixa_mol.h:81
int n_sterac
Definition ixa_mol.h:100
int ** lists_steabs
Definition ixa_mol.h:93
int ** lists_sterac
Definition ixa_mol.h:101
int n_haptic_bonds
Definition ixa_mol.h:87
int n_non_haptic_bonds
Definition ixa_mol.h:86
int n_3d_constraints
Definition ixa_mol.h:84
int n_collections
Definition ixa_mol.h:85
int ** lists_sterel
Definition ixa_mol.h:97
int n_non_star_atoms
Definition ixa_mol.h:79
int n_sgroups
Definition ixa_mol.h:83
Definition ixa_mol.h:120
int sgroup_count
Definition ixa_mol.h:128
int reserved_atom_count
Definition ixa_mol.h:131
INCHIMOL_STEREO * stereos
Definition ixa_mol.h:126
INCHIMOL_ATOM * atoms
Definition ixa_mol.h:122
int bond_count
Definition ixa_mol.h:123
int reserved_sgroup_count
Definition ixa_mol.h:134
IXA_BOOL chiral
Definition ixa_mol.h:130
int reserved_bond_count
Definition ixa_mol.h:132
int stereo_count
Definition ixa_mol.h:125
INCHIMOL_BOND * bonds
Definition ixa_mol.h:124
int reserved_stereo_count
Definition ixa_mol.h:133
int atom_count
Definition ixa_mol.h:121
INCHIMOL_V3000 * v3000
Definition ixa_mol.h:129
INCHIMOL_POLYMER * polymer
Definition ixa_mol.h:127
Definition ixa.h:49
Definition ixa.h:52
Definition ixa.h:27
Definition ixa.h:24
Definition inchi_api.h:479
Definition inchi_api.h:493