InChI
 
Loading...
Searching...
No Matches
mol_fmt.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#ifndef _MOL_FMT_H_
42#define _MOL_FMT_H_
43
44#include <stdio.h>
45
46#include "ichisize.h"
47#include "mode.h" /* djb-rwth: necessary header file */
48
49/*
50 Data structures and constants
51*/
52
53/*************************** read MOL file V2000.************************/
54/* ref: A.Dalby et al, "Description of Several Chemical Structure
55 * File Formats Used by Computer Programs Developed at Molecular
56 * Design Limited", J. Chem. Inf. Comput. Sci., 1992, 32, 244-255.
57 */
58
59/* ************************** read MOL file V3000.************************ */
60/* http://download.accelrys.com/freeware/ctfile-formats/CTFile-formats.zip
61 * Last accessed 2013-06-11
62 */
63
64/*-----------*/
65/* CONSTANTS */
66/*-----------*/
67
68#define SD_FMT_END_OF_DATA "$$$$"
69
70#define MOL_FMT_INPLINELEN 204 /* add cr, lf, double zero termination */
71#ifndef MOL_FMT_MAXLINELEN
72#define MOL_FMT_MAXLINELEN 200
73#endif
74
75#define MOL_FMT_PRESENT 1
76#define MOL_FMT_ABSENT 0
77
78/* configuration */
79#define MOL_FMT_QUERY MOL_FMT_ABSENT
80#define MOL_FMT_CPSS MOL_FMT_ABSENT
81#define MOL_FMT_REACT MOL_FMT_ABSENT
82
83#define MOL_FMT_STRING_DATA 'S'
84#define MOL_FMT_CHAR_INT_DATA 'C'
85#define MOL_FMT_SHORT_INT_DATA 'N'
86#define MOL_FMT_LONG_INT_DATA 'L'
87#define MOL_FMT_DOUBLE_DATA 'D'
88#define MOL_FMT_FLOAT_DATA 'F'
89#define MOL_FMT_JUMP_TO_RIGHT 'J'
90#define MOL_FMT_INT_DATA 'I'
91
92#define MOL_FMT_MAX_VALUE_LEN 32 /* max length of string containing a numerical value */
93
94#define MOL_FMT_M_STY_NON 0
95#define MOL_FMT_M_STY_SRU 1
96#define MOL_FMT_M_STY_MON 2
97#define MOL_FMT_M_STY_COP 3
98#define MOL_FMT_M_STY_MOD 4
99#define MOL_FMT_M_STY_CRO 5
100#define MOL_FMT_M_STY_MER 6
102#define MOL_FMT_M_SST_NON 0
103#define MOL_FMT_M_SST_ALT 1
104#define MOL_FMT_M_SST_RAN 2
105#define MOL_FMT_M_SST_BLK 3
107#define MOL_FMT_M_CONN_NON 0
108#define MOL_FMT_M_CONN_HT 1
109#define MOL_FMT_M_CONN_HH 2
110#define MOL_FMT_M_CONN_EU 3
111
112/* V3000 specific constants */
113#define MOL_FMT_V3000_STENON -1
114#define MOL_FMT_V3000_STEABS 1
115#define MOL_FMT_V3000_STEREL 2
116#define MOL_FMT_V3000_STERAC 3
117
118/* provisional limits for V3000 */
119#define MOL_FMT_V3000_INPLINELEN 32004 /* add cr, lf, double zero termination */
120#ifndef MOL_FMT_V3000_MAXLINELEN
121#define MOL_FMT_V3000_MAXLINELEN 32000
122#endif
123#define MOL_FMT_V3000_MAXFIELDLEN 4096
124
125/*#ifdef TARGET_EXE_USING_API*/
126#ifndef ISOTOPIC_SHIFT_FLAG
127#define ISOTOPIC_SHIFT_FLAG 10000 /* add to isotopic mass if isotopic_mass = */
128#endif
129/*#endif*/
130
131/*-------------------*/
132/* SIMPLE DATA TYPES */
133/*-------------------*/
134
135#ifndef INCHI_US_CHAR_DEF
136typedef signed char S_CHAR;
137typedef unsigned char U_CHAR;
138#define INCHI_US_CHAR_DEF
139#endif
140
141#ifndef LEN_COORD
142#define LEN_COORD 10
143#endif
144#ifndef NUM_COORD
145#define NUM_COORD 3
146#endif
147
148/*-----------------*/
149/* DATA STRUCTURES */
150/*-----------------*/
151
159typedef struct A_NUM_LISTS
160{
161 int **lists;
163 int used;
166
174int NumLists_Alloc(NUM_LISTS *num_lists, int nlists);
175
182int NumLists_ReAlloc(NUM_LISTS *num_lists);
183
191int NumLists_Append(NUM_LISTS *num_lists, int *list);
192
197void NumLists_Free(NUM_LISTS *num_lists);
198
206typedef struct tagINT_ARRAY
207{
208 int *item;
210 int used;
213
222int IntArray_Alloc(INT_ARRAY *items, int nitems);
223
231int IntArray_ReAlloc(INT_ARRAY *items);
232
241int IntArray_Append(INT_ARRAY *items, int new_item);
242
251int IntArray_AppendIfAbsent(INT_ARRAY *items, int new_item);
252
258void IntArray_Reset(INT_ARRAY *items);
259
265void IntArray_Free(INT_ARRAY *items);
266
272void IntArray_DebugPrint(INT_ARRAY *items);
273
288typedef struct A_MOL_FMT_SGROUP
289{
290 int id;
291 int type;
293 int conn;
294 int label;
295 double xbr1[4];
296 double xbr2[4];
297 char smt[80];
301
311 int id,
312 int type);
313
320
336
344int MolFmtSgroups_Alloc(MOL_FMT_SGROUPS *items, int nitems);
345
353
362int MolFmtSgroups_Append(MOL_FMT_SGROUPS *items, int id, int type);
363
370
379
417
442typedef struct A_MOL_FMT_ATOM
443{
444 double fx; /* F10.5; Generic */
445 double fy; /* F10.5; Generic */
446 double fz; /* F10.5; Generic */
447 char symbol[6]; /* aaa; Generic */
448
449 S_CHAR mass_difference; /* dd; (M_ISO) */
450 /* Generic: -3..+4 otherwise 0 or */
451 /* 127=most abund. isotope */
452 S_CHAR charge; /* ccc; (M CHG), */
453 /* Generic: 1=+3, 2=+2,3=+1, */
454 /* 4=doublet,5=-1,6=-2,7=-3 */
455 char radical; /* (M RAD) */
456 char stereo_parity; /* sss; Generic */
457#if (MOL_FMT_QUERY == MOL_FMT_PRESENT)
458 char H_count_plus_1; /* hhh; Query; */
459 /* Hn means >= n H; */
460 /* H0 means no H */
461 char stereo_care; /* bbb; Query: 0=ignore; */
462 /* 1=must match */
463#endif
464 char valence; /* vvv: */
465 /* 0=no marking; (1..14)=(1..14); */
466 /* 15=zero valence.Number of bonds*/
467 /* includes bonds to impl. H's */
468
469#if (MOL_FMT_CPSS == MOL_FMT_PRESENT)
470 char H0_designator; /* HHH: CPSS */
471 char reaction_component_type; /* rrr: */
472 /* CPSS: 1=reactant, */
473 /* 2=product, */
474 /* 3=intermediate */
475 char reaction_component_num; /* iii: CPSS: 0 to (n-1) */
476#endif
477#if (MOL_FMT_REACT == MOL_FMT_PRESENT)
478 short atom_atom_mapping_num; /* mmm: Reaction: 1..255 */
479 char cInversionRetentionFlag; /* nnn: */
480 /* 1=inverted, 2=retained config.;*/
481 /* 0=property not applied */
482#endif
483#if (MOL_FMT_REACT == MOL_FMT_PRESENT || MOL_FMT_QUERY == MOL_FMT_PRESENT)
484 char exact_change_flag; /* eee */
485#endif
486 char my_n_impH; /* number of implicit H calculated */
487 /* for adding H to strings in STDATA*/
488 char display_tom; /* Do not hide element's name */
489 /* (applies to C 7-25-98 DCh */
490 char atom_aliased_flag; /* Do not remove */
491 /* charge/radical/isotope if it */
492 /* is in the alias. 9-3-99 DCh */
494
505typedef struct A_MOL_FMT_BOND
506{
507 short atnum1; /* 111: First atom number: Generic */
508 short atnum2; /* 222: Second atom number:Generic */
509 char bond_type; /* ttt: */
510 /* 1,2,3=single, double, triple; */
511 /* 4=aromatic; */
512 /* 5=single or double; */
513 /* 6=single or aromatic; */
514 /* 7=double or aromatic; */
515 /* 8=any. */
516 /* Values 4-8 are for */
517 /* SSS queries only */
518 char bond_stereo; /* sss: */
519 /* Single bonds: */
520 /* 0=not stereo, 1=up, */
521 /* 4=either, 6=down */
522 /* Double bonds: */
523 /* 0=use x,y,z to */
524 /* determine cis/trans, */
525 /* 3=cis or trans (either) */
526 /* xxx: not used */
527
528#if (MOL_FMT_QUERY == MOL_FMT_PRESENT)
529 char bond_topology; /* rrr: */
530 /* 0=either, 1=ring, 2=chain: */
531 /* SSS queries only */
532#endif
533#if (MOL_FMT_REACT == MOL_FMT_PRESENT)
534 char react_center_status; /* ccc: */
535 /* 0 = unmarked, */
536 /* 1 = a center, */
537 /* -1 = not a center; */
538 /* Additional: */
539 /* 2 = no charge, */
540 /* 4 = bond made/broken, */
541 /* 8 = bond order changes */
542 /* 12=4+8; 5=4+1, 9=8+1, 13=12+1 */
543 /* 12=4+8; 5=4+1, 9=8+1, 13=12+1 */
544 /* are also possible */
545#endif
547
548
569typedef struct A_MOL_FMT_v3000
570{
573 int *atom_index_orig; /* index as supplied for atoms */
574 int *atom_index_fin; /* = index or -1 for star atom */
575 int n_sgroups; /* currently, we do not use this. */
576 int n_3d_constraints; /* currently, we do not use this. */
580 NUM_LISTS *haptic_bonds; /* haptic_bonds[i] is ptr to int* which contains */
581 /* bond_type, non-star atom number, */
582 /* nendpts, then endpts themselves */
583 /* Enhanced stereo */
585 NUM_LISTS *steabs; /* steabs[k][0] - not used */
586 /* steabs[k][1] - number of members in collection */
587 /* steabs[k][2..] - member atom numbers */
589 NUM_LISTS *sterel; /* sterel[k][0] - n from "STERELn" tag */
590 /* sterel[k][1] - number of members in collection */
591 /* sterel[k][2..] - member atom numbers */
593 NUM_LISTS *sterac; /* sterac[k][0] - n from "STERACn" tag */
594 /* sterac[k][1] - number of members in collection */
595 /* sterac[k][0] - number from "STERACn" tag */
597
619typedef struct A_MOL_FMT_CTAB
620{
621 /* Line #1: Counts line */
622 int n_atoms; /* int accounts for possible V3000. Was: aaa; <= 255; Generic */
623 int n_bonds; /* int accounts for possible V3000. Was: bbb; <= 255; Generic */
624#if (MOL_FMT_QUERY == MOL_FMT_PRESENT)
625 short n_atom_lists; /* lll; <= 30; Query */
626#endif
627
628 char chiral_flag; /* ccc; 0 or 1; Generic */
629 short n_stext_entries; /* sss; CPSS */
630#if (MOL_FMT_CPSS == MOL_FMT_PRESENT)
631 short n_reaction_components_plus_1; /* xxx; CPSS */
632 short n_reactants; /* rrr; CPSS */
633 short n_products; /* ppp; CPSS */
634 short n_intermediates; /* iii; CPSS */
635#endif
636 short n_property_lines; /* mmm; Generic */
638 char version_string[7]; /* vvvvvv; Generic; 'V2000' */
639 MOL_FMT_ATOM *atoms; /* The Atom Block */
642 MOL_FMT_SGROUPS sgroups; /* growable array of pointers to Sgroup objects */
645
657
658/*
659 Functions
660*/
661
682 MOL_FMT_HEADER_BLOCK *OnlyHeaderBlock,
683 MOL_FMT_CTAB *OnlyCTab,
684 int bGetOrigCoord,
685 int treat_polymers,
686 int pseudos_allowed,
687 char *pname,
688 int lname,
689 unsigned long *Id,
690 const char *pSdfLabel,
691 char *pSdfValue,
692 int *err,
693 char *pStrErr,
694 int bNoWarnings);
695
705int MolfileStrnread(char *dest,
706 char *source,
707 int len,
708 char **first_space);
709
726int MolfileReadField(void *data,
727 int field_len,
728 int data_type,
729 char **line_ptr);
738int MolfileSaveCopy(INCHI_IOSTREAM *inp_file,
739 long fPtrStart,
740 long fPtrEnd,
741 FILE *outfile,
742 long num);
744 int find_norm_factors,
745 double *x0,
746 double *y0,
747 double *z0,
748 double *xmin,
749 double *ymin,
750 double *zmin,
751 double *scaler,
752 int *err,
753 char *pStrErr);
755
756/*
757 V3000 Molfile
758*/
759
761 char *pStrErr);
763 INCHI_IOSTREAM *inp_file,
764 char *pStrErr);
766 INCHI_IOSTREAM *inp_file,
767 int err,
768 char *pStrErr);
770 INCHI_IOSTREAM *inp_file,
771 int err,
772 char *pStrErr);
774 INCHI_IOSTREAM *inp_file,
775 int err,
776 char *pStrErr);
778 char **line_ptr,
779 int **num_list,
780 char *pStrErr);
782 char **line_ptr,
783 int **num_list,
784 char *pStrErr);
786 INCHI_IOSTREAM *inp_file,
787 int err,
788 char *pStrErr);
790 INCHI_IOSTREAM *inp_file,
791 int err,
792 char *pStrErr);
794 INCHI_IOSTREAM *inp_file,
795 int err,
796 char *pStrErr);
797/* Clean V3000 stuff */
799
800char *inchi_fgetsLf_V3000(char *line,
801 INCHI_IOSTREAM *inp_stream);
803 INCHI_IOSTREAM *inp_stream);
804
805/* Extract the 'data' in specified mol file field at given text position 'line_ptr' */
806int MolfileV3000ReadField(void *data,
807 int data_type,
808 char **line_ptr);
809/* Read keyword */
810int MolfileV3000ReadKeyword(char *key,
811 char **line_ptr);
812
813/*
814 SDF
815*/
816
818 unsigned long *CAS_num,
819 char *comment,
820 int lcomment,
821 char *name,
822 int lname,
823 int prev_err,
824 const char *pSdfLabel,
825 char *pSdfValue,
826 char *pStrErr,
827 int bNoWarnings);
828int SDFileIdentifyLabel(char *inp_line, const char *pSdfLabel);
829unsigned long SDFileExtractCASNo(char *line);
830
831#endif /* _MOL_FMT_H_ */
char MOL_COORD[LEN_COORD *NUM_COORD+NUM_COORD - 1]
Definition ichisize.h:64
int MolFmtSgroups_GetIndexBySgroupId(int id, MOL_FMT_SGROUPS *items)
Gets the index of a Sgroup by its ID.
Definition mol_fmt4.c:768
struct A_MOL_FMT_SGROUP MOL_FMT_SGROUP
Data structure for Sgroup data (substance group data).
int MolfileV3000Read3DBlock(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
Definition mol_fmt3.c:622
signed char S_CHAR
Definition mol_fmt.h:136
struct A_MOL_FMT_DATA MOL_FMT_DATA
Data structure for a MOL file.
int IntArray_Append(INT_ARRAY *items, int new_item)
Appends a new item to the INT_ARRAY structure.
Definition mol_fmt4.c:550
int MolfileSaveCopy(INCHI_IOSTREAM *inp_file, long fPtrStart, long fPtrEnd, FILE *outfile, long num)
Definition mol_fmt2.c:385
unsigned long SDFileExtractCASNo(char *line)
Definition mol_fmt4.c:407
int MolfileGetXYZDimAndNormFactors(MOL_FMT_DATA *mfdata, int find_norm_factors, double *x0, double *y0, double *z0, double *xmin, double *ymin, double *zmin, double *scaler, int *err, char *pStrErr)
Definition mol_fmt2.c:474
int NumLists_Append(NUM_LISTS *num_lists, int *list)
Push new item to the end of array.
Definition mol_fmt4.c:471
int NumLists_ReAlloc(NUM_LISTS *num_lists)
Reallocates memory for the numeric lists.
Definition mol_fmt4.c:449
int MolfileV3000ReadAtomsBlock(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
Definition mol_fmt3.c:871
int MolfileV3000ReadField(void *data, int data_type, char **line_ptr)
Definition mol_fmt3.c:265
int MolfileHasNoChemStruc(MOL_FMT_DATA *mfdata)
Definition mol_fmt2.c:362
int NumLists_Alloc(NUM_LISTS *num_lists, int nlists)
Allocates memory for a specified number of numeric lists.
Definition mol_fmt4.c:433
void MolFmtSgroup_Free(MOL_FMT_SGROUP *sgroup)
Frees the memory allocated for the Sgroup.
Definition mol_fmt4.c:658
unsigned char U_CHAR
Definition mol_fmt.h:137
int MolfileV3000ReadStereoCollection(MOL_FMT_CTAB *ctab, char **line_ptr, int **num_list, char *pStrErr)
Definition mol_fmt3.c:1832
int MolFmtSgroup_Create(MOL_FMT_SGROUP **sgroup, int id, int type)
Allocate new array Sgroup.
Definition mol_fmt4.c:634
#define MOL_FMT_MAXLINELEN
Definition mol_fmt.h:72
int MolfileV3000ReadKeyword(char *key, char **line_ptr)
Definition mol_fmt3.c:420
void IntArray_DebugPrint(INT_ARRAY *items)
Prints the contents of the INT_ARRAY structure for debugging purposes.
Definition mol_fmt4.c:582
int SDFileIdentifyLabel(char *inp_line, const char *pSdfLabel)
Definition mol_fmt4.c:346
struct A_MOL_FMT_v3000 MOL_FMT_v3000
Data structure for V3000 representation in the MOL format.
void IntArray_Reset(INT_ARRAY *items)
Resets the INT_ARRAY structure to its initial state.
Definition mol_fmt4.c:603
void MolFmtSgroups_Free(MOL_FMT_SGROUPS *items)
Frees the memory allocated for the MOL_FMT_SGROUPS list.
Definition mol_fmt4.c:750
MOL_FMT_DATA * ReadMolfile(INCHI_IOSTREAM *inp_file, MOL_FMT_HEADER_BLOCK *OnlyHeaderBlock, MOL_FMT_CTAB *OnlyCTab, int bGetOrigCoord, int treat_polymers, int pseudos_allowed, char *pname, int lname, unsigned long *Id, const char *pSdfLabel, char *pSdfValue, int *err, char *pStrErr, int bNoWarnings)
Read MOL file data in to data structures.
Definition mol_fmt1.c:161
int MolfileStrnread(char *dest, char *source, int len, char **first_space)
Read a string from a source buffer into a destination buffer.
Definition mol_fmt2.c:65
MOL_FMT_DATA * FreeMolfileData(MOL_FMT_DATA *mfdata)
Definition mol_fmt2.c:664
int IntArray_ReAlloc(INT_ARRAY *items)
Reallocates memory for the INT_ARRAY structure.
Definition mol_fmt4.c:525
struct tagINT_ARRAY INT_ARRAY
INT_ARRAY - Dynamically growing array of int.
int MolfileV3000Init(MOL_FMT_CTAB *ctab, char *pStrErr)
Definition mol_fmt3.c:70
struct A_MOL_FMT_BOND MOL_FMT_BOND
Data structure for bond representation in the MOL format.
int MolFmtSgroups_Append(MOL_FMT_SGROUPS *items, int id, int type)
Appends a new Sgroup to the array.
Definition mol_fmt4.c:715
int MolfileV3000ReadBondsBlock(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
Definition mol_fmt3.c:1272
int DeleteMolfileV3000Info(MOL_FMT_v3000 *v3000)
Definition mol_fmt3.c:169
struct A_MOL_FMT_CTAB MOL_FMT_CTAB
Connection table data structure.
long MolfileExtractStrucNum(MOL_FMT_HEADER_BLOCK *pHdr)
Extract the MOL file number from the header name line like "Structure #22".
Definition mol_fmt2.c:333
char * inchi_fgetsLf_V3000(char *line, INCHI_IOSTREAM *inp_stream)
Definition mol_fmt3.c:221
int MolFmtSgroups_Alloc(MOL_FMT_SGROUPS *items, int nitems)
Allocates memory for a specified number of Sgroup objects.
Definition mol_fmt4.c:675
int MolfileV3000ReadCTABBeginAndCountsLine(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, char *pStrErr)
Definition mol_fmt3.c:456
struct A_NUM_LISTS NUM_LISTS
NUM_LISTS - Dynamically growing array of numeric lists.
int get_V3000_input_line_to_strbuf(INCHI_IOS_STRING *buf, INCHI_IOSTREAM *inp_stream)
Definition mol_fmt3.c:1905
int MolFmtSgroups_ReAlloc(MOL_FMT_SGROUPS *items)
Expand array of Sgroups.
Definition mol_fmt4.c:693
int MolfileV3000ReadSGroup(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
Definition mol_fmt3.c:574
void IntArray_Free(INT_ARRAY *items)
Frees the memory allocated for the INT_ARRAY structure.
Definition mol_fmt4.c:610
struct A_MOL_FMT_SGROUPS MOL_FMT_SGROUPS
MOL_FMT_SGROUPS is a dynamically growing array of pointers to MOL_FMT_SGROUP objects.
void NumLists_Free(NUM_LISTS *num_lists)
Frees the memory allocated for the numeric list.
Definition mol_fmt4.c:491
int MolfileReadField(void *data, int field_len, int data_type, char **line_ptr)
Extract the 'data' in the MOL file field at given text position 'line_ptr'.
Definition mol_fmt2.c:105
int MolfileV3000ReadHapticBond(MOL_FMT_CTAB *ctab, char **line_ptr, int **num_list, char *pStrErr)
Definition mol_fmt3.c:1746
struct A_MOL_FMT_HEADER_BLOCK MOL_FMT_HEADER_BLOCK
Data structure for MOL file header block (3 lines).
int IntArray_AppendIfAbsent(INT_ARRAY *items, int new_item)
Appends a new item to the INT_ARRAY structure if it is not already present.
Definition mol_fmt4.c:572
int SDFileSkipExtraData(INCHI_IOSTREAM *inp_file, unsigned long *CAS_num, char *comment, int lcomment, char *name, int lname, int prev_err, const char *pSdfLabel, char *pSdfValue, char *pStrErr, int bNoWarnings)
Definition mol_fmt4.c:161
int MolfileV3000ReadTailOfCTAB(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
Definition mol_fmt3.c:1614
int MolfileV3000ReadCollections(MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
Definition mol_fmt3.c:662
struct A_MOL_FMT_ATOM MOL_FMT_ATOM
Data structure for atom representation in the MOL format.
int IntArray_Alloc(INT_ARRAY *items, int nitems)
Initializes an INT_ARRAY structure.
Definition mol_fmt4.c:510
Data structure for atom representation in the MOL format.
Definition mol_fmt.h:443
double fy
Definition mol_fmt.h:445
char radical
Definition mol_fmt.h:455
char atom_aliased_flag
Definition mol_fmt.h:490
char valence
Definition mol_fmt.h:464
S_CHAR mass_difference
Definition mol_fmt.h:449
double fz
Definition mol_fmt.h:446
char stereo_parity
Definition mol_fmt.h:456
S_CHAR charge
Definition mol_fmt.h:452
double fx
Definition mol_fmt.h:444
char symbol[6]
Definition mol_fmt.h:447
char my_n_impH
Definition mol_fmt.h:486
char display_tom
Definition mol_fmt.h:488
Data structure for bond representation in the MOL format.
Definition mol_fmt.h:506
short atnum2
Definition mol_fmt.h:508
short atnum1
Definition mol_fmt.h:507
char bond_stereo
Definition mol_fmt.h:518
char bond_type
Definition mol_fmt.h:509
Connection table data structure.
Definition mol_fmt.h:620
int n_bonds
Definition mol_fmt.h:623
MOL_FMT_SGROUPS sgroups
Definition mol_fmt.h:642
short n_stext_entries
Definition mol_fmt.h:629
short follow_inchi_1_treating_iso_mass
Definition mol_fmt.h:637
short n_property_lines
Definition mol_fmt.h:636
int n_atoms
Definition mol_fmt.h:622
char chiral_flag
Definition mol_fmt.h:628
MOL_FMT_BOND * bonds
Definition mol_fmt.h:640
MOL_COORD * coords
Definition mol_fmt.h:641
MOL_FMT_v3000 * v3000
Definition mol_fmt.h:643
MOL_FMT_ATOM * atoms
Definition mol_fmt.h:639
char version_string[7]
Definition mol_fmt.h:638
Data structure for a MOL file.
Definition mol_fmt.h:653
MOL_FMT_CTAB ctab
Definition mol_fmt.h:655
MOL_FMT_HEADER_BLOCK hdr
Definition mol_fmt.h:654
Data structure for MOL file header block (3 lines).
Definition mol_fmt.h:400
char dim_code[3]
Definition mol_fmt.h:410
char minute
Definition mol_fmt.h:409
char year
Definition mol_fmt.h:407
char comment[81]
Definition mol_fmt.h:415
short scaling_factor1
Definition mol_fmt.h:411
char user_initls[3]
Definition mol_fmt.h:403
double scaling_factor2
Definition mol_fmt.h:412
char hour
Definition mol_fmt.h:408
char molname[MOL_FMT_MAXLINELEN+1]
Definition mol_fmt.h:401
long internal_regno
Definition mol_fmt.h:414
char month
Definition mol_fmt.h:405
char line2[MOL_FMT_MAXLINELEN+1]
Definition mol_fmt.h:402
char prog_name[9]
Definition mol_fmt.h:404
char day
Definition mol_fmt.h:406
double energy
Definition mol_fmt.h:413
MOL_FMT_SGROUPS is a dynamically growing array of pointers to MOL_FMT_SGROUP objects.
Definition mol_fmt.h:330
int used
Definition mol_fmt.h:333
int increment
Definition mol_fmt.h:334
MOL_FMT_SGROUP ** group
Definition mol_fmt.h:331
int allocated
Definition mol_fmt.h:332
Data structure for Sgroup data (substance group data).
Definition mol_fmt.h:289
int conn
Definition mol_fmt.h:293
char smt[80]
Definition mol_fmt.h:297
int type
Definition mol_fmt.h:291
double xbr2[4]
Definition mol_fmt.h:296
INT_ARRAY alist
Definition mol_fmt.h:298
int id
Definition mol_fmt.h:290
double xbr1[4]
Definition mol_fmt.h:295
int label
Definition mol_fmt.h:294
INT_ARRAY blist
Definition mol_fmt.h:299
int subtype
Definition mol_fmt.h:292
Data structure for V3000 representation in the MOL format.
Definition mol_fmt.h:570
int n_collections
Definition mol_fmt.h:577
int n_non_haptic_bonds
Definition mol_fmt.h:578
NUM_LISTS * sterac
Definition mol_fmt.h:593
int n_steabs
Definition mol_fmt.h:584
int n_sterac
Definition mol_fmt.h:592
int n_sterel
Definition mol_fmt.h:588
int n_star_atoms
Definition mol_fmt.h:572
int n_haptic_bonds
Definition mol_fmt.h:579
int n_sgroups
Definition mol_fmt.h:575
NUM_LISTS * sterel
Definition mol_fmt.h:589
NUM_LISTS * steabs
Definition mol_fmt.h:585
int * atom_index_fin
Definition mol_fmt.h:574
int n_3d_constraints
Definition mol_fmt.h:576
int n_non_star_atoms
Definition mol_fmt.h:571
NUM_LISTS * haptic_bonds
Definition mol_fmt.h:580
int * atom_index_orig
Definition mol_fmt.h:573
NUM_LISTS - Dynamically growing array of numeric lists.
Definition mol_fmt.h:160
int allocated
Definition mol_fmt.h:162
int ** lists
Definition mol_fmt.h:161
int used
Definition mol_fmt.h:163
int increment
Definition mol_fmt.h:164
INT_ARRAY - Dynamically growing array of int.
Definition mol_fmt.h:207
int * item
Definition mol_fmt.h:208
int increment
Definition mol_fmt.h:211
int used
Definition mol_fmt.h:210
int allocated
Definition mol_fmt.h:209
Definition mode.h:1030
Definition mode.h:1016