mirror of
https://github.com/Discngine/fpocket.git
synced 2026-06-04 11:54:21 +08:00
pdbxpluging update
This commit is contained in:
@@ -28,6 +28,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
float pte_get_vdw_ray(const char *symbol) ;
|
||||
float pte_get_mass(const char *symbol) ;
|
||||
float pte_get_enegativity(const char *symbol) ;
|
||||
float pte_get_enegativity_from_number(int atomicnumber) ;
|
||||
char *pte_get_element_from_number(int atomicnumber);
|
||||
int is_valid_element(const char *str, int ignore_case) ;
|
||||
int element_in_std_res(char *res_name);
|
||||
int element_in_nucl_acid(char *res_name);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -120,10 +120,12 @@ typedef struct {
|
||||
/* chains for existing PDBx/mmCIF files. */
|
||||
char chain[4]; /**< required chain name, or "" */
|
||||
#else
|
||||
char chain[2]; /**< required chain name, or "" */
|
||||
char chain[16]; /**< required chain name, or "" */
|
||||
#endif
|
||||
/* rest are optional; use optflags to specify what's present */
|
||||
char altloc[2]; /**< optional PDB alternate location code */
|
||||
char chain_auth[16]; /**< optional author chain name "" */
|
||||
int resid_auth; /**< optional author integer residue ID */
|
||||
char insertion[2]; /**< optional PDB insertion code */
|
||||
float occupancy; /**< optional occupancy value */
|
||||
float bfactor; /**< optional B-factor value */
|
||||
@@ -131,6 +133,7 @@ typedef struct {
|
||||
float charge; /**< optional charge value */
|
||||
float radius; /**< optional radius value */
|
||||
int atomicnumber; /**< optional element atomic number */
|
||||
int modelnumber; /**< optional model number */
|
||||
|
||||
#if 0
|
||||
char complex[16];
|
||||
@@ -165,6 +168,8 @@ typedef struct {
|
||||
#define MOLFILE_ALTLOC 0x0040 /**< Multiple conformations present */
|
||||
#define MOLFILE_ATOMICNUMBER 0x0080 /**< Atomic element number provided */
|
||||
#define MOLFILE_BONDSSPECIAL 0x0100 /**< Only non-standard bonds provided */
|
||||
#define MOLFILE_CHAIN_AUTH 0x0120 /**< if Author chain id provided */
|
||||
#define MOLFILE_RESID_AUTH 0x0120 /**< if Author resid id provided */
|
||||
#if defined(DESRES_CTNUMBER)
|
||||
#define MOLFILE_CTNUMBER 0x0200 /**< ctnumber provided */
|
||||
#endif
|
||||
191
plugins/include/vmdplugin.h
Normal file
191
plugins/include/vmdplugin.h
Normal file
@@ -0,0 +1,191 @@
|
||||
/***************************************************************************
|
||||
*cr
|
||||
*cr (C) Copyright 1995-2006 The Board of Trustees of the
|
||||
*cr University of Illinois
|
||||
*cr All Rights Reserved
|
||||
*cr
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* RCS INFORMATION:
|
||||
*
|
||||
* $RCSfile: vmdplugin.h,v $
|
||||
* $Author: johns $ $Locker: $ $State: Exp $
|
||||
* $Revision: 1.34 $ $Date: 2018/05/02 03:12:56 $
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/** @file
|
||||
* This header must be included by every VMD plugin library. It defines the
|
||||
* API for every plugin so that VMD can organize the plugins it finds.
|
||||
*/
|
||||
|
||||
#ifndef VMD_PLUGIN_H
|
||||
#define VMD_PLUGIN_H
|
||||
|
||||
|
||||
/*
|
||||
* Preprocessor tricks to make it easier for us to redefine the names of
|
||||
* functions when building static plugins.
|
||||
*/
|
||||
#if !defined(VMDPLUGIN)
|
||||
/**
|
||||
* macro defining VMDPLUGIN if it hasn't already been set to the name of
|
||||
* a static plugin that is being compiled. This is the catch-all case.
|
||||
*/
|
||||
#define VMDPLUGIN vmdplugin
|
||||
#endif
|
||||
/** concatenation macro, joins args x and y together as a single string */
|
||||
#define xcat(x, y) cat(x, y)
|
||||
/** concatenation macro, joins args x and y together as a single string */
|
||||
#define cat(x, y) x ## y
|
||||
|
||||
/*
|
||||
* macros to correctly define plugin function names depending on whether
|
||||
* the plugin is being compiled for static linkage or dynamic loading.
|
||||
* When compiled for static linkage, each plugin needs to have unique
|
||||
* function names for all of its entry points. When compiled for dynamic
|
||||
* loading, the plugins must name their entry points consistently so that
|
||||
* the plugin loading mechanism can find the register, register_tcl, init,
|
||||
* and fini routines via dlopen() or similar operating system interfaces.
|
||||
*/
|
||||
/*@{*/
|
||||
/** Macro names entry points correctly for static linkage or dynamic loading */
|
||||
#define VMDPLUGIN_register xcat(VMDPLUGIN, _register)
|
||||
#define VMDPLUGIN_register_tcl xcat(VMDPLUGIN, _register_tcl)
|
||||
#define VMDPLUGIN_init xcat(VMDPLUGIN, _init)
|
||||
#define VMDPLUGIN_fini xcat(VMDPLUGIN, _fini)
|
||||
/*@}*/
|
||||
|
||||
|
||||
/** "WIN32" is defined on both WIN32 and WIN64 platforms... */
|
||||
#if (defined(WIN32))
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
#if !defined(STATIC_PLUGIN)
|
||||
#if defined(VMDPLUGIN_EXPORTS)
|
||||
/**
|
||||
* Only define DllMain for plugins, not in VMD or in statically linked plugins
|
||||
* VMDPLUGIN_EXPORTS is only defined when compiling dynamically loaded plugins
|
||||
*/
|
||||
BOOL APIENTRY DllMain( HANDLE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#define VMDPLUGIN_API __declspec(dllexport)
|
||||
#else
|
||||
#define VMDPLUGIN_API __declspec(dllimport)
|
||||
#endif /* VMDPLUGIN_EXPORTS */
|
||||
#else /* ! STATIC_PLUGIN */
|
||||
#define VMDPLUGIN_API
|
||||
#endif /* ! STATIC_PLUGIN */
|
||||
#else
|
||||
/** If we're not compiling on Windows, then this macro is defined empty */
|
||||
#define VMDPLUGIN_API
|
||||
#endif
|
||||
|
||||
/** define plugin linkage correctly for both C and C++ based plugins */
|
||||
#ifdef __cplusplus
|
||||
#define VMDPLUGIN_EXTERN extern "C" VMDPLUGIN_API
|
||||
#else
|
||||
#define VMDPLUGIN_EXTERN extern VMDPLUGIN_API
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*
|
||||
* Plugin API functions start here
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Init routine: called the first time the library is loaded by the
|
||||
* application and before any other API functions are referenced.
|
||||
* Return 0 on success.
|
||||
*/
|
||||
VMDPLUGIN_EXTERN int VMDPLUGIN_init(void);
|
||||
|
||||
/**
|
||||
* Macro for creating a struct header used in all plugin structures.
|
||||
*
|
||||
* This header should be placed at the top of every plugin API definition
|
||||
* so that it can be treated as a subtype of the base plugin type.
|
||||
*
|
||||
* abiversion: Defines the ABI for the base plugin type (not for other plugins)
|
||||
* type: A string descriptor of the plugin type.
|
||||
* name: A name for the plugin.
|
||||
* author: A string identifier, possibly including newlines.
|
||||
* Major and minor version.
|
||||
* is_reentrant: Whether this library can be run concurrently with itself.
|
||||
*/
|
||||
#define vmdplugin_HEAD \
|
||||
int abiversion; \
|
||||
const char *type; \
|
||||
const char *name; \
|
||||
const char *prettyname; \
|
||||
const char *author; \
|
||||
int majorv; \
|
||||
int minorv; \
|
||||
int is_reentrant;
|
||||
|
||||
/**
|
||||
* Typedef for generic plugin header, individual plugins can
|
||||
* make their own structures as long as the header info remains
|
||||
* the same as the generic plugin header, most easily done by
|
||||
* using the vmdplugin_HEAD macro.
|
||||
*/
|
||||
typedef struct {
|
||||
vmdplugin_HEAD
|
||||
} vmdplugin_t;
|
||||
|
||||
/**
|
||||
* Use this macro to initialize the abiversion member of each plugin
|
||||
*/
|
||||
#define vmdplugin_ABIVERSION 18
|
||||
|
||||
/*@{*/
|
||||
/** Use this macro to indicate a plugin's thread-safety at registration time */
|
||||
#define VMDPLUGIN_THREADUNSAFE 0
|
||||
#define VMDPLUGIN_THREADSAFE 1
|
||||
/*@}*/
|
||||
|
||||
/*@{*/
|
||||
/** Error return code for use in the plugin registration and init functions */
|
||||
#define VMDPLUGIN_SUCCESS 0
|
||||
#define VMDPLUGIN_ERROR -1
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* Function pointer typedef for register callback functions
|
||||
*/
|
||||
typedef int (*vmdplugin_register_cb)(void *, vmdplugin_t *);
|
||||
|
||||
/**
|
||||
* Allow the library to register plugins with the application.
|
||||
* The callback should be called using the passed-in void pointer, which
|
||||
* should not be interpreted in any way by the library. Each vmdplugin_t
|
||||
* pointer passed to the application should point to statically-allocated
|
||||
* or heap-allocated memory and should never be later modified by the plugin.
|
||||
* Applications must be permitted to retain only a copy of the the plugin
|
||||
* pointer, without making any deep copy of the items in the struct.
|
||||
*/
|
||||
VMDPLUGIN_EXTERN int VMDPLUGIN_register(void *, vmdplugin_register_cb);
|
||||
|
||||
/**
|
||||
* Allow the library to register Tcl extensions.
|
||||
* This API is optional; if found by dlopen, it will be called after first
|
||||
* calling init and register.
|
||||
*/
|
||||
VMDPLUGIN_EXTERN int VMDPLUGIN_register_tcl(void *, void *tcl_interp,
|
||||
vmdplugin_register_cb);
|
||||
|
||||
/**
|
||||
* The Fini method is called when the application will no longer use
|
||||
* any plugins in the library.
|
||||
*/
|
||||
VMDPLUGIN_EXTERN int VMDPLUGIN_fini(void);
|
||||
|
||||
#endif /* VMD_PLUGIN_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -242,6 +242,60 @@ float pte_get_enegativity(const char *symbol)
|
||||
return -1 ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
## FUNCTION:
|
||||
pte_get_element_from_number
|
||||
|
||||
## SPECIFICATION:
|
||||
Returns the symbol for a given element through the atomic number
|
||||
|
||||
## PARAMETERS:
|
||||
@ const char *symbol: The symbol of the element in the periodic table
|
||||
|
||||
## RETURN:
|
||||
char*: atom element symbol
|
||||
|
||||
*/
|
||||
char *pte_get_element_from_number(int atomicnumber)
|
||||
{
|
||||
char tmp[3] ;
|
||||
if(atomicnumber>0 && atomicnumber<112){
|
||||
|
||||
tmp[0] = ST_pte_symbol[atomicnumber][0] ;
|
||||
tmp[1] = ST_pte_symbol[atomicnumber][1] ;
|
||||
tmp[2] = '\0';
|
||||
return tmp;
|
||||
}
|
||||
return -1 ;
|
||||
}
|
||||
|
||||
/**
|
||||
## FUNCTION:
|
||||
pte_get_enegativity_from_number
|
||||
|
||||
## SPECIFICATION:
|
||||
Returns the electronegativity (Pauling) value for a given element
|
||||
|
||||
## PARAMETERS:
|
||||
@ const char *symbol: The symbol of the element in the periodic table
|
||||
|
||||
## RETURN:
|
||||
float: electrobegativity of Pauling corresponding to symbol
|
||||
|
||||
*/
|
||||
float pte_get_enegativity_from_number(int atomicnumber)
|
||||
{
|
||||
if(atomicnumber>0 && atomicnumber<112)
|
||||
return ST_pte_electronegativity[atomicnumber] ;
|
||||
|
||||
|
||||
|
||||
return -1 ;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
## FUNCTION:
|
||||
is_valid_element
|
||||
|
||||
245
src/read_mmcif.c
245
src/read_mmcif.c
@@ -74,132 +74,118 @@ s_pdb *open_mmcif(char *fpath, const char *ligan, const int keep_lig, int model_
|
||||
ts_in.coords = (float *)malloc(3 * inatoms * sizeof(float)); /*allocating space for the coords*/
|
||||
rc2 = api->read_structure(h_in, &optflags, at_in);
|
||||
rc = api->read_next_timestep(h_in, inatoms, &ts_in);
|
||||
//printf("%s | %s |%d\n", fpath, filetype, inatoms);
|
||||
//print_molfile_atom_t(at_in, ts_in, inatoms);
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
//printf("Model Number : %d\n",model_number);
|
||||
if (model_number > 0)
|
||||
model_flag = 1; /*here we indicate that a particular model should be read only*/
|
||||
|
||||
if(!model_number) model_number=1;
|
||||
model_flag=1;
|
||||
for (i = 0; i < inatoms; i++) /*loop to go through all atoms*/
|
||||
{
|
||||
//printf("%d/%d\n", i, inatoms);
|
||||
if (model_flag == 0 || model_read == 1)
|
||||
if (at_in[i].altloc[0] == '.' || at_in[i].altloc[0] == '\0')
|
||||
at_in[i].altloc[0] = ' ';
|
||||
if (at_in[i].modelnumber==model_number && !strncmp(at_in[i].atom_type, "ATOM", 4) && !is_ligand(par->chain_as_ligand,at_in[i].chain[0]))
|
||||
{
|
||||
if (at_in[i].altloc[0] == '.')
|
||||
at_in[i].altloc[0] = ' ';
|
||||
if (!strncmp(at_in[i].atom_type, "ATOM", 4) && !is_ligand(par->chain_as_ligand,at_in[i].chain[0]))
|
||||
|
||||
if (at_in[i].altloc[0] == ' ' || at_in[i].altloc[0] == 'A')
|
||||
{
|
||||
if (at_in[i].altloc[0] == ' ' || at_in[i].altloc[0] == 'A')
|
||||
if (chains_to_delete(par->chain_delete, at_in[i].chain[0], par->chain_is_kept))
|
||||
{
|
||||
|
||||
//printf("TYPE : %s ` %d \n",at_in[i].name,i );
|
||||
|
||||
if (chains_to_delete(par->chain_delete, at_in[i].chain[0], par->chain_is_kept))
|
||||
/* Atom entry: check if there is a ligand in there (just in case)... */
|
||||
if (ligan && strlen(ligan) > 1 && ligan[0] == at_in[i].resname[0] && ligan[1] == at_in[i].resname[1] && ligan[2] == at_in[i].resname[2])
|
||||
{
|
||||
/* Atom entry: check if there is a ligand in there (just in case)... */
|
||||
if (ligan && strlen(ligan) > 1 && ligan[0] == at_in[i].resname[0] && ligan[1] == at_in[i].resname[1] && ligan[2] == at_in[i].resname[2])
|
||||
{
|
||||
if (keep_lig)
|
||||
{
|
||||
natm_lig++;
|
||||
natoms++;
|
||||
}
|
||||
/*check this function*/
|
||||
}
|
||||
else if (ligan && strlen(ligan) == 1 && at_in[i].chain[0] == ligan[0])
|
||||
{ /*here we have a protein chain defined as ligand...a bit more complex then*/
|
||||
if (keep_lig)
|
||||
{
|
||||
natm_lig++;
|
||||
natoms++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
natoms++;
|
||||
}
|
||||
}
|
||||
if (par->xlig_resnumber > -1)
|
||||
{
|
||||
|
||||
// if (resb[0] == par->xlig_resname[0] && resb[1] == par->xlig_resname[1] && resb[2] == par->xlig_resname[2]) {
|
||||
//fprintf(stdout,"%s\t%s\n",buf[16],par->xlig_chain_code);
|
||||
|
||||
if (at_in[i].chain[0] == par->xlig_chain_code[0] && at_in[i].resid == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2])
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
//fprintf(stdout, "%d\n", pdb->n_xlig_atoms);
|
||||
}
|
||||
|
||||
if (is_ligand(par->chain_as_ligand,at_in[i].chain[0]))
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
//fprintf(stdout, "%d\t", pdb->n_xlig_atoms);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!strncmp(at_in[i].atom_type, "HETATM", 6) || (!strncmp(at_in[i].atom_type, "ATOM", 4) && is_ligand(par->chain_as_ligand,at_in[i].chain[0])))
|
||||
{
|
||||
|
||||
if (at_in[i].altloc[0] == ' ' || at_in[i].altloc[0] == 'A')
|
||||
{
|
||||
|
||||
if (chains_to_delete(par->chain_delete, at_in[i].chain[0], par->chain_is_kept))
|
||||
{
|
||||
if (ligan && strlen(ligan) > 1 && keep_lig && ligan[0] == at_in[i].resname[0] && ligan[1] == at_in[i].resname[1] && ligan[2] == at_in[i].resname[2])
|
||||
if (keep_lig)
|
||||
{
|
||||
natm_lig++;
|
||||
natoms++;
|
||||
}
|
||||
else if (ligan && strlen(ligan) == 1 && ligan[0] == at_in[i].chain[0])
|
||||
/*check this function*/
|
||||
}
|
||||
else if (ligan && strlen(ligan) == 1 && at_in[i].chain[0] == ligan[0])
|
||||
{ /*here we have a protein chain defined as ligand...a bit more complex then*/
|
||||
if (keep_lig)
|
||||
{
|
||||
if (keep_lig)
|
||||
natm_lig++;
|
||||
natm_lig++;
|
||||
natoms++;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Keep specific HETATM given in the static list ST_keep_hetatm */
|
||||
if ((keep_lig && !ligan && strncmp(at_in[i].resname, "HOH", 3) && strncmp(at_in[i].resname, "WAT", 3) && strncmp(at_in[i].resname, "TIP", 3)) || (keep_lig && is_ligand(par->chain_as_ligand,at_in[i].chain[0])))
|
||||
{
|
||||
//printf("N hetatm : %d\n", nhetatm);
|
||||
//printf("%s|%c ",resb,buf[21]);
|
||||
natoms++;
|
||||
nhetatm++;
|
||||
}
|
||||
else if (!is_ligand(par->chain_as_ligand,at_in[i].chain[0]))
|
||||
{
|
||||
for (j = 0; j < ST_nb_keep_hetatm; j++)
|
||||
{
|
||||
if (ST_keep_hetatm[j][0] == at_in[i].resname[0] && ST_keep_hetatm[j][1] == at_in[i].resname[1] && ST_keep_hetatm[j][2] == at_in[i].resname[2])
|
||||
{
|
||||
nhetatm++;
|
||||
natoms++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (par->xlig_resnumber > -1)
|
||||
else
|
||||
{
|
||||
natoms++;
|
||||
}
|
||||
}
|
||||
if (par->xlig_resnumber > -1)
|
||||
{
|
||||
|
||||
// if (resb[0] == par->xlig_resname[0] && resb[1] == par->xlig_resname[1] && resb[2] == par->xlig_resname[2]) {
|
||||
//fprintf(stdout,"%s\t%s\n",buf[16],par->xlig_chain_code);
|
||||
|
||||
if ((at_in[i].chain[0] == par->xlig_chain_code[0] && at_in[i].resid == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == par->xlig_chain_code[0] && at_in[i].resid_auth == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]))
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
}
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
//fprintf(stdout, "%d\n", pdb->n_xlig_atoms);
|
||||
}
|
||||
|
||||
if (is_ligand(par->chain_as_ligand,at_in[i].chain[0]))
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
//fprintf(stdout, "H%d\t", pdb->n_xlig_atoms);
|
||||
//fprintf(stdout, "%d\t", pdb->n_xlig_atoms);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (at_in[i].modelnumber==model_number && !strncmp(at_in[i].atom_type, "HETATM", 6) || (!strncmp(at_in[i].atom_type, "ATOM", 4) && is_ligand(par->chain_as_ligand,at_in[i].chain[0])))
|
||||
{
|
||||
|
||||
if (at_in[i].altloc[0] == ' ' || at_in[i].altloc[0] == 'A' || at_in[i].altloc[0] == '1' )
|
||||
{
|
||||
|
||||
if (chains_to_delete(par->chain_delete, at_in[i].chain[0], par->chain_is_kept))
|
||||
{
|
||||
if (ligan && strlen(ligan) > 1 && keep_lig && ligan[0] == at_in[i].resname[0] && ligan[1] == at_in[i].resname[1] && ligan[2] == at_in[i].resname[2])
|
||||
{
|
||||
natm_lig++;
|
||||
natoms++;
|
||||
}
|
||||
else if (ligan && strlen(ligan) == 1 && ligan[0] == at_in[i].chain[0])
|
||||
{
|
||||
if (keep_lig)
|
||||
natm_lig++;
|
||||
natoms++;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Keep specific HETATM given in the static list ST_keep_hetatm */
|
||||
if ((keep_lig && !ligan && strncmp(at_in[i].resname, "HOH", 3) && strncmp(at_in[i].resname, "WAT", 3) && strncmp(at_in[i].resname, "TIP", 3)) || (keep_lig && is_ligand(par->chain_as_ligand,at_in[i].chain[0])))
|
||||
{
|
||||
|
||||
natoms++;
|
||||
nhetatm++;
|
||||
}
|
||||
else if (!is_ligand(par->chain_as_ligand,at_in[i].chain[0]))
|
||||
{
|
||||
for (j = 0; j < ST_nb_keep_hetatm; j++)
|
||||
{
|
||||
if (ST_keep_hetatm[j][0] == at_in[i].resname[0] && ST_keep_hetatm[j][1] == at_in[i].resname[1] && ST_keep_hetatm[j][2] == at_in[i].resname[2])
|
||||
{
|
||||
nhetatm++;
|
||||
natoms++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (par->xlig_resnumber > -1)
|
||||
{
|
||||
if ((at_in[i].chain[0] == par->xlig_chain_code[0] && at_in[i].resid == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == par->xlig_chain_code[0] && at_in[i].resid_auth == par->xlig_resnumber && par->xlig_resname[0] == at_in[i].resname[0] && par->xlig_resname[1] == at_in[i].resname[1] && par->xlig_resname[2] == at_in[i].resname[2]))
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
}
|
||||
}
|
||||
if (is_ligand(par->chain_as_ligand,at_in[i].chain[0]))
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (pdb->n_xlig_atoms)
|
||||
@@ -290,23 +276,19 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
|
||||
rc = api->read_next_timestep(h_in, inatoms, &ts_in);
|
||||
//printf("READ : %s | %s |%d\n", pdb->fname, filetype, inatoms);
|
||||
/* Loop over the pdb file */
|
||||
if (model_number > 0)
|
||||
model_flag = 1; /*here we indicate that a particular model should be read only*/
|
||||
model_flag=1;
|
||||
if (!model_number ) model_number = 1;
|
||||
; /*here we indicate that a particular model should be read only*/
|
||||
for (i = 0; i < inatoms; i++)
|
||||
{
|
||||
if (at_in[i].altloc[0] == '.')
|
||||
if (at_in[i].altloc[0] == '.' || at_in[i].altloc[0] == '\0')
|
||||
at_in[i].altloc[0] = ' ';
|
||||
//printf("%d/%d \n", i, inatoms);
|
||||
if (model_flag == 0 || model_read == 1)
|
||||
{
|
||||
//printf("%c \n",at_in[i].altloc[0]);
|
||||
if (!strncmp(at_in[i].atom_type, "ATOM", 4) && !is_ligand(params->chain_as_ligand,at_in[i].chain[0]))
|
||||
|
||||
if (at_in[i].modelnumber==model_number && !strncmp(at_in[i].atom_type, "ATOM", 4) && !is_ligand(params->chain_as_ligand,at_in[i].chain[0]))
|
||||
{
|
||||
//printf("TYPE : %s ` %d \n",at_in[i].name,i );
|
||||
//printf("%c \n",at_in[i].altloc[0]); /* column 16 check for configuration of the residue e.g A,B */
|
||||
if (at_in[i].altloc[0] == ' ' || at_in[i].altloc[0] == 'A')
|
||||
|
||||
if (at_in[i].altloc[0] == ' ' || at_in[i].altloc[0] == 'A' || at_in[i].altloc[0] == '1')
|
||||
{ /*if within first occurence*/
|
||||
//printf("%c \n",at_in[i].altloc[0]);
|
||||
/* Enter this if when arg in command line is -r */
|
||||
if (pdb->n_xlig_atoms)
|
||||
{
|
||||
@@ -350,7 +332,8 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
|
||||
atom->z = ts_in.coords[(3 * i) + 2];
|
||||
atom->occupancy = at_in[i].occupancy;
|
||||
atom->bfactor = at_in[i].bfactor;
|
||||
strcpy(atom->symbol, at_in[i].name);
|
||||
strncpy(atom->symbol, pte_get_element_from_number(at_in[i].atomicnumber),3);
|
||||
|
||||
|
||||
atom->charge = at_in[i].charge;
|
||||
atom->mass = at_in[i].mass;
|
||||
@@ -387,7 +370,8 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
|
||||
atom->z = ts_in.coords[(3 * i) + 2];
|
||||
atom->occupancy = at_in[i].occupancy;
|
||||
atom->bfactor = at_in[i].bfactor;
|
||||
strcpy(atom->symbol, at_in[i].name);
|
||||
strncpy(atom->symbol, pte_get_element_from_number(at_in[i].atomicnumber),3);
|
||||
|
||||
|
||||
atom->charge = at_in[i].charge;
|
||||
atom->mass = at_in[i].mass;
|
||||
@@ -430,17 +414,19 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
|
||||
atom->res_id = at_in[i].resid;
|
||||
atom->pdb_insert = at_in[i].insertion[0];
|
||||
//printf("ins:%s",at_in[i].insertion);
|
||||
|
||||
atom->x = ts_in.coords[(3 * i)];
|
||||
atom->y = ts_in.coords[(3 * i) + 1];
|
||||
atom->z = ts_in.coords[(3 * i) + 2];
|
||||
atom->occupancy = at_in[i].occupancy;
|
||||
atom->bfactor = at_in[i].bfactor;
|
||||
strcpy(atom->symbol, at_in[i].name);
|
||||
|
||||
strncpy(atom->symbol, pte_get_element_from_number(at_in[i].atomicnumber),3);
|
||||
|
||||
atom->charge = at_in[i].charge;
|
||||
atom->mass = at_in[i].mass;
|
||||
atom->radius = at_in[i].radius;
|
||||
atom->electroneg = pte_get_enegativity(atom->symbol);
|
||||
|
||||
atom->electroneg = pte_get_enegativity_from_number(at_in[i].atomicnumber);
|
||||
guess_flag +=1;
|
||||
|
||||
/* Store additional information not given in the pdb */
|
||||
@@ -452,16 +438,16 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
|
||||
|
||||
atoms_p[iatoms] = atom;
|
||||
iatoms++;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!strncmp(at_in[i].atom_type, "HETATM", 6) || (!strncmp(at_in[i].atom_type, "ATOM", 4) && is_ligand(params->chain_as_ligand,at_in[i].chain[0])))
|
||||
else if (at_in[i].modelnumber==model_number && !strncmp(at_in[i].atom_type, "HETATM", 6) || (!strncmp(at_in[i].atom_type, "ATOM", 4) && is_ligand(params->chain_as_ligand,at_in[i].chain[0])))
|
||||
{
|
||||
|
||||
if (at_in[i].altloc[0] == ' ' || at_in[i].altloc[0] == 'A')
|
||||
if (at_in[i].altloc[0] == ' ' || at_in[i].altloc[0] == 'A' || at_in[i].altloc[0] == '1')
|
||||
{ /*first occurence*/
|
||||
//printf("ATOM TYPE: %s",at_in[i].atom_type);
|
||||
if (pdb->n_xlig_atoms)
|
||||
{
|
||||
if ((at_in[i].chain[0] == params->xlig_chain_code[0] && at_in[i].resid == params->xlig_resnumber && params->xlig_resname[0] == at_in[i].resname[0] && params->xlig_resname[1] == at_in[i].resname[1] && params->xlig_resname[2] == at_in[i].resname[2]) || (at_in[i].chain_auth[0] == params->xlig_chain_code[0] && at_in[i].resid_auth == params->xlig_resnumber && params->xlig_resname[0] == at_in[i].resname[0] && params->xlig_resname[1] == at_in[i].resname[1] && params->xlig_resname[2] == at_in[i].resname[2]))
|
||||
@@ -506,7 +492,8 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
|
||||
atom->z = ts_in.coords[(3 * i) + 2];
|
||||
atom->occupancy = at_in[i].occupancy;
|
||||
atom->bfactor = at_in[i].bfactor;
|
||||
strcpy(atom->symbol, at_in[i].name);
|
||||
strncpy(atom->symbol, pte_get_element_from_number(at_in[i].atomicnumber),3);
|
||||
|
||||
|
||||
atom->charge = at_in[i].charge;
|
||||
atom->mass = at_in[i].mass;
|
||||
@@ -543,7 +530,8 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
|
||||
atom->z = ts_in.coords[(3 * i) + 2];
|
||||
atom->occupancy = at_in[i].occupancy;
|
||||
atom->bfactor = at_in[i].bfactor;
|
||||
strcpy(atom->symbol, at_in[i].name);
|
||||
strncpy(atom->symbol, pte_get_element_from_number(at_in[i].atomicnumber),3);
|
||||
|
||||
|
||||
atom->charge = at_in[i].charge;
|
||||
atom->mass = at_in[i].mass;
|
||||
@@ -581,7 +569,8 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
|
||||
atom->z = ts_in.coords[(3 * i) + 2];
|
||||
atom->occupancy = at_in[i].occupancy;
|
||||
atom->bfactor = at_in[i].bfactor;
|
||||
strcpy(atom->symbol, at_in[i].name);
|
||||
strncpy(atom->symbol, pte_get_element_from_number(at_in[i].atomicnumber),3);
|
||||
|
||||
|
||||
atom->charge = at_in[i].charge;
|
||||
atom->mass = at_in[i].mass;
|
||||
@@ -619,7 +608,8 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
|
||||
atom->z = ts_in.coords[(3 * i) + 2];
|
||||
atom->occupancy = at_in[i].occupancy;
|
||||
atom->bfactor = at_in[i].bfactor;
|
||||
strcpy(atom->symbol, at_in[i].name);
|
||||
strncpy(atom->symbol, pte_get_element_from_number(at_in[i].atomicnumber),3);
|
||||
|
||||
|
||||
atom->charge = at_in[i].charge;
|
||||
atom->mass = at_in[i].mass;
|
||||
@@ -646,11 +636,8 @@ void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_num
|
||||
rpdb_extract_cryst1(pdb_line, &(pdb->alpha), &(pdb->beta), &(pdb->gamma),
|
||||
&(pdb->A), &(pdb->B), &(pdb->C));
|
||||
}
|
||||
else if (model_read == 1 && !strncmp(at_in[i].atom_type, "ENDMDL", 6))
|
||||
model_read = 0;
|
||||
else if (model_number == 0 && !strncmp(at_in[i].atom_type, "END ", 3))
|
||||
else if (!strncmp(at_in[i].atom_type, "END ", 3))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pdb->avg_bfactor = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user