Include dependency graph for mol_fmt.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | A_NUM_LISTS |
| NUM_LISTS - Dynamically growing array of numeric lists. More... | |
| struct | tagINT_ARRAY |
| INT_ARRAY - Dynamically growing array of int. More... | |
| struct | A_MOL_FMT_SGROUP |
| Data structure for Sgroup data (substance group data). More... | |
| struct | A_MOL_FMT_SGROUPS |
| MOL_FMT_SGROUPS is a dynamically growing array of pointers to MOL_FMT_SGROUP objects. More... | |
| struct | A_MOL_FMT_HEADER_BLOCK |
| Data structure for MOL file header block (3 lines). More... | |
| struct | A_MOL_FMT_ATOM |
| Data structure for atom representation in the MOL format. More... | |
| struct | A_MOL_FMT_BOND |
| Data structure for bond representation in the MOL format. More... | |
| struct | A_MOL_FMT_v3000 |
| Data structure for V3000 representation in the MOL format. More... | |
| struct | A_MOL_FMT_CTAB |
| Connection table data structure. More... | |
| struct | A_MOL_FMT_DATA |
| Data structure for a MOL file. More... | |
Typedefs | |
| typedef signed char | S_CHAR |
| typedef unsigned char | U_CHAR |
| typedef struct A_NUM_LISTS | NUM_LISTS |
| NUM_LISTS - Dynamically growing array of numeric lists. | |
| typedef struct tagINT_ARRAY | INT_ARRAY |
| INT_ARRAY - Dynamically growing array of int. | |
| typedef struct A_MOL_FMT_SGROUP | MOL_FMT_SGROUP |
| Data structure for Sgroup data (substance group data). | |
| typedef struct A_MOL_FMT_SGROUPS | MOL_FMT_SGROUPS |
| MOL_FMT_SGROUPS is a dynamically growing array of pointers to MOL_FMT_SGROUP objects. | |
| typedef struct A_MOL_FMT_HEADER_BLOCK | MOL_FMT_HEADER_BLOCK |
| Data structure for MOL file header block (3 lines). | |
| typedef struct A_MOL_FMT_ATOM | MOL_FMT_ATOM |
| Data structure for atom representation in the MOL format. | |
| typedef struct A_MOL_FMT_BOND | MOL_FMT_BOND |
| Data structure for bond representation in the MOL format. | |
| typedef struct A_MOL_FMT_v3000 | MOL_FMT_v3000 |
| Data structure for V3000 representation in the MOL format. | |
| typedef struct A_MOL_FMT_CTAB | MOL_FMT_CTAB |
| Connection table data structure. | |
| typedef struct A_MOL_FMT_DATA | MOL_FMT_DATA |
| Data structure for a MOL file. | |
Functions | |
| int | NumLists_Alloc (NUM_LISTS *num_lists, int nlists) |
| Allocates memory for a specified number of numeric lists. | |
| int | NumLists_ReAlloc (NUM_LISTS *num_lists) |
| Reallocates memory for the numeric lists. | |
| int | NumLists_Append (NUM_LISTS *num_lists, int *list) |
| Push new item to the end of array. | |
| void | NumLists_Free (NUM_LISTS *num_lists) |
| Frees the memory allocated for the numeric list. | |
| int | IntArray_Alloc (INT_ARRAY *items, int nitems) |
| Initializes an INT_ARRAY structure. | |
| int | IntArray_ReAlloc (INT_ARRAY *items) |
| Reallocates memory for the INT_ARRAY structure. | |
| int | IntArray_Append (INT_ARRAY *items, int new_item) |
| Appends a new item to the INT_ARRAY structure. | |
| int | IntArray_AppendIfAbsent (INT_ARRAY *items, int new_item) |
| Appends a new item to the INT_ARRAY structure if it is not already present. | |
| void | IntArray_Reset (INT_ARRAY *items) |
| Resets the INT_ARRAY structure to its initial state. | |
| void | IntArray_Free (INT_ARRAY *items) |
| Frees the memory allocated for the INT_ARRAY structure. | |
| void | IntArray_DebugPrint (INT_ARRAY *items) |
| Prints the contents of the INT_ARRAY structure for debugging purposes. | |
| int | MolFmtSgroup_Create (MOL_FMT_SGROUP **sgroup, int id, int type) |
| Allocate new array Sgroup. | |
| void | MolFmtSgroup_Free (MOL_FMT_SGROUP *sgroup) |
| Frees the memory allocated for the Sgroup. | |
| int | MolFmtSgroups_Alloc (MOL_FMT_SGROUPS *items, int nitems) |
| Allocates memory for a specified number of Sgroup objects. | |
| int | MolFmtSgroups_ReAlloc (MOL_FMT_SGROUPS *items) |
| Expand array of Sgroups. | |
| int | MolFmtSgroups_Append (MOL_FMT_SGROUPS *items, int id, int type) |
| Appends a new Sgroup to the array. | |
| void | MolFmtSgroups_Free (MOL_FMT_SGROUPS *items) |
| Frees the memory allocated for the MOL_FMT_SGROUPS list. | |
| int | MolFmtSgroups_GetIndexBySgroupId (int id, MOL_FMT_SGROUPS *items) |
| Gets the index of a Sgroup by its ID. | |
| static MOL_FMT_DATA * | MolfileReadDataLines (INCHI_IOSTREAM *inp_file, MOL_FMT_HEADER_BLOCK *OnlyHeaderBlock, MOL_FMT_CTAB *OnlyCTab, int bGetOrigCoord, int treat_polymers, int *err, char *pStrErr, int bNoWarnings) |
| Reads header lines and connection table block from input SD or MOL file, ignore STEXT block, queries, and 3D features. | |
| static int | MolfileReadHeaderLines (MOL_FMT_HEADER_BLOCK *hdr, INCHI_IOSTREAM *inp_file, char *pStrErr) |
| Reads header lines from input MOL file. A MOL file can have 3 header lines: (1) the name of the molecule, (2) details about the software used and (3) a comment line. | |
| static int | MolfileReadCountsLine (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, char *pStrErr) |
| Reads counts line from input MOL file, includes information about the number of atoms, bonds, and atom lists, the chiral flag setting, and the Ctab version. | |
| static int | MolfileReadAtomsBlock (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr) |
| Reads an atom block from input MOL file (V2000). | |
| static int | MolfileReadBondsBlock (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr) |
| Reads a bond block from input MOL file (V2000) | |
| 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) |
| Reads a substance text block. | |
| int | MolfileStrnread (char *dest, char *source, int len, char **first_space) |
| Read a string from a source buffer into a destination buffer. | |
| 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'. | |
| long | MolfileExtractStrucNum (MOL_FMT_HEADER_BLOCK *pHdr) |
| Extract the MOL file number from the header name line like "Structure #22". | |
| int | MolfileHasNoChemStruc (MOL_FMT_DATA *mfdata) |
| Check if the MOL file has no chemical structure. | |
| int | MolfileSaveCopy (INCHI_IOSTREAM *inp_file, long fPtrStart, long fPtrEnd, FILE *outfile, long num) |
| Copy MOL-formatted data of SDF record or Molfile to another file. | |
| 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) |
| Get xyz dimensionality and normalization factors in the MOL file. | |
| MOL_FMT_DATA * | FreeMolfileData (MOL_FMT_DATA *mfdata) |
| Free MOL file data structure. | |
| int | MolfileV3000Init (MOL_FMT_CTAB *ctab, char *pStrErr) |
| Initialize V3000 connection table in MOL file data structure. | |
| int | MolfileV3000ReadCTABBeginAndCountsLine (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, char *pStrErr) |
| Read V3000 head (begin and counts line) of in MOL file data structure from input file stream. | |
| int | MolfileV3000ReadAtomsBlock (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr) |
| Read V3000 atoms block in MOL file data structure from input file stream. | |
| int | MolfileV3000ReadBondsBlock (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr) |
| Read V3000 bonds block in MOL file data structure from input file stream. | |
| int | MolfileV3000ReadTailOfCTAB (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr) |
| Read V3000 tail (haptic bonds, stereo collections, Sgroups, 3D constraints, collections, end line) in to the MOL file data structure from input file stream. | |
| int | MolfileV3000ReadHapticBond (MOL_FMT_CTAB *ctab, char **line_ptr, int **num_list, char *pStrErr) |
| Read V3000 haptic bond information from the input line. | |
| int | MolfileV3000ReadStereoCollection (MOL_FMT_CTAB *ctab, char **line_ptr, int **num_list, char *pStrErr) |
| Read V3000 stereo collection information from the input line. | |
| int | MolfileV3000ReadSGroup (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr) |
| Read V3000 Sgroup information from the input file stream into the MOL file data structure. | |
| int | MolfileV3000Read3DBlock (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr) |
| Read V3000 3D constraints block in MOL file data structure from input file stream. | |
| int | MolfileV3000ReadCollections (MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr) |
| Read V3000 collections block in MOL file data structure from input file stream. | |
| int | DeleteMolfileV3000Info (MOL_FMT_v3000 *v3000) |
| Free memory allocated for V3000 specific data in the MOL file data structure. | |
| char * | inchi_fgetsLf_V3000 (char *line, INCHI_IOSTREAM *inp_stream) |
| Read a line from the input file stream, handling V3000 line continuations: Extended version of inchi_fgetsLf which is able of reading concatenated lines (ending with '-') of V3000 Molfile. Also removes "M V30 " prefix" and normalizes the rest of string. | |
| int | get_V3000_input_line_to_strbuf (INCHI_IOS_STRING *buf, INCHI_IOSTREAM *inp_stream) |
| Get a V3000 input line and store it in a string buffer. | |
| int | MolfileV3000ReadField (void *data, int data_type, char **line_ptr) |
| Extract the 'data' in specified mol file field at given text position 'line_ptr'. | |
| int | MolfileV3000ReadKeyword (char *key, char **line_ptr) |
| Read keyword from the specified line. | |
| 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) |
| Skip extra data in SDF file after the MOL file data. | |
| int | SDFileIdentifyLabel (char *inp_line, const char *pSdfLabel) |
| Identify if the given line matches the specified SDF label. | |
| unsigned long | SDFileExtractCASNo (char *line) |
| Extract CAS number from the given line. | |
| #define INCHI_US_CHAR_DEF |
| #define ISOTOPIC_SHIFT_FLAG 10000 /* add to isotopic mass if isotopic_mass = */ |
| #define MOL_FMT_ABSENT 0 |
| #define MOL_FMT_CHAR_INT_DATA 'C' |
| #define MOL_FMT_CPSS MOL_FMT_ABSENT |
| #define MOL_FMT_DOUBLE_DATA 'D' |
| #define MOL_FMT_FLOAT_DATA 'F' |
| #define MOL_FMT_INPLINELEN 204 /* add cr, lf, double zero termination */ |
| #define MOL_FMT_INT_DATA 'I' |
| #define MOL_FMT_JUMP_TO_RIGHT 'J' |
| #define MOL_FMT_LONG_INT_DATA 'L' |
| #define MOL_FMT_M_CONN_EU 3 |
| #define MOL_FMT_M_CONN_HH 2 |
| #define MOL_FMT_M_CONN_HT 1 |
| #define MOL_FMT_M_CONN_NON 0 |
| #define MOL_FMT_M_SST_ALT 1 |
Alternating
| #define MOL_FMT_M_SST_BLK 3 |
Block
| #define MOL_FMT_M_SST_NON 0 |
None
| #define MOL_FMT_M_SST_RAN 2 |
Random
| #define MOL_FMT_M_STY_COP 3 |
Copolymer
| #define MOL_FMT_M_STY_CRO 5 |
Crosslink
| #define MOL_FMT_M_STY_MER 6 |
Mer type
| #define MOL_FMT_M_STY_MOD 4 |
Modification
| #define MOL_FMT_M_STY_MON 2 |
Monomer
| #define MOL_FMT_M_STY_NON 0 |
None
| #define MOL_FMT_M_STY_SRU 1 |
Structure repeating unit
| #define MOL_FMT_MAX_VALUE_LEN 32 /* max length of string containing a numerical value */ |
| #define MOL_FMT_MAXLINELEN 200 |
| #define MOL_FMT_PRESENT 1 |
| #define MOL_FMT_QUERY MOL_FMT_ABSENT |
| #define MOL_FMT_REACT MOL_FMT_ABSENT |
| #define MOL_FMT_SHORT_INT_DATA 'N' |
| #define MOL_FMT_STRING_DATA 'S' |
| #define MOL_FMT_V3000_INPLINELEN 32004 /* add cr, lf, double zero termination */ |
| #define MOL_FMT_V3000_MAXFIELDLEN 4096 |
| #define MOL_FMT_V3000_MAXLINELEN 32000 |
| #define MOL_FMT_V3000_STEABS 1 |
| #define MOL_FMT_V3000_STENON -1 |
| #define MOL_FMT_V3000_STERAC 3 |
| #define MOL_FMT_V3000_STEREL 2 |
| #define SD_FMT_END_OF_DATA "$$$$" |
| typedef struct tagINT_ARRAY INT_ARRAY |
INT_ARRAY - Dynamically growing array of int.
| item | Pointer to the array of integers. |
| allocated | Amount of memory allocated. |
| used | Amount of memory used. |
| increment | Amount to increment when expanding. |
| typedef struct A_MOL_FMT_ATOM MOL_FMT_ATOM |
Data structure for atom representation in the MOL format.
| fx | x coordinate: F10.5; Generic |
| fy | y coordinate: F10.5; Generic |
| fz | z coordinate: F10.5; Generic |
| symbol | Element symbol (aaa; up to 6 characters) |
| mass_difference | Mass difference (dd; (M_ISO); Generic: -3..+4 otherwise 0 or 127=most abund. isotope ) |
| charge | Formal charge (M CHG) |
| radical | Radical status (M RAD) |
| stereo_parity | Stereochemical parity (M STY) |
| H_count_plus_1 | Hydrogen count plus one (hhh; Query; Hn means >= n H; H0 means no H) |
| stereo_care | bbb; Query: 0=ignore; 1=must match |
| valence | vvv: <vvv: 0=no marking; (1..14)=(1..14); 15=zero valence.Number of bonds includes bonds to impl. H's> |
| H0_designator | HHH: CPSS |
| reaction_component_type | rrr: CPSS: 1=reactant, 2=product, 3=intermediate |
| reaction_component_num | iii: CPSS: 0 to (n-1) |
| atom_atom_mapping_num | mmm: Reaction: 1..255 |
| cInversionRetentionFlag | nnn: 1=inverted, 2=retained config.; 0=property not applied |
| exact_change_flag | eee |
| my_n_impH | number of implicit H calculated for adding H to strings in STDATA |
| display_tom | Do not hide element's name (applies to C 7-25-98 DCh) |
| atom_aliased_flag | Do not remove charge/radical/isotope if it is in the alias. 9-3-99 DCh |
| typedef struct A_MOL_FMT_BOND MOL_FMT_BOND |
Data structure for bond representation in the MOL format.
| atnum1 | First atom number. |
| atnum2 | Second atom number. |
| bond_type | Type of bond (single, double, triple, etc.). |
| bond_stereo | Stereo information for the bond. |
| bond_topology | Topology information for the bond. |
| react_center_status | Reaction center status information. |
| typedef struct A_MOL_FMT_CTAB MOL_FMT_CTAB |
Connection table data structure.
| n_atoms | Number of atoms in the molecule. |
| n_bonds | Number of bonds in the molecule. |
| n_atom_lists | Number of atom lists. |
| chiral_flag | Chiral flag indicating the presence of chiral centers. |
| n_stext_entries | Number of stereo text entries. |
| n_reaction_components_plus_1 | Number of reaction components. |
| n_reactants | Number of reactants. |
| n_products | Number of products. |
| n_intermediates | Number of intermediates. |
| n_property_lines | Number of property lines. |
| follow_inchi_1_treating_iso_mass | Flag indicating whether to follow InChI-1 treating isotopic mass. |
| version_string | Version string indicating the format version. |
| atoms | Pointer to the array of atom block data structure. |
| bonds | Pointer to the array of bond block data structure. |
| coords | Pointer to the array of coordinate data structure. |
| sgroups | Growable array of pointers to Sgroup objects. |
| v3000 | Pointer to the V3000 specific data structure. |
| typedef struct A_MOL_FMT_DATA MOL_FMT_DATA |
Data structure for a MOL file.
| hdr | Header block data structure. |
| ctab | Connection table data structure. |
| typedef struct A_MOL_FMT_HEADER_BLOCK MOL_FMT_HEADER_BLOCK |
Data structure for MOL file header block (3 lines).
| molname | Name of molecule (up to 80 characters) |
| line2 | Second line of the header (the whole line2, up to 80 chars) |
| user_initls | User initials (2 bytes; char) |
| prog_name | Program name (8 bytes; char) |
| month | Month (2 bytes; integral) |
| day | Day (2 bytes; integral) |
| year | Year (2 bytes; integral) |
| hour | Hour (2 bytes; integral) |
| minute | Minute (2 bytes; integral ) |
| dim_code | Dimensional code (2 bytes, dimensional code, char) |
| scaling_factor1 | Scaling factor 1 (2 bytes, I2) |
| scaling_factor2 | Scaling factor 2 (10 bytes, F10.5 ) |
| energy | Energy (10 bytes, F10.5 ) |
| internal_regno | Internal registration number (6 bytes, integral) |
| comment | Comment (Line #3, up to 80 characters) |
| typedef struct A_MOL_FMT_SGROUP MOL_FMT_SGROUP |
Data structure for Sgroup data (substance group data).
| id | it is what is called 'Sgroup number' in CTFile |
| type | Sgroup type: SUP = superatom, MUL = multiple group, SRU = SRU type, MON = monomer, MER = Mer type, COP = copolymer, CRO = crosslink, MOD = modification, GRA = graft, COM = component, MIX = mixture, FOR = formulation, DAT = data Sgroup, ANY = any polymer, GEN = generic |
| subtype | (SST) |
| conn | (SCN) Connectivity |
| label | what is called 'unique Sgroup identifier' in CTFile (SLB) |
| xbr1 | bracket ends coordinates (SDI) |
| xbr2 | bracket ends coordinates (SDI) |
| smt | Sgroup Subscript (SMT) |
| alist | list of atom indices (AL) |
| blist | list of bond indices (BL) |
| typedef struct A_MOL_FMT_SGROUPS MOL_FMT_SGROUPS |
MOL_FMT_SGROUPS is a dynamically growing array of pointers to MOL_FMT_SGROUP objects.
| group | Pointer to the growable array of pointers to MOL_FMT_SGROUPs |
| allocated | Number of allocated objects |
| used | Number of used objects |
| increment | Array expansion increment |
| typedef struct A_MOL_FMT_v3000 MOL_FMT_v3000 |
Data structure for V3000 representation in the MOL format.
| n_non_star_atoms | Number of non-star atoms. |
| n_star_atoms | Number of star atoms. |
| atom_index_orig | Original atom indices as supplied. |
| atom_index_fin | Final atom indices, with -1 for star atoms. |
| n_sgroups | Number of S-groups. |
| n_3d_constraints | Number of 3D constraints. |
| n_collections | Number of collections. |
| n_non_haptic_bonds | Number of non-haptic bonds. |
| n_haptic_bonds | Number of haptic bonds. |
| haptic_bonds | Pointer to the list of haptic bonds (int* contains bond type, non-star atom number, nendpts, then endpts themselves). |
| n_steabs | Number of absolute stereo groups. |
| steabs | Pointer to the list of absolute stereo groups (e.g. R and S). |
| n_sterel | Number of relative stereo groups. |
| sterel | Pointer to the list of relative stereo groups (OR - describes the orientation of groups relative to each other, such as in cis- and trans-isomers). |
| n_sterac | Number of racemic stereo groups. |
| sterac | Pointer to the list of racemic stereo groups (AND - equal 50:50 mixture of two enantiomers of a chiral molecule). |
| typedef struct A_NUM_LISTS NUM_LISTS |
NUM_LISTS - Dynamically growing array of numeric lists.
| lists | Pointer to the array of integer lists. |
| allocated | Amount of memory allocated. |
| used | Amount of memory used. |
| increment | Amount to increment when expanding. |
| typedef signed char S_CHAR |
| typedef unsigned char U_CHAR |
| int DeleteMolfileV3000Info | ( | MOL_FMT_v3000 * | v3000 | ) |
Free memory allocated for V3000 specific data in the MOL file data structure.
| v3000 | Pointer to the V3000 specific data structure to free. |
Here is the call graph for this function:
Here is the caller graph for this function:| MOL_FMT_DATA * FreeMolfileData | ( | MOL_FMT_DATA * | mfdata | ) |
Free MOL file data structure.
| mfdata | Pointer to the MOL file data structure to free. |
Here is the call graph for this function:
Here is the caller graph for this function:| int get_V3000_input_line_to_strbuf | ( | INCHI_IOS_STRING * | buf, |
| INCHI_IOSTREAM * | inp_stream | ||
| ) |
Get a V3000 input line and store it in a string buffer.
| buf | Pointer to the string buffer to store the line. |
| inp_stream | Pointer to the input file stream. |
Here is the call graph for this function:
Here is the caller graph for this function:| char * inchi_fgetsLf_V3000 | ( | char * | line, |
| INCHI_IOSTREAM * | inp_stream | ||
| ) |
Read a line from the input file stream, handling V3000 line continuations: Extended version of inchi_fgetsLf which is able of reading concatenated lines (ending with '-') of V3000 Molfile. Also removes "M V30 " prefix" and normalizes the rest of string.
| line | Pointer to the buffer to store the read line. |
| inp_stream | Pointer to the input file stream. |
Here is the call graph for this function:| int IntArray_Alloc | ( | INT_ARRAY * | items, |
| int | nitems | ||
| ) |
Initializes an INT_ARRAY structure.
| items | Pointer to the INT_ARRAY structure to initialize. |
| nitems | Initial number of items to allocate. |
Here is the caller graph for this function:| int IntArray_Append | ( | INT_ARRAY * | items, |
| int | new_item | ||
| ) |
Appends a new item to the INT_ARRAY structure.
| items | Pointer to the INT_ARRAY structure to modify. |
| new_item | The new item to append. |
Here is the call graph for this function:
Here is the caller graph for this function:| int IntArray_AppendIfAbsent | ( | INT_ARRAY * | items, |
| int | new_item | ||
| ) |
Appends a new item to the INT_ARRAY structure if it is not already present.
| items | Pointer to the INT_ARRAY structure to modify. |
| new_item | The new item to append. |
Here is the call graph for this function:
Here is the caller graph for this function:| void IntArray_DebugPrint | ( | INT_ARRAY * | items | ) |
Prints the contents of the INT_ARRAY structure for debugging purposes.
| items | Pointer to the INT_ARRAY structure to print. |
Here is the caller graph for this function:| void IntArray_Free | ( | INT_ARRAY * | items | ) |
Frees the memory allocated for the INT_ARRAY structure.
| items | Pointer to the INT_ARRAY structure to free. |
Here is the caller graph for this function:| int IntArray_ReAlloc | ( | INT_ARRAY * | items | ) |
Reallocates memory for the INT_ARRAY structure.
| items | Pointer to the INT_ARRAY structure to reallocate. |
Here is the caller graph for this function:| void IntArray_Reset | ( | INT_ARRAY * | items | ) |
Resets the INT_ARRAY structure to its initial state.
| items | Pointer to the INT_ARRAY structure to reset. |
Here is the caller graph for this function:| long MolfileExtractStrucNum | ( | MOL_FMT_HEADER_BLOCK * | pHdr | ) |
Extract the MOL file number from the header name line like "Structure #22".
| pHdr | Pointer to the header block. |
Here is the call graph for this function:
Here is the caller graph for this function:| 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 | ||
| ) |
Get xyz dimensionality and normalization factors in the MOL file.
| mfdata | Pointer to the MOL file data structure. |
| find_norm_factors | Flag indicating whether to find normalization/scaling factors. |
| x0 | Pointer to the minimum x-coordinate of the molecule. |
| y0 | Pointer to the minimum y-coordinate of the molecule. |
| z0 | Pointer to the minimum z-coordinate of the molecule. |
| xmin | Pointer to the x-coordinate (is set to 0). |
| ymin | Pointer to the y-coordinate (is set to 0). |
| zmin | Pointer to the z-coordinate (is set to 0). |
| scaler | Pointer to the scaling factor. |
| err | Pointer to the error code. |
| pStrErr | Pointer to the error string buffer. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileHasNoChemStruc | ( | MOL_FMT_DATA * | mfdata | ) |
Check if the MOL file has no chemical structure.
| mfdata | Pointer to the MOL file data structure. |
Here is the caller graph for this function:
|
static |
Reads an atom block from input MOL file (V2000).
| ctab | Connection table data structure |
| inp_file | Input file |
| err | Error code |
| pStrErr | Error string |
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Reads a bond block from input MOL file (V2000)
| ctab | Connection table data structure |
| inp_file | Input file |
| err | Error code |
| pStrErr | Error string |
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Reads counts line from input MOL file, includes information about the number of atoms, bonds, and atom lists, the chiral flag setting, and the Ctab version.
| ctab | Connection table data structure |
| inp_file | Input file |
| pStrErr | Error string |
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Reads header lines and connection table block from input SD or MOL file, ignore STEXT block, queries, and 3D features.
| inp_file | Input file |
| OnlyHeaderBlock | Output header data structure, return MOL_FMT_DATA will point to it |
| OnlyCTab | Output connection table data structure, return MOL_FMT_DATA will point to it |
| bGetOrigCoord | Flag to get original coordinates |
| treat_polymers | Flag to treat polymers |
| err | Error code |
| pStrErr | Error string |
| bNoWarnings | Flag to show warnings |
Here is the call graph for this function:
Here is the caller graph for this function:| 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'.
| data | Pointer to the destination buffer. |
| field_len | Length of the field to read. For MOL_FMT_STRING_DATA does not include trailing zero, that is actual length of the string pointed by 'data' should be at least field_len+1 bytes. For numerical data 'field_len' is length of input data field For numerical integral data field_len <= 0 means read up to first non-numeric character as strtod() does ("free format") |
| data_type | Type of the data to read. E.g. MOL_FMT_STRING_DATA, MOL_FMT_CHAR_INT_DATA, etc. |
| line_ptr | Pointer to a variable that will receive the address of the next line. |
on exit *line_ptr points to the next byte after the last entered
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Reads header lines from input MOL file. A MOL file can have 3 header lines: (1) the name of the molecule, (2) details about the software used and (3) a comment line.
| hdr | Output header data structure |
| inp_file | Input file |
| pStrErr | Error string |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileSaveCopy | ( | INCHI_IOSTREAM * | inp_file, |
| long | fPtrStart, | ||
| long | fPtrEnd, | ||
| FILE * | outfile, | ||
| long | num | ||
| ) |
Copy MOL-formatted data of SDF record or Molfile to another file.
| inp_file | Pointer to the input file stream. |
| fPtrStart | File pointer position to start copying from. |
| fPtrEnd | File pointer position to stop copying at. |
| outfile | Pointer to the output file stream. |
| num | Structure number to write in the header line. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileStrnread | ( | char * | dest, |
| char * | source, | ||
| int | len, | ||
| char ** | first_space | ||
| ) |
Read a string from a source buffer into a destination buffer.
| dest | Pointer to the destination buffer. |
| source | Pointer to the source buffer. |
| len | Length of the string to read. |
| first_space | Pointer to a variable that will receive the address of the first space character in the source buffer. |
Here is the caller graph for this function:| int MolfileV3000Init | ( | MOL_FMT_CTAB * | ctab, |
| char * | pStrErr | ||
| ) |
Initialize V3000 connection table in MOL file data structure.
| ctab | Pointer to the connection table data structure. |
| pStrErr | Pointer to the error string buffer. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileV3000Read3DBlock | ( | MOL_FMT_CTAB * | ctab, |
| INCHI_IOSTREAM * | inp_file, | ||
| int | err, | ||
| char * | pStrErr | ||
| ) |
Read V3000 3D constraints block in MOL file data structure from input file stream.
| ctab | Pointer to the connection table data structure. |
| inp_file | Pointer to the input file stream. |
| err | Error code. |
| pStrErr | Pointer to the error string buffer. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileV3000ReadAtomsBlock | ( | MOL_FMT_CTAB * | ctab, |
| INCHI_IOSTREAM * | inp_file, | ||
| int | err, | ||
| char * | pStrErr | ||
| ) |
Read V3000 atoms block in MOL file data structure from input file stream.
| ctab | Pointer to the connection table data structure. |
| inp_file | Pointer to the input file stream. |
| err | Error code. |
| pStrErr | Pointer to the error string buffer. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileV3000ReadBondsBlock | ( | MOL_FMT_CTAB * | ctab, |
| INCHI_IOSTREAM * | inp_file, | ||
| int | err, | ||
| char * | pStrErr | ||
| ) |
Read V3000 bonds block in MOL file data structure from input file stream.
| ctab | Pointer to the connection table data structure. |
| inp_file | Pointer to the input file stream. |
| err | Error code. |
| pStrErr | Pointer to the error string buffer. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileV3000ReadCollections | ( | MOL_FMT_CTAB * | ctab, |
| INCHI_IOSTREAM * | inp_file, | ||
| int | err, | ||
| char * | pStrErr | ||
| ) |
Read V3000 collections block in MOL file data structure from input file stream.
| ctab | Pointer to the connection table data structure. |
| inp_file | Pointer to the input file stream. |
| err | Error code. |
| pStrErr | Pointer to the error string buffer. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileV3000ReadCTABBeginAndCountsLine | ( | MOL_FMT_CTAB * | ctab, |
| INCHI_IOSTREAM * | inp_file, | ||
| char * | pStrErr | ||
| ) |
Read V3000 head (begin and counts line) of in MOL file data structure from input file stream.
| ctab | Pointer to the connection table data structure. |
| inp_file | Pointer to the input file stream. |
| pStrErr | Pointer to the error string buffer. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileV3000ReadField | ( | void * | data, |
| int | data_type, | ||
| char ** | line_ptr | ||
| ) |
Extract the 'data' in specified mol file field at given text position 'line_ptr'.
| data | Pointer to the destination buffer. |
| data_type | Type of the data to read. E.g. MOL_FMT_STRING_DATA, MOL_FMT_CHAR_INT_DATA, etc. |
| line_ptr | Pointer to the line buffer. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileV3000ReadHapticBond | ( | MOL_FMT_CTAB * | ctab, |
| char ** | line_ptr, | ||
| int ** | num_list, | ||
| char * | pStrErr | ||
| ) |
Read V3000 haptic bond information from the input line.
| ctab | Pointer to the connection table data structure. |
| line_ptr | Pointer to the line buffer. |
| num_list | Pointer to the list of numbers. |
| pStrErr | Pointer to the error string buffer. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileV3000ReadKeyword | ( | char * | key, |
| char ** | line_ptr | ||
| ) |
Read keyword from the specified line.
| key | Pointer to the buffer to store the keyword. |
| line_ptr | Pointer to the line buffer. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileV3000ReadSGroup | ( | MOL_FMT_CTAB * | ctab, |
| INCHI_IOSTREAM * | inp_file, | ||
| int | err, | ||
| char * | pStrErr | ||
| ) |
Read V3000 Sgroup information from the input file stream into the MOL file data structure.
| ctab | Pointer to the connection table data structure. |
| inp_file | Pointer to the input file stream. |
| err | Error code. |
| pStrErr | Pointer to the error string buffer. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileV3000ReadStereoCollection | ( | MOL_FMT_CTAB * | ctab, |
| char ** | line_ptr, | ||
| int ** | num_list, | ||
| char * | pStrErr | ||
| ) |
Read V3000 stereo collection information from the input line.
| ctab | Pointer to the connection table data structure. |
| line_ptr | Pointer to the line buffer. |
| num_list | Pointer to the list of numbers. |
| pStrErr | Pointer to the error string buffer. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolfileV3000ReadTailOfCTAB | ( | MOL_FMT_CTAB * | ctab, |
| INCHI_IOSTREAM * | inp_file, | ||
| int | err, | ||
| char * | pStrErr | ||
| ) |
Read V3000 tail (haptic bonds, stereo collections, Sgroups, 3D constraints, collections, end line) in to the MOL file data structure from input file stream.
| ctab | Pointer to the connection table data structure. |
| inp_file | Pointer to the input file stream. |
| err | Error code. |
| pStrErr | Pointer to the error string buffer. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolFmtSgroup_Create | ( | MOL_FMT_SGROUP ** | sgroup, |
| int | id, | ||
| int | type | ||
| ) |
Allocate new array Sgroup.
| sgroup | Pointer to the Sgroup structure to allocate. |
| id | Sgroup ID. |
| type | Sgroup type. |
Here is the call graph for this function:
Here is the caller graph for this function:| void MolFmtSgroup_Free | ( | MOL_FMT_SGROUP * | sgroup | ) |
Frees the memory allocated for the Sgroup.
| sgroup | Pointer to the Sgroup structure to free. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolFmtSgroups_Alloc | ( | MOL_FMT_SGROUPS * | items, |
| int | nitems | ||
| ) |
Allocates memory for a specified number of Sgroup objects.
| items | Pointer to the MOL_FMT_SGROUPS structure. |
| nitems | Number of Sgroup objects to allocate. |
Here is the caller graph for this function:| int MolFmtSgroups_Append | ( | MOL_FMT_SGROUPS * | items, |
| int | id, | ||
| int | type | ||
| ) |
Appends a new Sgroup to the array.
| items | Pointer to the MOL_FMT_SGROUPS structure. |
| id | Sgroup ID. |
| type | Sgroup type. |
Here is the call graph for this function:
Here is the caller graph for this function:| void MolFmtSgroups_Free | ( | MOL_FMT_SGROUPS * | items | ) |
Frees the memory allocated for the MOL_FMT_SGROUPS list.
| items | Pointer to the MOL_FMT_SGROUPS structure. |
Here is the call graph for this function:
Here is the caller graph for this function:| int MolFmtSgroups_GetIndexBySgroupId | ( | int | id, |
| MOL_FMT_SGROUPS * | items | ||
| ) |
Gets the index of a Sgroup by its ID.
| id | Sgroup ID. |
| items | Pointer to the MOL_FMT_SGROUPS structure. |
Here is the caller graph for this function:| int MolFmtSgroups_ReAlloc | ( | MOL_FMT_SGROUPS * | items | ) |
Expand array of Sgroups.
| items | Pointer to the MOL_FMT_SGROUPS structure. |
Here is the caller graph for this function:| int NumLists_Alloc | ( | NUM_LISTS * | num_lists, |
| int | nlists | ||
| ) |
Allocates memory for a specified number of numeric lists.
| num_lists | Pointer to the NUM_LISTS structure. |
| nlists | Number of lists to allocate. |
Here is the caller graph for this function:| int NumLists_Append | ( | NUM_LISTS * | num_lists, |
| int * | list | ||
| ) |
Push new item to the end of array.
| num_lists | Pointer to the NUM_LISTS structure. |
| list | Pointer to the list of integers to append. |
Here is the call graph for this function:
Here is the caller graph for this function:| void NumLists_Free | ( | NUM_LISTS * | num_lists | ) |
Frees the memory allocated for the numeric list.
| num_lists | Pointer to the NUM_LISTS structure. |
Here is the caller graph for this function:| int NumLists_ReAlloc | ( | NUM_LISTS * | num_lists | ) |
Reallocates memory for the numeric lists.
| num_lists | Pointer to the NUM_LISTS structure. |
Here is the caller graph for this function:| 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 | ||
| ) |
Reads a substance text block.
| ctab | Connection table data structure |
| inp_file | Input file |
| err | Error code |
| pStrErr | Error string |
Read MOL file data in to data structures.
| inp_file | Pointer to the input file stream. |
| OnlyHeaderBlock | Pointer to the header block to read. |
| OnlyCTab | Pointer to the connection table to read. |
| bGetOrigCoord | Flag indicating whether to get original coordinates. |
| treat_polymers | Flag indicating whether to treat polymers. |
| pseudos_allowed | Flag indicating whether pseudo atoms are allowed. |
| pname | Pointer to the name buffer. |
| lname | Length of the name buffer. |
| Id | Pointer to the ID buffer. |
| pSdfLabel | Pointer to the SDF label buffer. |
| pSdfValue | Pointer to the SDF value buffer. |
| err | Pointer to the error code. |
| pStrErr | Pointer to the error string buffer. |
| bNoWarnings | Flag indicating whether to suppress warnings. |
Here is the call graph for this function:
Here is the caller graph for this function:| unsigned long SDFileExtractCASNo | ( | char * | line | ) |
Extract CAS number from the given line.
| line | Pointer to the line containing the CAS number. |
Here is the caller graph for this function:| int SDFileIdentifyLabel | ( | char * | inp_line, |
| const char * | pSdfLabel | ||
| ) |
Identify if the given line matches the specified SDF label.
| inp_line | Pointer to the input line. |
| pSdfLabel | Pointer to the SDF label to match. |
Here is the call graph for this function:
Here is the caller graph for this function:| 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 | ||
| ) |
Skip extra data in SDF file after the MOL file data.
| inp_file | Pointer to the input file stream. |
| CAS_num | Pointer to the variable to store the CAS number. |
| comment | Pointer to the buffer to store the comment. |
| lcomment | Length of the comment buffer. |
| name | Pointer to the buffer to store the name. |
| lname | Length of the name buffer. |
| prev_err | Previous error code. |
| pSdfLabel | Pointer to the SDF label buffer. |
| pSdfValue | Pointer to the SDF value buffer. |
| pStrErr | Pointer to the error string buffer. |
| bNoWarnings | Flag indicating whether to suppress warnings. |
Here is the call graph for this function:
Here is the caller graph for this function: