mirror of
https://github.com/Discngine/fpocket.git
synced 2026-06-04 11:54:21 +08:00
mmcif_reading works but outputs fatal error
This commit is contained in:
1969
data/sample/1UYD_wrote.cif
Normal file
1969
data/sample/1UYD_wrote.cif
Normal file
File diff suppressed because it is too large
Load Diff
1952
data/sample/1UYD_wrote.pdb
Normal file
1952
data/sample/1UYD_wrote.pdb
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
5439
data/sample/2P0R_wrote.pdb
Normal file
5439
data/sample/2P0R_wrote.pdb
Normal file
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,9 @@
|
||||
#include "libmolfile_plugin.h"
|
||||
#include "molfile_plugin.h"
|
||||
|
||||
void open_mmcif(const char *filepath, const char *filetype, int natoms);
|
||||
s_pdb *open_mmcif(char *fpath, const char *ligan, const int keep_lig, int model_number, s_fparams *par);
|
||||
|
||||
void print_molfile_atom_t(molfile_atom_t *at_in, molfile_timestep_t ts_in, int inatoms);
|
||||
void write_files(molfile_atom_t *at_in, molfile_timestep_t ts_in, int inatoms, int optflags, char *filetype);
|
||||
void read_mmcif(s_pdb *pdb, const char *ligan, const int keep_lig, int model_number, s_fparams *params);
|
||||
#endif
|
||||
Binary file not shown.
BIN
plugins/LINUXAMD64/bin/catdcd5.2/catdcd
Executable file
BIN
plugins/LINUXAMD64/bin/catdcd5.2/catdcd
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
plugins/LINUXAMD64/molfile/amiraplugin.so
Executable file
BIN
plugins/LINUXAMD64/molfile/amiraplugin.so
Executable file
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.
@@ -9,6 +9,9 @@ extern "C" {
|
||||
extern int molfile_abinitplugin_init(void);
|
||||
extern int molfile_abinitplugin_register(void *, vmdplugin_register_cb);
|
||||
extern int molfile_abinitplugin_fini(void);
|
||||
extern int molfile_amiraplugin_init(void);
|
||||
extern int molfile_amiraplugin_register(void *, vmdplugin_register_cb);
|
||||
extern int molfile_amiraplugin_fini(void);
|
||||
extern int molfile_avsplugin_init(void);
|
||||
extern int molfile_avsplugin_register(void *, vmdplugin_register_cb);
|
||||
extern int molfile_avsplugin_fini(void);
|
||||
@@ -201,9 +204,13 @@ extern int molfile_dtrplugin_fini(void);
|
||||
extern int molfile_maeffplugin_init(void);
|
||||
extern int molfile_maeffplugin_register(void *, vmdplugin_register_cb);
|
||||
extern int molfile_maeffplugin_fini(void);
|
||||
extern int molfile_orcaplugin_init(void);
|
||||
extern int molfile_orcaplugin_register(void *, vmdplugin_register_cb);
|
||||
extern int molfile_orcaplugin_fini(void);
|
||||
|
||||
#define MOLFILE_INIT_ALL \
|
||||
molfile_abinitplugin_init(); \
|
||||
molfile_amiraplugin_init(); \
|
||||
molfile_avsplugin_init(); \
|
||||
molfile_babelplugin_init(); \
|
||||
molfile_basissetplugin_init(); \
|
||||
@@ -268,9 +275,11 @@ extern int molfile_maeffplugin_fini(void);
|
||||
molfile_xyzplugin_init(); \
|
||||
molfile_dtrplugin_init(); \
|
||||
molfile_maeffplugin_init(); \
|
||||
molfile_orcaplugin_init(); \
|
||||
|
||||
#define MOLFILE_REGISTER_ALL(v, cb) \
|
||||
molfile_abinitplugin_register(v, cb); \
|
||||
molfile_amiraplugin_register(v, cb); \
|
||||
molfile_avsplugin_register(v, cb); \
|
||||
molfile_babelplugin_register(v, cb); \
|
||||
molfile_basissetplugin_register(v, cb); \
|
||||
@@ -335,9 +344,11 @@ extern int molfile_maeffplugin_fini(void);
|
||||
molfile_xyzplugin_register(v, cb); \
|
||||
molfile_dtrplugin_register(v, cb); \
|
||||
molfile_maeffplugin_register(v, cb); \
|
||||
molfile_orcaplugin_register(v, cb); \
|
||||
|
||||
#define MOLFILE_FINI_ALL \
|
||||
molfile_abinitplugin_fini(); \
|
||||
molfile_amiraplugin_fini(); \
|
||||
molfile_avsplugin_fini(); \
|
||||
molfile_babelplugin_fini(); \
|
||||
molfile_basissetplugin_fini(); \
|
||||
@@ -402,6 +413,7 @@ extern int molfile_maeffplugin_fini(void);
|
||||
molfile_xyzplugin_fini(); \
|
||||
molfile_dtrplugin_fini(); \
|
||||
molfile_maeffplugin_fini(); \
|
||||
molfile_orcaplugin_fini(); \
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
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.
BIN
plugins/LINUXAMD64/molfile/orcaplugin.so
Executable file
BIN
plugins/LINUXAMD64/molfile/orcaplugin.so
Executable file
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.
@@ -1,5 +1,5 @@
|
||||
/import_graphics_plugin.h/1.5/Fri Sep 21 19:43:10 2007//
|
||||
/vmdconio.h/1.4/Sun Oct 11 22:36:27 2015//
|
||||
/vmdplugin.h/1.33/Thu Oct 29 05:10:54 2015//
|
||||
/molfile_plugin.h/1.108/Fri Feb 26 03:17:01 2016//
|
||||
/vmdplugin.h/1.34/Wed May 2 03:12:56 2018//
|
||||
/molfile_plugin.h/1.112/Thu Oct 17 06:12:24 2019//
|
||||
D
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*
|
||||
* $RCSfile: molfile_plugin.h,v $
|
||||
* $Author: johns $ $Locker: $ $State: Exp $
|
||||
* $Revision: 1.108 $ $Date: 2016/02/26 03:17:01 $
|
||||
* $Revision: 1.112 $ $Date: 2019/10/17 06:12:24 $
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
@@ -57,8 +57,7 @@ typedef ssize_t molfile_ssize_t; /**< for frame counts */
|
||||
#define MOLFILE_BUFSIZ 81 /**< maximum chars in string data */
|
||||
#define MOLFILE_BIGBUFSIZ 4096 /**< maximum chars in long strings */
|
||||
|
||||
#define MOLFILE_MAXWAVEPERTS 25 /**< maximum number of wavefunctions
|
||||
* per timestep */
|
||||
#define MOLFILE_MAXWAVEPERTS 25 /**< maximum number of wavefunctions per timestep */
|
||||
|
||||
/**
|
||||
* Hard-coded direct-I/O page size constants for use by both VMD
|
||||
@@ -106,12 +105,13 @@ typedef struct {
|
||||
*/
|
||||
typedef struct {
|
||||
/* these fields absolutely must be set or initialized to empty */
|
||||
char atom_type[8];
|
||||
char name[16]; /**< required atom name string */
|
||||
char type[16]; /**< required atom type string */
|
||||
char resname[8]; /**< required residue name string */
|
||||
int resid; /**< required integer residue ID */
|
||||
char segid[8]; /**< required segment name string, or "" */
|
||||
#if 0 && vmdplugin_ABIVERSION > 17
|
||||
#if 0 && vmdplugin_ABIVERSION > 10000
|
||||
/* The new PDB file formats allows for much larger structures, */
|
||||
/* which can therefore require longer chain ID strings. The */
|
||||
/* new PDBx/mmCIF file formats do not have length limits on */
|
||||
@@ -187,9 +187,54 @@ typedef struct molfile_timestep_metadata {
|
||||
int has_velocities; /**< if timesteps have velocities */
|
||||
} molfile_timestep_metadata_t;
|
||||
|
||||
/*
|
||||
* Per-timestep atom coordinates and periodic cell information
|
||||
|
||||
/*
|
||||
*
|
||||
* Per-timestep atom coordinates, velocities, forces, energies,
|
||||
* and periodic cell information
|
||||
*
|
||||
*/
|
||||
|
||||
#if 0
|
||||
/**
|
||||
* Periodically stored energies of various kinds
|
||||
*/
|
||||
typedef struct {
|
||||
int energyflags; // XXX indicate use and semantics of data fields
|
||||
|
||||
double total_energy; // XXX these copied from DESRES_READ_TIMESTEP2 case
|
||||
double potential_energy;
|
||||
double kinetic_energy;
|
||||
double extended_energy;
|
||||
double force_energy;
|
||||
double total_pressure;
|
||||
|
||||
// Alchemical free energy methods need to store individual energy samples.
|
||||
// We don't really want pre-averaged quantities, they lead to problems later.
|
||||
double lambda; // data gen sim parm: + aux scheduling + soft core parm
|
||||
double temperature; // temp set by thermostat
|
||||
// either we use deltaU, or we store U and Uprime...
|
||||
double deltaU; // Ulambda - Ulambdaprime
|
||||
double Ulambda; // U for lambda
|
||||
double Ulambdaprime; // U for lambdaprime
|
||||
|
||||
// IDWS methods
|
||||
// XXX both values of lambdaprime and required de-interleaving information
|
||||
|
||||
// Replica exchange methods
|
||||
// XXX rectangle sample params?
|
||||
|
||||
// REST2 method
|
||||
// XXX
|
||||
|
||||
} molfile_energies_t;
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Per-timestep atom coordinates, velocities, time, energies
|
||||
* and periodic cell info
|
||||
*/
|
||||
typedef struct {
|
||||
float *coords; /**< coordinates of all atoms, arranged xyzxyzxyz */
|
||||
float *velocities; /**< space for velocities of all atoms; same layout */
|
||||
@@ -839,6 +884,29 @@ typedef struct {
|
||||
int (* read_qm_rundata)(void *, molfile_qm_t *qmdata);
|
||||
|
||||
|
||||
/**
|
||||
* Query the molfile plugin to determine whether or not memory
|
||||
* allocations used for atomic coordinates and PBC unit cell information
|
||||
* need to be aligned to a particular virtual memory or filesystem
|
||||
* page size boundary to facilitate kernel-bypass unbuffered I/O,
|
||||
* e.g., as used by jsplugin. This API should be called prior to the
|
||||
* first call to read a timestep. The required page alignment size
|
||||
* (in bytes) is returned to the caller. If this API has not been
|
||||
* called, then the molfile plugin should revert to standard
|
||||
* kernel-buffered I/O and suffer the associated performance loss.
|
||||
* The caller can be assured that the plugin will not request any
|
||||
* page alignment size that is greater than the value of
|
||||
* MOLFILE_DIRECTIO_MAX_BLOCK_SIZE, both as a runtime sanity check,
|
||||
* and to ensure that a caller that is unable to perform the max
|
||||
* aligned allocation doesn't call the API in the first place.
|
||||
* If a page-aligned allocation is not required for the file being read,
|
||||
* the plugin will return an alignment size of 1.
|
||||
*/
|
||||
#if vmdplugin_ABIVERSION > 17
|
||||
int (* read_timestep_pagealign_size)(void *, int *pagealignsize);
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Read the next timestep from the file. Return MOLFILE_SUCCESS, or
|
||||
* MOLFILE_EOF on EOF. If the molfile_timestep_t or molfile_qm_metadata_t
|
||||
@@ -862,6 +930,25 @@ typedef struct {
|
||||
int (* read_timestep_metadata)(void *, molfile_timestep_metadata_t *);
|
||||
int (* read_qm_timestep_metadata)(void *, molfile_qm_timestep_metadata_t *);
|
||||
|
||||
|
||||
#if defined(EXPERIMENTAL_DIRECTIO_APIS)
|
||||
/**
|
||||
* Calculate file offsets and I/O lengths for performing
|
||||
* kernel-bypass direct I/O or using GPU-Direct Storage APIs,
|
||||
* thereby enabling peak I/O rates to be achieved for analysis
|
||||
* worksloads like clustering of trajectories.
|
||||
*/
|
||||
int (* calc_fileoffsets_timestep)(void *,
|
||||
molfile_ssize_t frameindex,
|
||||
int firstatom,
|
||||
int lastatom,
|
||||
int *firstatom,
|
||||
int *pageoffset,
|
||||
molfile_ssize_t *startoffset,
|
||||
molfile_ssize_t *readlen);
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(DESRES_READ_TIMESTEP2)
|
||||
/**
|
||||
* Read a specified timestep!
|
||||
|
||||
212
plugins/include/render_plugin.h
Normal file
212
plugins/include/render_plugin.h
Normal file
@@ -0,0 +1,212 @@
|
||||
/***************************************************************************
|
||||
*cr
|
||||
*cr (C) Copyright 1995-2006 The Board of Trustees of the
|
||||
*cr University of Illinois
|
||||
*cr All Rights Reserved
|
||||
*cr
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* RCS INFORMATION:
|
||||
*
|
||||
* $RCSfile: molfile_plugin.h,v $
|
||||
* $Author: johns $ $Locker: $ $State: Exp $
|
||||
* $Revision: 1.108 $ $Date: 2016/02/26 03:17:01 $
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/** @file
|
||||
* API for C extensions to define a way to control VMD rendering for inclusion
|
||||
* in third-party rendering workflows.
|
||||
*/
|
||||
|
||||
#ifndef RENDER_PLUGIN_H
|
||||
#define RENDER_PLUGIN_H
|
||||
|
||||
#include "vmdplugin.h"
|
||||
|
||||
/**
|
||||
* Define a common plugin type to be used when registering the plugin.
|
||||
*/
|
||||
#define RENDER_PLUGIN_TYPE "render control"
|
||||
|
||||
/* File plugin symbolic constants for better code readability */
|
||||
#define RENDER_SUCCESS 0 /**< succeeded in reading file */
|
||||
#define RENDER_ERROR -1 /**< error reading/opening a file */
|
||||
|
||||
/**
|
||||
* Camera definition in global coordinate system
|
||||
*/
|
||||
typedef struct {
|
||||
Vector pos; /**< camera position */
|
||||
Vector fwd; /**< camera forward vector ("-Z" in OpenGL style) */
|
||||
Vector up; /**< camera up vector ("+Y" in OpenGL style) */
|
||||
double fov_y; /**< field-of-view in Y (vertical) axis (degrees) */
|
||||
|
||||
/** XXX work on these some more
|
||||
double scale; /* global scale. (in which sense?
|
||||
* Does cale=0.1 make the camera small,
|
||||
* or make the world small?)
|
||||
*/
|
||||
|
||||
int as_dome; /**< 0=> planar projection, 1=> dome rendering */
|
||||
} vcam_camdef_t;
|
||||
|
||||
|
||||
/**
|
||||
* global read-only values that would be nice to know
|
||||
* Supposing there's a 4x4 matrix type called Matrix, and a 3-d Vector type
|
||||
*/
|
||||
typedef struct {
|
||||
Matrix mrotate;
|
||||
Matrix mcenter;
|
||||
Matrix mscale;
|
||||
Matrix mglobal;
|
||||
Vector vback; // "back" translation of camera
|
||||
// (seems to be 0,0,-2 by default?)
|
||||
// other stuff? framebuffer resolution?
|
||||
// aspect ratio? stereo separation in
|
||||
// camera-coordinate units? Global scale?
|
||||
} vcam_cam_globals_t;
|
||||
|
||||
|
||||
// When we ask VMD to take a screen snapshot, what type?
|
||||
typedef enum {
|
||||
SNAP_RGB8, // grab a memory buffer and pass it to us,
|
||||
// of 8-bit RGB/RGBA pixels
|
||||
// do we care about option of greater bit
|
||||
// depths, like 16-bit or float per-channel?
|
||||
// Does VMD do rendering that would take
|
||||
// advantage of it?
|
||||
|
||||
|
||||
SNAP_PNG, // Save as PNG image (or JPEG or TGA or PPM
|
||||
// or whatever you support)
|
||||
// (with alpha if requested) JPEG? H264?
|
||||
|
||||
// XXX add these?
|
||||
SNAP_PPM, // 24-bit RGB PPM
|
||||
SNAP_PPM48, // 48-bit RGB PPM
|
||||
SNAP_TGA, // 24-bit RGB Targa
|
||||
vcam_snaptype_t;
|
||||
|
||||
|
||||
// description of a snapshot after it's taken.
|
||||
typedef struct {
|
||||
int xsize; // image width
|
||||
int ysize;
|
||||
int channels; // number of channels (3 or 4 for RGB vs RGBA)
|
||||
int bpchan; // bytes per channel value (1 for 8-bit, 2 for 16-bit, 4 for float?)
|
||||
int bprow; // bytes per row (may be bpchan*channels*xsize or a bit bigger if padded)
|
||||
|
||||
void *data; // pointer to image array.
|
||||
// Data owned by VMD - plugin shouldn't rely on
|
||||
// it existing after return? and shouldn't write
|
||||
// to it.
|
||||
// data may be NULL if we asked for
|
||||
// snapshot to be saved to an image file.
|
||||
} vcam_snap_t;
|
||||
|
||||
|
||||
// XXX I don't think we need this anymore
|
||||
#define VCAM_VERSION 0x0100
|
||||
|
||||
// struct-full-of-callback-pointers, set at plugin initialization
|
||||
typedef struct {
|
||||
// magic number. Allows checking for future-incompatible
|
||||
// versions of this interface
|
||||
int version;
|
||||
|
||||
// Ask VMD to render next frame using this camera viewpoint/setup.
|
||||
// I'm assuming we can't ask for a change in resolution, but
|
||||
// can ask for a different FOV or dome/planar setup... OK?
|
||||
void (*set_cam)( vcam_camdef_t * );
|
||||
|
||||
// Ask VMD to take a screen snapshot of next rendered frame.
|
||||
// VMD will call *us* back (vcam_snapped() below) when
|
||||
// it's done, and tell us image resolution etc.
|
||||
// Assuming this is a one-shot - if we want more snapshots,
|
||||
// we have to call this again for each frame
|
||||
// If VMD's framebuffer records alpha (even 0-vs-1 coverage),
|
||||
// it might be nice to allow passing that along.
|
||||
// If there's no alpha recorded there, then nevermind offering
|
||||
// that option.
|
||||
// filename would be NULL if we're asking for a raw RGB/RGBA buffer
|
||||
void (*take_snap)( vcam_snaptype_t style, int withalpha, char *filename );
|
||||
|
||||
// ask for values of camera-related global variables, something like that?
|
||||
void (*get_cam_globals)( vcam_cam_globals_t * );
|
||||
} vcam_init_t;
|
||||
|
||||
|
||||
Functions in the plugin that VMD may call:
|
||||
void vcam_init( struct vcam_init_t * );
|
||||
// called once at startup.
|
||||
// If the plugin receives an interface version that it can't handle,
|
||||
// then it should ignore calls to any of the other entry points.
|
||||
void vcam_preframe();
|
||||
|
||||
// may call the callbacks specified in the vcam_init_t structure
|
||||
void vcam_snapped( vcam_snap_t * );
|
||||
|
||||
// called by VMD after a requested snapshot is complete
|
||||
void vcam_shutdown();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Main file reader API. Any function in this struct may be NULL
|
||||
* if not implemented by the plugin; the application checks this to determine
|
||||
* what functionality is present in the plugin.
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* Required header
|
||||
*/
|
||||
vmdplugin_HEAD
|
||||
|
||||
/**
|
||||
* Filename extension for this file type. May be NULL if no filename
|
||||
* extension exists and/or is known. For file types that match several
|
||||
* common extensions, list them in a comma separated list such as:
|
||||
* "pdb,ent,foo,bar,baz,ban"
|
||||
* The comma separated list will be expanded when filename extension matching
|
||||
* is performed. If multiple plugins solicit the same filename extensions,
|
||||
* the one that lists the extension earliest in its list is selected. In the
|
||||
* case of a "tie", the first one tried/checked "wins".
|
||||
*/
|
||||
const char *filename_extension;
|
||||
|
||||
#if 0
|
||||
// XXX insert stuff here
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Console output, READ-ONLY function pointer.
|
||||
* Function pointer that plugins can use for printing to the host
|
||||
* application's text console. This provides a clean way for plugins
|
||||
* to send message strings back to the calling application, giving the
|
||||
* caller the ability to prioritize, buffer, and redirect console messages
|
||||
* to an appropriate output channel, window, etc. This enables the use of
|
||||
* graphical consoles like TkCon without losing console output from plugins.
|
||||
* If the function pointer is NULL, no console output service is provided
|
||||
* by the calling application, and the output should default to stdout
|
||||
* stream. If the function pointer is non-NULL, all output will be
|
||||
* subsequently dealt with by the calling application.
|
||||
*
|
||||
* XXX this should really be put into a separate block of
|
||||
* application-provided read-only function pointers for any
|
||||
* application-provided services
|
||||
*/
|
||||
int (* cons_fputs)(const int, const char*);
|
||||
|
||||
} molfile_plugin_t;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*
|
||||
* $RCSfile: vmdplugin.h,v $
|
||||
* $Author: johns $ $Locker: $ $State: Exp $
|
||||
* $Revision: 1.33 $ $Date: 2015/10/29 05:10:54 $
|
||||
* $Revision: 1.34 $ $Date: 2018/05/02 03:12:56 $
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
@@ -144,7 +144,7 @@ typedef struct {
|
||||
/**
|
||||
* Use this macro to initialize the abiversion member of each plugin
|
||||
*/
|
||||
#define vmdplugin_ABIVERSION 17
|
||||
#define vmdplugin_ABIVERSION 18
|
||||
|
||||
/*@{*/
|
||||
/** Use this macro to indicate a plugin's thread-safety at registration time */
|
||||
|
||||
@@ -145,7 +145,7 @@ s_fparams* get_fpocket_args(int nargs, char **args) {
|
||||
case 0:
|
||||
break;
|
||||
|
||||
case M_PAR_CHAIN_AS_LIGAND :
|
||||
case M_PAR_CHAIN_AS_LIGAND : /*option with -a "name of the chain" to be specified as a ligand*/
|
||||
/*select the chains as ligand*/
|
||||
status++;
|
||||
strcpy(par->chain_as_ligand, optarg); /*par->chain_as_ligand contains the arg given in cmd line*/
|
||||
@@ -163,7 +163,7 @@ s_fparams* get_fpocket_args(int nargs, char **args) {
|
||||
|
||||
break;
|
||||
|
||||
case M_PAR_DROP_CHAINS :
|
||||
case M_PAR_DROP_CHAINS : /*option with -c "name of the chains"*/
|
||||
/*drop the selected chains from the pdb file*/
|
||||
strcpy(par->chain_delete, optarg); /*par->custom_ligand contains the arg given in cmd line*/
|
||||
//printf("%s and %s",par->custom_ligand,optarg);
|
||||
@@ -180,7 +180,7 @@ s_fparams* get_fpocket_args(int nargs, char **args) {
|
||||
status++;
|
||||
break;
|
||||
|
||||
case M_PAR_KEEP_CHAINS :
|
||||
case M_PAR_KEEP_CHAINS : /*option with -k "name of the chains"*/
|
||||
/*drop the selected chains from the pdb file*/
|
||||
|
||||
strcpy(par->chain_delete, optarg); /*par->custom_ligand contains the arg given in cmd line*/
|
||||
|
||||
32
src/fpmain.c
32
src/fpmain.c
@@ -56,12 +56,10 @@ static int register_cb(void *v, vmdplugin_t *p)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
const char *cif_path = "/home/maels/fpocket/data/sample/2P0R.cif";
|
||||
const char *cif_format = "pdbx";
|
||||
|
||||
int cif_nb;
|
||||
open_mmcif(cif_path, cif_format, cif_nb);
|
||||
|
||||
|
||||
s_fparams *params = get_fpocket_args(argc, argv);
|
||||
|
||||
params->fpocket_running = 1;
|
||||
/* If parameters parsing is ok */
|
||||
if (params)
|
||||
@@ -69,13 +67,14 @@ int main(int argc, char *argv[])
|
||||
if (!params->db_run)
|
||||
fprintf(stdout, "***** POCKET HUNTING BEGINS ***** \n");
|
||||
// print_fparams(params,stdout);
|
||||
|
||||
if (params->pdb_lst != NULL)
|
||||
{
|
||||
/* Handle a list of pdb */
|
||||
int i;
|
||||
for (i = 0; i < params->npdb; i++)
|
||||
{
|
||||
|
||||
|
||||
printf("> Protein %d / %d : %s", i, params->npdb,
|
||||
params->pdb_lst[i]);
|
||||
if (i == params->npdb - 1)
|
||||
@@ -94,7 +93,8 @@ int main(int argc, char *argv[])
|
||||
print_pocket_usage(stdout);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
|
||||
process_pdb(params->pdb_path, params);
|
||||
}
|
||||
}
|
||||
@@ -150,9 +150,14 @@ void process_pdb(char *pdbname, s_fparams *params)
|
||||
/* Try to open it */
|
||||
if (DEBUG)
|
||||
print_number_of_objects_in_memory();
|
||||
s_pdb *pdb = rpdb_open(pdbname, NULL, M_DONT_KEEP_LIG, params->model_number, params);
|
||||
// s_pdb *pdb2 = open_mmcif(pdbname, NULL, M_DONT_KEEP_LIG,params->model_number, params);
|
||||
s_pdb *pdb = open_mmcif(pdbname, NULL, M_DONT_KEEP_LIG, params->model_number, params);
|
||||
s_pdb *pdb_w_lig = open_mmcif(pdbname, NULL, M_KEEP_LIG, params->model_number, params);
|
||||
|
||||
|
||||
// s_pdb *pdb = rpdb_open(pdbname, NULL, M_DONT_KEEP_LIG, params->model_number, params);
|
||||
|
||||
s_pdb *pdb_w_lig = rpdb_open(pdbname, NULL, M_KEEP_LIG, params->model_number, params);
|
||||
// s_pdb *pdb_w_lig = rpdb_open(pdbname, NULL, M_KEEP_LIG, params->model_number, params);
|
||||
if (DEBUG)
|
||||
print_number_of_objects_in_memory();
|
||||
|
||||
@@ -164,9 +169,14 @@ void process_pdb(char *pdbname, s_fparams *params)
|
||||
if (pdb)
|
||||
{
|
||||
/* Actual reading of pdb data and then calculation */
|
||||
rpdb_read(pdb, NULL, M_DONT_KEEP_LIG, params->model_number, params);
|
||||
|
||||
rpdb_read(pdb_w_lig, NULL, M_KEEP_LIG, params->model_number, params);
|
||||
read_mmcif(pdb, NULL, M_DONT_KEEP_LIG, params->model_number, params);
|
||||
|
||||
read_mmcif(pdb_w_lig, NULL, M_KEEP_LIG, params->model_number, params);
|
||||
|
||||
//rpdb_read(pdb, NULL, M_DONT_KEEP_LIG, params->model_number, params);
|
||||
|
||||
//rpdb_read(pdb_w_lig, NULL, M_KEEP_LIG, params->model_number, params);
|
||||
|
||||
// fprintf(stdout,"Init coordinate grid\n");
|
||||
create_coord_grid(pdb);
|
||||
|
||||
715
src/read_mmcif.c
715
src/read_mmcif.c
File diff suppressed because one or more lines are too long
45
src/rpdb.c
45
src/rpdb.c
@@ -834,7 +834,7 @@ s_pdb *rpdb_open(char *fpath, const char *ligan, const int keep_lig, int model_n
|
||||
if (!strncmp(buf, "MODEL", 5) && model_number > 0)
|
||||
{
|
||||
cur_model_count++;
|
||||
//printf("model : %d\n",cur_model_count);
|
||||
printf("model : %d\n", cur_model_count);
|
||||
if (cur_model_count == model_number)
|
||||
model_read = 1;
|
||||
}
|
||||
@@ -892,12 +892,12 @@ s_pdb *rpdb_open(char *fpath, const char *ligan, const int keep_lig, int model_n
|
||||
pdb->n_xlig_atoms++;
|
||||
fprintf(stdout, "%d\n", pdb->n_xlig_atoms);
|
||||
}
|
||||
}
|
||||
|
||||
if (buf[21] == par->chain_as_ligand[0])
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
//fprintf(stdout, "%d\t", pdb->n_xlig_atoms);
|
||||
if (buf[21] == par->chain_as_ligand[0])
|
||||
{
|
||||
pdb->n_xlig_atoms++;
|
||||
//fprintf(stdout, "%d\t", pdb->n_xlig_atoms);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -926,7 +926,7 @@ s_pdb *rpdb_open(char *fpath, const char *ligan, const int keep_lig, int model_n
|
||||
else if (ligan && strlen(ligan) == 1 && ligan[0] == buf[21])
|
||||
{
|
||||
if (keep_lig)
|
||||
natm_lig++;
|
||||
natm_lig++;
|
||||
natoms++;
|
||||
}
|
||||
else
|
||||
@@ -1208,7 +1208,9 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb
|
||||
atom->radius = pte_get_vdw_ray(atom->symbol);
|
||||
atom->electroneg = pte_get_enegativity(atom->symbol);
|
||||
atom->sort_x = -1;
|
||||
|
||||
//printf("type : %s, id : %d, name : %s, aloc : %c, res_name : %s, chain : %s, res_id : %d, pdb_insert : %c, occupancy : %f, b_factor : %f, symbol : %s, charge : %d\n",
|
||||
//atom->type, atom->id,atom->name ,atom->pdb_aloc,atom->res_name,atom->chain,atom->res_id,atom->pdb_insert,atom->occupancy,atom->bfactor, atom->symbol,atom->charge);
|
||||
//printf("electroneg : %s\n",atom->symbol);
|
||||
atoms_p[iatoms] = atom;
|
||||
iatoms++;
|
||||
}
|
||||
@@ -1336,6 +1338,7 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb
|
||||
{
|
||||
|
||||
atom = atoms + iatoms;
|
||||
|
||||
rpdb_extract_pdb_atom(pdb_line, atom->type, &(atom->id),
|
||||
atom->name, &(atom->pdb_aloc), atom->res_name,
|
||||
atom->chain, &(atom->res_id), &(atom->pdb_insert),
|
||||
@@ -1348,7 +1351,7 @@ void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig, int model_numb
|
||||
atom->radius = pte_get_vdw_ray(atom->symbol);
|
||||
atom->electroneg = pte_get_enegativity(atom->symbol);
|
||||
atom->sort_x = -1;
|
||||
|
||||
|
||||
atoms_p[iatoms] = atom;
|
||||
pdb->lhetatm[ihetatm] = atom;
|
||||
ihetatm++;
|
||||
@@ -1500,7 +1503,7 @@ void free_pdb_atoms(s_pdb *pdb)
|
||||
*/
|
||||
int chains_to_delete(char *chains_selected, char *current_line_chain, int is_chain_kept)
|
||||
{ /*deletes the chains selected by command -c, returns true if the chain correspond false if not*/
|
||||
|
||||
|
||||
if (is_chain_kept == 0)
|
||||
{
|
||||
int is_deleted = 1;
|
||||
@@ -1517,18 +1520,18 @@ int chains_to_delete(char *chains_selected, char *current_line_chain, int is_cha
|
||||
return is_deleted;
|
||||
}
|
||||
else
|
||||
{
|
||||
int is_deleted = 0;
|
||||
int i = 0;
|
||||
for (i = 0; i < M_MAX_CHAINS_DELETE; i++)
|
||||
{
|
||||
int is_deleted = 0;
|
||||
int i = 0;
|
||||
for (i = 0; i < M_MAX_CHAINS_DELETE; i++)
|
||||
{
|
||||
if (chains_selected[i] == current_line_chain)
|
||||
{
|
||||
if (chains_selected[i] == current_line_chain)
|
||||
{
|
||||
//printf("%c_%c ", chains_selected[i],current_line_chain);
|
||||
is_deleted = 1;
|
||||
}
|
||||
//printf("%c_%c ", chains_selected[i],current_line_chain);
|
||||
is_deleted = 1;
|
||||
}
|
||||
//printf("\n");
|
||||
return is_deleted;
|
||||
}
|
||||
//printf("\n");
|
||||
return is_deleted;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user