hey guys.,x1=[6.630]; y1=[12.294]; z1=[-1.457]; x2=[7.613]; y2=[12.686]; z2=[-0.404]; x3=[8.324]; y3=[11.427]; z3=[0.102]; x4=[9.372]; y4=[11.018]; z4=[-0.564]; these are coordinates to calculate phi and psi angles, please tell me how i should do.?

조회 수: 1 (최근 30일)
hey guys.,
x1=[6.630]; y1=[12.294]; z1=[-1.457]; x2=[7.613]; y2=[12.686]; z2=[-0.404]; x3=[8.324]; y3=[11.427]; z3=[0.102]; x4=[9.372]; y4=[11.018]; z4=[-0.564];
these are coordinates to calculate phi and psi angles, please tell me how i should do.?
  댓글 수: 2
KSSV
KSSV 2017년 2월 3일
How these coordinates are related to phi and psi? Do you have any formula?
Stephen23
Stephen23 2017년 2월 3일
Having lots of variables with names x1, x2, x3, etc, is not a good use of MATLAB: MATLAB works best on arrays, which means keeping your data together as much as possible makes code faster and easier to write.
Using lots of variables also makes accessing them slow and buggy, as is explained here:

댓글을 달려면 로그인하십시오.

채택된 답변

Roger Stafford
Roger Stafford 2017년 2월 3일
편집: Roger Stafford 2017년 2월 3일
(Corrected) I am assuming that the four sets of coordinates you describe correspond to four points P1 = [x1;y1;z1], P2 = [x2;y2;z2], P3 = [x3;y3;z3], P4 = [x4;y4;z4], and that these four points are positions of four atoms in a polypeptide chain for which you wish to determine their torsion angle, as defined in the website:
http://www.proteinstructures.com/Structure/Structure/Ramachandran-plot.html
for the four corresponding points A, B, C, and D in the “standard IUPAC definition” given there. This torsion angle can vary from -180 to +180 degrees as the rotation varies from extreme counterclockwise to extreme clockwise, respectively, while moving forward from point B (P2) to point C (P3). This is a signed dihedral angle between the plane defined by points A, B, and C, and the plane defined by points B, C, and D.
That computation can be performed in Matlab as follows:
Q12 = cross(P3-P2,P1-P2);
Q43 = cross(P3-P2,P4-P3);
Q1243 = cross(Q12,Q43);
ang = atan2d(sign(dot(P3-P2,Q1243))*norm(Q1243),dot(Q12,Q43));
[Note that the function ‘atan2d’ is used here to obtain angles in degrees, and the quantity “sign(dot(P3-P2,Q1243))” is used to distinguish between clockwise and counterclockwise rotations.]
  댓글 수: 5
Steven Lord
Steven Lord 2017년 2월 3일
The atan2 function returns angles in radians. If you want degrees, use atan2d.
Roger Stafford
Roger Stafford 2017년 2월 3일
편집: Roger Stafford 2017년 2월 3일
@Ram. I have modified the answer I gave previously so as both to allow for counterclockwise rotations with negative values and to produce angles in degrees rather than radians. (For your example I got the torsion angle, psi, equal to 85.73846504695527 degrees.)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Special Functions에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by