Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
INTBuilder
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chloe Dequeker
INTBuilder
Commits
9686c2b0
Commit
9686c2b0
authored
May 30, 2017
by
Chloe Dequeker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
end rotation ATTRACT
parent
f8f9c388
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
69 deletions
+78
-69
rotation.c
src/rotation.c
+78
-69
No files found.
src/rotation.c
View file @
9686c2b0
...
@@ -68,19 +68,86 @@ void sphericToxyz(float *x, float *y, float *z, float x0, float y0, float z0, fl
...
@@ -68,19 +68,86 @@ void sphericToxyz(float *x, float *y, float *z, float x0, float y0, float z0, fl
*
z
=
z0
+
R
*
cos
(
theta
);
*
z
=
z0
+
R
*
cos
(
theta
);
}
}
struct
pdb_values
*
rotate_R_ATTRACT
(
struct
pdb_values
*
pdb
,
struct
pdb_values
*
newPDB
,
struct
docking_results
*
dock_res
,
int
target_conf
){
/* This function aims at rotating a protein using the ATTRACT output format (DOF file).
* The rotation will only consider a docking using two proteins, and will not consider the
* normal modes that could have been included for a conformation
*
* A parameter 'isRec' is set, as to know if we are considering the receptor or the ligand in the
* 'pdb' parameter. Different rotations and translations may apply.
*/
struct
pdb_values
*
rotate_ATTRACT
(
struct
pdb_values
*
pdb
,
struct
pdb_values
*
newPDB
,
struct
docking_results
*
dock_res
,
int
target_conf
,
int
isRec
){
int
i
=
0
,
j
=
0
;
int
i
=
0
,
j
=
0
;
float
rot_mat
[
9
];
float
rot_mat
[
9
];
float
xx
=
0
,
yy
=
0
,
zz
=
0
;
float
xx
=
0
,
yy
=
0
,
zz
=
0
;
float
cp
=
0
,
cs
=
0
,
cr
=
0
,
sp
=
0
,
ss
=
0
,
sr
=
0
;
float
pivot_X
=
0
,
pivot_Y
=
0
,
pivot_Z
=
0
;
float
trans_X
=
0
,
trans_Y
=
0
,
trans_Z
=
0
;
/* Copy the pdb into newPDB (which will be returned */
if
(
newPDB
==
NULL
){
newPDB
=
allocate_pdb
(
pdb
->
nbRes
);
newPDB
->
nbAtom
=
pdb
->
nbAtom
;
}
memcpy
(
newPDB
->
residues
,
pdb
->
residues
,
pdb
->
nbRes
*
sizeof
(
struct
residue
));
/* Now set the different values depending if we are considering
* the receptor or the ligand
*/
if
(
isRec
){
cp
=
cos
(
dock_res
->
phi_R
[
target_conf
]);
cs
=
cos
(
dock_res
->
ssi_R
[
target_conf
]);
cr
=
cos
(
dock_res
->
rot_R
[
target_conf
]);
sp
=
sin
(
dock_res
->
phi_R
[
target_conf
]);
ss
=
sin
(
dock_res
->
ssi_R
[
target_conf
]);
sr
=
sin
(
dock_res
->
rot_R
[
target_conf
]);
/* If the receptor is centered, we need to substract the
* pivot from all of its atoms
*/
if
(
dock_res
->
auto_pivot
){
pivot_X
=
newPDB
->
centerX
;
pivot_Y
=
newPDB
->
centerY
;
pivot_Z
=
newPDB
->
centerZ
;
}
else
{
pivot_X
=
dock_res
->
pivot_X_R
;
pivot_Y
=
dock_res
->
pivot_Y_R
;
pivot_Z
=
dock_res
->
pivot_Z_R
;
}
if
(
dock_res
->
centered_R
){
trans_X
=
dock_res
->
trans_X_R
[
i
]
-
pivot_X
;
trans_Y
=
dock_res
->
trans_Y_R
[
i
]
-
pivot_Y
;
trans_Z
=
dock_res
->
trans_Z_R
[
i
]
-
pivot_Z
;
}
}
else
{
cp
=
cos
(
dock_res
->
phi_L
[
target_conf
]);
cs
=
cos
(
dock_res
->
ssi_L
[
target_conf
]);
cr
=
cos
(
dock_res
->
rot_L
[
target_conf
]);
sp
=
sin
(
dock_res
->
phi_L
[
target_conf
]);
ss
=
sin
(
dock_res
->
ssi_L
[
target_conf
]);
sr
=
sin
(
dock_res
->
rot_L
[
target_conf
]);
/* If the ligand is centered, we need to substract the
* pivot
*/
if
(
dock_res
->
auto_pivot
){
pivot_X
=
newPDB
->
centerX
;
pivot_Y
=
newPDB
->
centerY
;
pivot_Z
=
newPDB
->
centerZ
;
}
else
{
pivot_X
=
dock_res
->
pivot_X_L
;
pivot_Y
=
dock_res
->
pivot_Y_L
;
pivot_Z
=
dock_res
->
pivot_Z_L
;
}
if
(
dock_res
->
centered_L
){
trans_X
=
dock_res
->
trans_X_L
[
i
]
-
pivot_X
;
trans_Y
=
dock_res
->
trans_Y_L
[
i
]
-
pivot_Y
;
trans_Z
=
dock_res
->
trans_Z_L
[
i
]
-
pivot_Z
;
}
}
float
pivot_X_R
,
pivot_Y_R
,
pivot_Z_R
;
float
cp
=
cos
(
dock_res
->
phi_R
[
target_conf
]);
float
cs
=
cos
(
dock_res
->
ssi_R
[
target_conf
]);
float
cr
=
cos
(
dock_res
->
rot_R
[
target_conf
]);
float
sp
=
sin
(
dock_res
->
phi_R
[
target_conf
]);
float
ss
=
sin
(
dock_res
->
ssi_R
[
target_conf
]);
float
sr
=
sin
(
dock_res
->
rot_R
[
target_conf
]);
float
cscp
=
cs
*
cp
;
float
cscp
=
cs
*
cp
;
float
cssp
=
cs
*
sp
;
float
cssp
=
cs
*
sp
;
float
sscp
=
ss
*
cp
;
float
sscp
=
ss
*
cp
;
...
@@ -98,25 +165,6 @@ struct pdb_values* rotate_R_ATTRACT(struct pdb_values* pdb, struct pdb_values* n
...
@@ -98,25 +165,6 @@ struct pdb_values* rotate_R_ATTRACT(struct pdb_values* pdb, struct pdb_values* n
rot_mat
[
7
]
=
-
sr
*
ss
;
rot_mat
[
7
]
=
-
sr
*
ss
;
rot_mat
[
8
]
=
cs
;
rot_mat
[
8
]
=
cs
;
/* If the receptor is centered, we need to substract the
* pivot from all of its atoms
*/
if
(
dock_res
->
auto_pivot
){
pivot_X_R
=
newPDB
->
centerX
;
pivot_Y_R
=
newPDB
->
centerY
;
pivot_Z_R
=
newPDB
->
centerZ
;
}
else
{
pivot_X_R
=
dock_res
->
pivot_X_R
;
pivot_Y_R
=
dock_res
->
pivot_Y_R
;
pivot_Z_R
=
dock_res
->
pivot_Z_R
;
}
if
(
dock_res
->
centered_R
){
dock_res
->
trans_X_R
[
i
]
-=
pivot_X_R
;
dock_res
->
trans_Y_R
[
i
]
-=
pivot_Y_R
;
dock_res
->
trans_Z_R
[
i
]
-=
pivot_Z_R
;
}
for
(
i
=
0
;
i
<
newPDB
->
nbRes
;
i
++
){
for
(
i
=
0
;
i
<
newPDB
->
nbRes
;
i
++
){
for
(
j
=
0
;
i
<
newPDB
->
residues
[
i
].
nbAtom
;
j
++
){
for
(
j
=
0
;
i
<
newPDB
->
residues
[
i
].
nbAtom
;
j
++
){
xx
=
newPDB
->
residues
[
i
].
x
[
j
];
xx
=
newPDB
->
residues
[
i
].
x
[
j
];
...
@@ -127,54 +175,15 @@ struct pdb_values* rotate_R_ATTRACT(struct pdb_values* pdb, struct pdb_values* n
...
@@ -127,54 +175,15 @@ struct pdb_values* rotate_R_ATTRACT(struct pdb_values* pdb, struct pdb_values* n
newPDB
->
residues
[
i
].
y
[
j
]
=
xx
*
rot_mat
[
3
]
+
yy
*
rot_mat
[
4
]
+
zz
*
rot_mat
[
5
];
newPDB
->
residues
[
i
].
y
[
j
]
=
xx
*
rot_mat
[
3
]
+
yy
*
rot_mat
[
4
]
+
zz
*
rot_mat
[
5
];
newPDB
->
residues
[
i
].
z
[
j
]
=
xx
*
rot_mat
[
6
]
+
yy
*
rot_mat
[
7
]
+
zz
*
rot_mat
[
8
];
newPDB
->
residues
[
i
].
z
[
j
]
=
xx
*
rot_mat
[
6
]
+
yy
*
rot_mat
[
7
]
+
zz
*
rot_mat
[
8
];
newPDB
->
residues
[
i
].
x
[
j
]
=
newPDB
->
residues
[
i
].
x
[
j
]
+
dock_res
->
trans_X_R
[
target_conf
]
+
pivot_X
_R
;
newPDB
->
residues
[
i
].
x
[
j
]
=
newPDB
->
residues
[
i
].
x
[
j
]
+
dock_res
->
trans_X_R
[
target_conf
]
+
pivot_X
;
newPDB
->
residues
[
i
].
y
[
j
]
=
newPDB
->
residues
[
i
].
y
[
j
]
+
dock_res
->
trans_Y_R
[
target_conf
]
+
pivot_Y
_R
;
newPDB
->
residues
[
i
].
y
[
j
]
=
newPDB
->
residues
[
i
].
y
[
j
]
+
dock_res
->
trans_Y_R
[
target_conf
]
+
pivot_Y
;
newPDB
->
residues
[
i
].
z
[
j
]
=
newPDB
->
residues
[
i
].
z
[
j
]
+
dock_res
->
trans_Z_R
[
target_conf
]
+
pivot_Z
_R
;
newPDB
->
residues
[
i
].
z
[
j
]
=
newPDB
->
residues
[
i
].
z
[
j
]
+
dock_res
->
trans_Z_R
[
target_conf
]
+
pivot_Z
;
}
}
}
}
return
newPDB
;
return
newPDB
;
}
}
struct
pdb_values
*
rotate_ATTRACT
(
struct
pdb_values
*
pdb
,
struct
pdb_values
*
newPDB
,
struct
docking_results
*
dock_res
,
int
target_conf
,
int
isRec
){
int
i
=
0
,
j
=
0
;
/* Copy the pdb into newPDB (which will be returned */
if
(
newPDB
==
NULL
){
newPDB
=
allocate_pdb
(
pdb
->
nbRes
);
newPDB
->
nbAtom
=
pdb
->
nbAtom
;
}
memcpy
(
newPDB
->
residues
,
pdb
->
residues
,
pdb
->
nbRes
*
sizeof
(
struct
residue
));
if
(
isRec
){
/* If the receptor is centered, we need to substract the
* pivot from all of its atoms
*/
if
(
dock_res
->
centered_R
){
for
(
i
=
0
;
i
<
newPDB
->
nbRes
;
i
++
){
for
(
j
=
0
;
j
<
newPDB
->
residues
[
i
].
nbAtom
;
j
++
){
newPDB
->
residues
[
i
].
x
[
j
]
-=
dock_res
->
pivot_X_R
;
newPDB
->
residues
[
i
].
y
[
j
]
-=
dock_res
->
pivot_Y_R
;
newPDB
->
residues
[
i
].
z
[
j
]
-=
dock_res
->
pivot_Z_R
;
}
}
}
}
else
{
/* Same thing for the ligand */
if
(
dock_res
->
centered_L
){
for
(
i
=
0
;
i
<
newPDB
->
nbRes
;
i
++
){
for
(
j
=
0
;
j
<
newPDB
->
residues
[
i
].
nbAtom
;
j
++
){
newPDB
->
residues
[
i
].
x
[
j
]
-=
dock_res
->
pivot_X_R
;
newPDB
->
residues
[
i
].
y
[
j
]
-=
dock_res
->
pivot_Y_R
;
newPDB
->
residues
[
i
].
z
[
j
]
-=
dock_res
->
pivot_Z_R
;
}
}
}
}
return
newPDB
;
}
struct
pdb_values
*
rotate_ZDOCK
(
struct
pdb_values
*
pdb
,
struct
pdb_values
*
newPDB
,
float
trans_X
,
float
trans_Y
,
float
trans_Z
,
float
alpha
,
float
beta
,
float
gamma
){
struct
pdb_values
*
rotate_ZDOCK
(
struct
pdb_values
*
pdb
,
struct
pdb_values
*
newPDB
,
float
trans_X
,
float
trans_Y
,
float
trans_Z
,
float
alpha
,
float
beta
,
float
gamma
){
/* This function aims at rotating the pdb parameter and gets its new coordinates
/* This function aims at rotating the pdb parameter and gets its new coordinates
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment