InChI
 
Loading...
Searching...
No Matches
mol2atom.c File Reference
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "mode.h"
#include "mol_fmt.h"
#include "ichierr.h"
#include "util.h"
#include "strutil.h"
#include "inchi_api.h"
#include "bcf_s.h"
#include "logging.h"
+ Include dependency graph for mol2atom.c:

Functions

int ReadMolfileToInpAtoms (INCHI_IOSTREAM *inp_file, int bDoNotAddH, inp_ATOM **at, MOL_COORD **szCoord, OAD_Polymer **polymer, OAD_V3000 **v3000, int treat_polymers, int treat_NPZz, int max_num_at, int *num_dimensions, int *num_bonds, const char *pSdfLabel, char *pSdfValue, unsigned long *Id, long *lMolfileNumber, INCHI_MODE *pInpAtomFlags, int *err, char *pStrErr, int bNoWarnings)
 
inp_ATOM * MakeInpAtomsFromMolfileData (MOL_FMT_DATA *mfdata, int *num_atoms, int *num_bonds, inp_ATOM *at_inp, int bDoNotAddH, int *err, char *pStrErr)
 
int SetInpAtomsXYZ (MOL_FMT_DATA *mfdata, int num_atoms, inp_ATOM *at, int *err, char *pStrErr)
 
void calculate_valences (MOL_FMT_DATA *mfdata, inp_ATOM *at, int *num_atoms, int bDoNotAddH, int *err, char *pStrErr)
 
int SetExtOrigAtDataByMolfileExtInput (MOL_FMT_DATA *mfdata, OAD_Polymer **polymer, OAD_V3000 **v3000, char *pStrErr)
 
int CreateOrigInpDataFromMolfile (INCHI_IOSTREAM *inp_file, ORIG_ATOM_DATA *orig_at_data, int bMergeAllInputStructures, int bGetOrigCoord, int bDoNotAddH, int treat_polymers, int treat_NPZz, const char *pSdfLabel, char *pSdfValue, unsigned long *lSdfId, long *lMolfileNumber, INCHI_MODE *pInpAtomFlags, int *err, char *pStrErr, int bNoWarnings)
 Create original input data from molfile.
 
inp_ATOM * CreateInpAtom (int num_atoms)
 Create/allocate a Inp Atom structure.
 
void FreeInpAtom (inp_ATOM **at)
 Free input atom array.
 
void FreeInpAtomData (INP_ATOM_DATA *inp_at_data)
 Free input atom data.
 
int CreateInpAtomData (INP_ATOM_DATA *inp_at_data, int num_atoms, int create_at_fixed_bonds)
 Create a Inp Atom Data structure.
 
void FreeCompAtomData (COMP_ATOM_DATA *inp_at_data)
 Free composite atom data.
 
int CreateCompAtomData (COMP_ATOM_DATA *inp_at_data, int num_atoms, int num_components, int bIntermediateTaut)
 Create a Comp Atom Data structure.
 
void FreeOrigAtData (ORIG_ATOM_DATA *orig_at_data)
 Free original atom data.
 
void FreeExtOrigAtData (OAD_Polymer *pd, OAD_V3000 *v3k)
 Free extended original atom data (polymers and V3000)
 

Function Documentation

◆ calculate_valences()

