InChI
 
Loading...
Searching...
No Matches
mol_fmt1.c File Reference
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include "mode.h"
#include "mol_fmt.h"
#include "ichierr.h"
#include "util.h"
#include "ichi_io.h"
#include "strutil.h"
#include "bcf_s.h"
+ Include dependency graph for mol_fmt1.c:

Functions

static MOL_FMT_DATAMolfileReadDataLines (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)
 
static int MolfileReadSTextBlock (const MOL_FMT_CTAB *ctab, INCHI_IOSTREAM *inp_file, int err, char *pStrErr)
 Reads a substance text block.
 
static int MolfileReadPropBlock (MOL_FMT_CTAB *ctab, MOL_FMT_HEADER_BLOCK *pHdr, INCHI_IOSTREAM *inp_file, int treat_polymers, int err, char *pStrErr, int bNoWarnings)
 
static int MolfileReadSgroupOfPolymer (MOL_FMT_CTAB *ctab, MOL_FMT_HEADER_BLOCK *pHdr, INCHI_IOSTREAM *inp_file, char line[MOL_FMT_INPLINELEN], char *szType, char *p, int err, char *pStrErr)
 
static int MolfileTreatPseudoElementAtoms (MOL_FMT_CTAB *ctab, int pseudos_allowed, int *err, char *pStrErr)
 
MOL_FMT_DATAReadMolfile (INCHI_IOSTREAM *inp_file, MOL_FMT_HEADER_BLOCK *OnlyHeaderBlock, MOL_FMT_CTAB *OnlyCTab, int bGetOrigCoord, int treat_polymers, int treat_NPZz, 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.
 

Function Documentation

◆ MolfileReadAtomsBlock()

int MolfileReadAtomsBlock ( MOL_FMT_CTAB ctab,
INCHI_IOSTREAM inp_file,
int  err,
char *  pStrErr 
)
static

Reads an atom block from input MOL file (V2000).

Parameters
ctabConnection table data structure
inp_fileInput file
errError code
pStrErrError string
Returns
int Error code, returns 0 - no error, 4 - error: can't interpret atom block, 5 - error: can't interpret second half of atom block?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileReadBondsBlock()

int MolfileReadBondsBlock ( MOL_FMT_CTAB ctab,
INCHI_IOSTREAM inp_file,
int  err,
char *  pStrErr 
)
static

Reads a bond block from input MOL file (V2000)

Parameters
ctabConnection table data structure
inp_fileInput file
errError code
pStrErrError string
Returns
int Error code
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileReadCountsLine()

int MolfileReadCountsLine ( MOL_FMT_CTAB ctab,
INCHI_IOSTREAM inp_file,
char *  pStrErr 
)
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.

Parameters
ctabConnection table data structure
inp_fileInput file
pStrErrError string
Returns
int Error code, returns 0 - no error, 3 - error: can't read counts line, -1 - error: out of RAM
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileReadDataLines()

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 
)
static

Reads header lines and connection table block from input SD or MOL file, ignore STEXT block, queries, and 3D features.

Parameters
inp_fileInput file
OnlyHeaderBlockOutput header data structure, return MOL_FMT_DATA will point to it
OnlyCTabOutput connection table data structure, return MOL_FMT_DATA will point to it
bGetOrigCoordFlag to get original coordinates
treat_polymersFlag to treat polymers
errError code
pStrErrError string
bNoWarningsFlag to show warnings
Returns
MOL_FMT_DATA* returns mol file data structure, includes e.g. header block, connection table, ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileReadHeaderLines()

int MolfileReadHeaderLines ( MOL_FMT_HEADER_BLOCK hdr,
INCHI_IOSTREAM inp_file,
char *  pStrErr 
)
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.

Parameters
hdrOutput header data structure
inp_fileInput file
pStrErrError string
Returns
* int Error code, retuns 0 - no error, 1 - error: can't read header block name, 3 - error: can't read header block 2 line, 7 - error: cant' read header block comment line
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileReadPropBlock()

int MolfileReadPropBlock ( MOL_FMT_CTAB ctab,
MOL_FMT_HEADER_BLOCK pHdr,
INCHI_IOSTREAM inp_file,
int  treat_polymers,
int  err,
char *  pStrErr,
int  bNoWarnings 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileReadSgroupOfPolymer()

int MolfileReadSgroupOfPolymer ( MOL_FMT_CTAB ctab,
MOL_FMT_HEADER_BLOCK pHdr,
INCHI_IOSTREAM inp_file,
char  line[MOL_FMT_INPLINELEN],
char *  szType,
char *  p,
int  err,
char *  pStrErr 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileReadSTextBlock()

int MolfileReadSTextBlock ( const MOL_FMT_CTAB ctab,
INCHI_IOSTREAM inp_file,
int  err,
char *  pStrErr 
)
static

Reads a substance text block.

Parameters
ctabConnection table data structure
inp_fileInput file
errError code
pStrErrError string
Returns
int Error code
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MolfileTreatPseudoElementAtoms()

static int MolfileTreatPseudoElementAtoms ( MOL_FMT_CTAB ctab,
int  pseudos_allowed,
int *  err,
char *  pStrErr 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReadMolfile()

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.

Parameters
inp_filePointer to the input file stream.
OnlyHeaderBlockPointer to the header block to read.
OnlyCTabPointer to the connection table to read.
bGetOrigCoordFlag indicating whether to get original coordinates.
treat_polymersFlag indicating whether to treat polymers.
pseudos_allowedFlag indicating whether pseudo atoms are allowed.
pnamePointer to the name buffer.
lnameLength of the name buffer.
IdPointer to the ID buffer.
pSdfLabelPointer to the SDF label buffer.
pSdfValuePointer to the SDF value buffer.
errPointer to the error code.
pStrErrPointer to the error string buffer.
bNoWarningsFlag indicating whether to suppress warnings.
Returns
MOL_FMT_DATA*
+ Here is the call graph for this function:
+ Here is the caller graph for this function: