28 UHBD (
char *,
char *,
bool,
float);
29 UHBD (
char *,
float,
bool,
float);
94 template <
typename type>
97 template <
typename type>
100 template <
typename type>
106template <
typename T1>
template <
typename type>
123template <
typename T1>
template <
typename type>
137template <
typename T1>
template <
typename type>
159template <
typename T1>
163 std::cout <<
"No UHBD file! \n !!! Assuming an exclusion grid object !!!" << std::endl;
166 std::cout <<
"Loading the PDB file ..." << std::endl;
169 structure->Read_PDB_File(
pdbfile);
172 Title =
new char [72];
173 strcat(
Title,
"Exclusion grid created by UHBD2dtgrid");
213template <
typename T1>
219 Title =
new char [72];
220 std::cout <<
"Opening the UHBD file..." << std::endl;
222 Test_Format_Grid(
Input);
224 file.open(
Input, std::ifstream::in | std::ifstream::binary);
226 file.open(
Input, std::ifstream::in);
235 std::cout <<
"Loading the PDB file ..." << std::endl;
238 structure->Read_PDB_File(
pdbfile);
250template <
typename T1>
256 Title =
new char [72];
257 std::cout <<
"Opening the UHBD file..." << std::endl;
258 Test_Format_Grid(
Input);
260 file.open(
Input, std::ifstream::in | std::ifstream::binary);
262 file.open(
Input, std::ifstream::in);
272template <
typename T1>
279 if (exclusion_flag == 0){
292template <
typename T1>
295 slice_n =
static_cast<std::ostringstream*
>( &(std::ostringstream() <<
k) )->str();
303 if (Skin[
i][
j][
k] ==
true )
326template <
typename T1>
345 hdexcl = hexclusion / 2.0;
348#pragma omp parallel shared(hdexcl, hexclusion, klim, nb_true_excl, probep, IEV) \
349 private(i, j, k, c3d_1, c3d_2, c3d_3, ix, jx, kk, jj, ii, xv1, xv2, xv3, xa1, xa2, xa3, \
350 rexcl, rexcl2, zk, ztemp, yj, ytemp, xi, xtemp, dist2, dummy_lim)
352 #pragma omp for schedule(dynamic) nowait reduction(+:nb_true_excl)
353 for (
ix = 0;
ix < structure->Number_of_Residues;
ix++){
354 for (
jx = 0;
jx < structure->Residues[
ix].Number_of_Atoms;
jx++){
355 xv1 = (
double) (structure->Residues[
ix].Atoms[
jx].Coord.X - structure->CoG.X);
356 xv2 = (
double) (structure->Residues[
ix].Atoms[
jx].Coord.Y - structure->CoG.Y);
357 xv3 = (
double) (structure->Residues[
ix].Atoms[
jx].Coord.Z - structure->CoG.Z);
406 if (
IEV[
i-1][
j-1][
k-1] ==
true)
417 IEV[
i-1][
j-1][
k-1] =
true;
429 if (structure->Dummy.Number_of_Atoms > 0){
430 for (
jx = 0;
jx < structure->Dummy.Number_of_Atoms;
jx++){
431 xv1 = (
double) (structure->Dummy.Atoms[
jx].Coord.X - structure->CoG.X);
432 xv2 = (
double) (structure->Dummy.Atoms[
jx].Coord.Y - structure->CoG.Y);
433 xv3 = (
double) (structure->Dummy.Atoms[
jx].Coord.Z - structure->CoG.Z);
448 #pragma omp for schedule(dynamic) nowait
479 if (
IEV[
i-1][
j-1][
k-1] ==
true)
490 IEV[
i-1][
j-1][
k-1] =
true;
509template <
typename T1>
513 int xmin, xmax, ymin, ymax, zmin, zmax;
522 double hexclusion, probep;
535 hdexcl = hexclusion / 2.0;
541 std::cout <<
"Generate exclusion grid with hexclusion: " << hexclusion <<
" probep: " << probep << std::endl;
546 for (
int ix = 0;
ix < structure->Number_of_Residues;
ix++){
548 for (
int jx = 0;
jx < structure->Residues[
ix].Number_of_Atoms;
jx++){
549 xv1 = (
double) (structure->Residues[
ix].Atoms[
jx].Coord.X - structure->CoG.X);
550 xv2 = (
double) (structure->Residues[
ix].Atoms[
jx].Coord.Y - structure->CoG.Y);
551 xv3 = (
double) (structure->Residues[
ix].Atoms[
jx].Coord.Z - structure->CoG.Z);
571 std::cout <<
"Min & max grid points x: " << xmin <<
" " << xmax << std::endl;
572 std::cout <<
"Min & max grid points y: " << ymin <<
" " << ymax << std::endl;
573 std::cout <<
"Min & max grid points z: " << zmin <<
" " << zmax << std::endl;
575 nxex = xmax - xmin + 2;
576 nyex = ymax - ymin + 2;
577 nzex = zmax - zmin + 2;
579 oex = hexclusion * ((
double) xmin - 0.5) - hexclusion;
580 oey = hexclusion * ((
double) ymin - 0.5) - hexclusion;
581 oez = hexclusion * ((
double) zmin - 0.5) - hexclusion;
588 o.
x = (
float)((
double) structure->CoG.X +
oex);
589 o.
y = (
float)((
double) structure->CoG.Y +
oey);
590 o.
z = (
float)((
double) structure->CoG.Z +
oez);
592 std::cout <<
"Exclusion grid information ..." << std::endl;
593 std::cout <<
"Grid dimensions : " <<
dim.
i <<
" " <<
dim.
j <<
" " <<
dim.
k << std::endl;
594 std::cout <<
"Grid spacing : " <<
spacing << std::endl;
595 std::cout <<
"Grid origin : " <<
o.
x <<
" " <<
o.
y <<
" " <<
o.
z << std::endl;
596 std::cout << std::endl;
605 std::cout <<
"The number of points in exclusion grid assigned value 1: " <<
nb_true_excl << std::endl;
606 std::cout <<
"The number of atoms in the PDB file: " << structure->Number_of_Atoms << std::endl;
623template <
typename T1>
632 std::cout <<
"Writing the UHBD (binary) to the output file ..." << std::endl;
665 for (
int k=0;
k <
dim.
k ;
k++){
676 for (
int j=0;
j <
dim.
j ;
j++){
677 for (
int i=0;
i <
dim.
i ;
i++){
692template <
typename T1>
696 file_bt.open(
Input, std::ifstream::in | std::ifstream::binary);
702 char *
buffer =
new char [120];
736template <
typename T1>
769 file.seekg (4, file.beg);
770 file.read(
Title, 72);
771 file.read((
char *) &
scale,
sizeof(
float));
772 file.read((
char *) &
dummy1,
sizeof(
float));
773 file.read((
char *) &
grdflag,
sizeof(
int));
774 file.read((
char *) &
idummy1,
sizeof(
int));
775 file.read((
char *) &
idummy2,
sizeof(
int));
776 file.read((
char *) &
one,
sizeof(
int));
777 file.read((
char *) &
idummy3,
sizeof(
int));
778 file.read((
char *) &
dim.
i,
sizeof(
int));
779 file.read((
char *) &
dim.
j,
sizeof(
int));
780 file.read((
char *) &
dim.
k,
sizeof(
int));
781 file.read((
char *) &
spacing,
sizeof(
float));
782 file.read((
char *) &
o.
x,
sizeof(
float));
783 file.read((
char *) &
o.
y,
sizeof(
float));
784 file.read((
char *) &
o.
z,
sizeof(
float));
785 file.read((
char *) &
dummy2,
sizeof(
float));
786 file.read((
char *) &
dummy3,
sizeof(
float));
787 file.read((
char *) &
dummy4,
sizeof(
float));
788 file.read((
char *) &
dummy5,
sizeof(
float));
789 file.read((
char *) &
dummy6,
sizeof(
float));
790 file.read((
char *) &
dummy7,
sizeof(
float));
791 file.read((
char *) &
idummy4,
sizeof(
int));
792 file.read((
char *) &
idummy5,
sizeof(
int));
798 std::cout <<
"ERROR: Cannot open the UHBD file!" << std::endl;
868 std::cout <<
"ERROR: Cannot open the UHBD file" << std::endl;
878template <
typename T1>
881 std::cout <<
"Reading the UHBD grid ..." << std::endl;
882 std::cout <<
"Grid dimensions : " <<
dim.
i <<
" " <<
dim.
j <<
" " <<
dim.
k << std::endl;
883 std::cout <<
"Grid spacing : " <<
spacing << std::endl;
884 std::cout <<
"Grid origin : " <<
o.
x <<
" " <<
o.
y <<
" " <<
o.
z << std::endl;
885 std::cout << std::endl;
894 file.read((
char *) &
ufo1,
sizeof(
float));
895 file.read((
char *) &
ufo2,
sizeof(
float));
896 file.read((
char *) &
kx,
sizeof(
float));
897 file.read((
char *) &
im,
sizeof(
float));
898 file.read((
char *) &
jm,
sizeof(
float));
899 file.read((
char *) &
ufo3,
sizeof(
float));
900 file.read((
char *) &
ufo4,
sizeof(
float));
915 std::cout <<
"ERROR: Cannot open the UHBD file" << std::endl;
929 file >> Grid[
i][
j][
k];
942 std::cout <<
"ERROR: Cannot open the UHBD file" << std::endl;
970template <
typename T1>
973 std::cout <<
"Generating the molecule skin points ..." << std::endl;
1003 for (
int i = 0;
i <
dim.
i;
i ++){
1004 for (
int j = 0;
j <
dim.
j;
j++){
1005 for (
int k = 0;
k <
dim.
k;
k++){
1006 if (
IEX[
i][
j][
k]==
true){
1007 Skin[
i][
j][
k]=
false;
1013 Skin[
i][
j][
k]=
false;
1029 for (
int i = 0;
i <
dim.
i;
i ++){
1030 for (
int j = 0;
j <
dim.
j;
j++){
1031 for (
int k = 0;
k <
dim.
k;
k++){
1032 if (Skin[
i][
j][
k] ==
true){
1035 if ((
i-1 >= 0) && (
IEX[
i-1][
j][
k] ==
true))
1039 if ((
j-1 >= 0) && (
IEX[
i][
j-1][
k] ==
true))
1043 if ((
k-1 >= 0) && (
IEX[
i][
j][
k-1] ==
true))
1051 for (
int i = 0;
i <
dim.
i;
i ++){
1052 for (
int j = 0;
j <
dim.
j;
j++){
1053 for (
int k = 0;
k <
dim.
k;
k++){
1054 if (
IIN[
i][
j][
k] ==
true){
1055 Skin[
i][
j][
k] =
true;
Group functions to read-write PDB files and describe the molecular structures inside (Header)
Definition DTGrid3D.hpp:65
int idummy3
Definition DTGrid3D.hpp:148
int grdflag
Definition DTGrid3D.hpp:144
float dummy5
Definition DTGrid3D.hpp:157
float dummy7
Definition DTGrid3D.hpp:159
float z
Definition DTGrid3D.hpp:122
float dummy3
Definition DTGrid3D.hpp:155
float dummy6
Definition DTGrid3D.hpp:158
char * Title
Definition DTGrid3D.hpp:143
float x
Definition DTGrid3D.hpp:120
int iform
grid file format: binary = 0; ascii = 1
Definition DTGrid3D.hpp:86
struct DTGrid3D::@2::origin o
float y
Definition DTGrid3D.hpp:121
float scale
scaling factor
Definition DTGrid3D.hpp:92
int j
Definition DTGrid3D.hpp:114
float dummy1
Definition DTGrid3D.hpp:153
float spacing
Definition DTGrid3D.hpp:93
int i
Definition DTGrid3D.hpp:113
int idummy2
Definition DTGrid3D.hpp:147
int idummy4
Definition DTGrid3D.hpp:149
float dummy4
Definition DTGrid3D.hpp:156
int k
Definition DTGrid3D.hpp:115
int idummy5
Definition DTGrid3D.hpp:150
struct DTGrid3D::@2::dimensions dim
int idummy1
Definition DTGrid3D.hpp:146
int one
Definition DTGrid3D.hpp:145
float dummy2
Definition DTGrid3D.hpp:154
Definition PDBstructure.hpp:78
Definition UHBDgrd.hpp:25
float spacing
Definition UHBDgrd.hpp:44
float dummy6
Definition UHBDgrd.hpp:53
void Test_Format_Grid(char *)
Determine the type of grid: binary or ascii?
Definition UHBDgrd.hpp:693
int idummy5
Definition UHBDgrd.hpp:59
void print_slice_grid(int)
Print a 2D slice of an excluded volume grid.
Definition UHBDgrd.hpp:293
float dummy3
Definition UHBDgrd.hpp:50
void Generate_Skin(float, int)
Calculate the molecule skin (molecular interaction field)
Definition UHBDgrd.hpp:971
char * Title
grid spacing/resolution
Definition UHBDgrd.hpp:45
type *** Allocate()
create a 3d array and allocate memory for it.
Definition UHBDgrd.hpp:107
float probes
Boolean for Skin! expanded for other types, though.
Definition UHBDgrd.hpp:80
int exclusion_flag
Binary : 0, ASCII : 1.
Definition UHBDgrd.hpp:85
UHBD(char *, char *, bool, float)
UHBD constructor - 2.
Definition UHBDgrd.hpp:214
int idummy4
Definition UHBDgrd.hpp:58
int excluded_volume(bool ***, double, double, double, double)
Calculate the excluded volume.
Definition UHBDgrd.hpp:327
float dummy5
Definition UHBDgrd.hpp:52
struct UHBD::dimensions dim
void Deallocate(type ***)
deallocate the memory for a 3D array
Definition UHBDgrd.hpp:124
float dummy2
Definition UHBDgrd.hpp:49
int grdflag
scaling for every value
Definition UHBDgrd.hpp:42
bool *** Skin
Store the grid data in a 3d array.
Definition UHBDgrd.hpp:76
~UHBD()
UHBD destructor.
Definition UHBDgrd.hpp:273
void make_exclusion_grid()
construct the excluded volume grid
Definition UHBDgrd.hpp:510
void Read_Header(char *)
Read the header of an input UHBD file.
Definition UHBDgrd.hpp:737
float scale
Definition UHBDgrd.hpp:41
float dummy1
Text header kept in the UHBD file.
Definition UHBDgrd.hpp:48
float dummy4
Definition UHBDgrd.hpp:51
int iform
structure object for the input molecule
Definition UHBDgrd.hpp:84
void write_uhbd_grid()
Exclusion : 1, Non-exclusion : 0.
Definition UHBDgrd.hpp:624
void Initialize(type ***)
initialize values of a given 3D array to zero
Definition UHBDgrd.hpp:138
int idummy1
Definition UHBDgrd.hpp:55
int one
flag for the type of grid: UHBD, DT-Grid, etc.
Definition UHBDgrd.hpp:43
std::ifstream file
Definition UHBDgrd.hpp:40
float dummy7
Definition UHBDgrd.hpp:54
T1 *** Grid
grid origin coordinates
Definition UHBDgrd.hpp:75
int idummy3
Definition UHBDgrd.hpp:57
void Read_Data()
Read the body of the input UHBD file.
Definition UHBDgrd.hpp:879
PDB * structure
probe size
Definition UHBDgrd.hpp:83
int idummy2
Definition UHBDgrd.hpp:56
subroutine make_exclusion_grid(sgrid, tmp_atom_pos, tmp_nat, center, atom_vdw, max_vdw, probep, hexclusion)
Use intermediate module mod_exclusion_grid.
Definition make_exclusion_grid.f90:54
Definition UHBDgrd.hpp:63
int k
number of grid points in y direction
Definition UHBDgrd.hpp:66
int i
Definition UHBDgrd.hpp:64
int j
number of grid points in x direction
Definition UHBDgrd.hpp:65
dimensions of the grid (number of grid points)
Definition UHBDgrd.hpp:69
float x
Definition UHBDgrd.hpp:70
float z
origin y coordinate
Definition UHBDgrd.hpp:72
float y
origin x coordinate
Definition UHBDgrd.hpp:71