void calculate_valences ( MOL_FMT_DATA *  mfdata,
inp_ATOM *  at,
int *  num_atoms,
int  bDoNotAddH,
int *  err,
char *  pStrErr 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateCompAtomData()

int CreateCompAtomData ( COMP_ATOM_DATA *  inp_at_data,
int  num_atoms,
int  num_components,
int  bIntermediateTaut 
)

Create a Comp Atom Data structure.

Parameters
inp_at_dataPointer to the Comp Atom Data structure
num_atomsNumber of atoms
num_componentsNumber of components
bIntermediateTautFlag for intermediate tautomer
Returns
int Status code (1 if successful, 0 otherwise)

◆ CreateInpAtom()

inp_ATOM * CreateInpAtom ( int  num_atoms)

Create/allocate a Inp Atom structure.

Parameters
num_atomsNumber of atoms
Returns
inp_ATOM* Pointer to the created Inp Atom structure
+ Here is the caller graph for this function:

◆ CreateInpAtomData()

int CreateInpAtomData ( INP_ATOM_DATA *  inp_at_data,
int  num_atoms,
int  create_at_fixed_bonds 
)

Create a Inp Atom Data structure.

Parameters
inp_at_dataPointer to the Inp Atom Data structure
num_atomsNumber of atoms
create_at_fixed_bondsFlag to create fixed bonds
Returns
int Status code (1 if successful, 0 otherwise)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateOrigInpDataFromMolfile()

int CreateOrigInpDataFromMolfile ( INCHI_IOSTREAM *  inp_file,
ORIG_ATOM_DATA *  orig_at_data,
int  bMergeAllInputStructures,
int  bGetOrigCoord,
int  bDoNotAddH,
int  treat_polymers,
int  treat_NPZz,
const char *  pSdfLabel,
char *  pSdfValue,
unsigned long *  lSdfId,
long *  lMolfileNumber,
INCHI_MODE *  pInpAtomFlags,
int *  err,
char *  pStrErr,
int  bNoWarnings 
)

Create original input data from molfile.

Parameters
inp_fileInput file stream
orig_at_dataPointer to original atom data structure to be filled
bMergeAllInputStructuresFlag indicating whether to merge all input structures
bGetOrigCoordFlag indicating whether to get original coordinates
bDoNotAddHFlag indicating whether to avoid adding hydrogens
treat_polymersFlag indicating how to treat polymers
treat_NPZzFlag indicating how to treat non-polymeric Zz atoms
pSdfLabelPointer to SDF label
pSdfValuePointer to SDF value
lSdfIdPointer to SDF ID
lMolfileNumberPointer to molfile number
pInpAtomFlagsPointer to input atom flags
errPointer to error code
pStrErrPointer to error string
bNoWarningsFlag indicating whether to suppress warnings
Returns
int Status code
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FreeCompAtomData()

void FreeCompAtomData ( COMP_ATOM_DATA *  inp_at_data)

Free composite atom data.

Parameters
inp_at_dataPointer to composite atom data structure
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FreeExtOrigAtData()

void FreeExtOrigAtData ( OAD_Polymer *  pd,
OAD_V3000 *  v3k 
)

Free extended original atom data (polymers and V3000)

Parameters
pdPointer to polymer data structure
v3kPointer to V3000 data structure
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FreeInpAtom()

void FreeInpAtom ( inp_ATOM **  at)

Free input atom array.

Parameters
atPointer to input atom array
+ Here is the caller graph for this function:

◆ FreeInpAtomData()

void FreeInpAtomData ( INP_ATOM_DATA *  inp_at_data)

Free input atom data.

Parameters
inp_at_dataPointer to input atom data structure
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FreeOrigAtData()

void FreeOrigAtData ( ORIG_ATOM_DATA *  orig_at_data)

Free original atom data.

Parameters
orig_at_dataPointer to original atom data structure
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeInpAtomsFromMolfileData()

inp_ATOM * MakeInpAtomsFromMolfileData ( MOL_FMT_DATA *  mfdata,
int *  num_atoms,
int *  num_bonds,
inp_ATOM *  at_inp,
int  bDoNotAddH,
int *  err,
char *  pStrErr 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReadMolfileToInpAtoms()

int ReadMolfileToInpAtoms ( INCHI_IOSTREAM *  inp_file,
int  bDoNotAddH,
inp_ATOM **  at,
MOL_COORD **  szCoord,
OAD_Polymer **  polymer,
OAD_V3000 **  v3000,
int  treat_polymers,
int  treat_NPZz,
int  max_num_at,
int *  num_dimensions,
int *  num_bonds,
const char *  pSdfLabel,
char *  pSdfValue,
unsigned long *  Id,
long *  lMolfileNumber,
INCHI_MODE *  pInpAtomFlags,
int *  err,
char *  pStrErr,
int  bNoWarnings 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetExtOrigAtDataByMolfileExtInput()

int SetExtOrigAtDataByMolfileExtInput ( MOL_FMT_DATA *  mfdata,
OAD_Polymer **  polymer,
OAD_V3000 **  v3000,
char *  pStrErr 
)

@nnuk: GHI#252 addressed and redundant logic removed

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetInpAtomsXYZ()

int SetInpAtomsXYZ ( MOL_FMT_DATA *  mfdata,
int  num_atoms,
inp_ATOM *  at,
int *  err,
char *  pStrErr 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function: