import data from pdb file and find bond length and bond angle using x,y,z co-ord

4 次查看(过去 30 天)
Dear matlab users,
I have pdb file of water molecules saved from a trajectory.
The file consists of x,y,z atomic co-ord of water molecules with molecule ID and atom type at each timeframe.
I need to find the average bond length and bond angle for all water molecule at each time frame ( The number of water molecules keep varying at each time frame.)
My problem is
  1. how to import x,y,z atomic co-ord along with mol ID and atom type at each time frame
  2. how to find bond length (OH1 & OH2) for each water molecule at that time frame
  3. how to find bond angle between these (OH1&OH2 or H1OH2) for each water molecule at that time frame
so that I can average for all water molecules at that time frame and can apply to all time frames. Each timeframe is separted by word ''END".
The sample pdb file looks as below.( Here, the file shows data for 4 timeframes, but I have to do it for 2000 timeframes)
CRYST1 56.062 56.062 56.062 90.00 90.00 90.00 P 1 1
ATOM 1 O SPC W 60 2.501 0.443 -5.835 0.00 0.00 W1
ATOM 2 H SPC W 60 2.279 1.382 -5.574 0.00 0.00 W1
ATOM 3 H SPC W 60 3.484 0.506 -6.004 0.00 0.00 W1
ATOM 4 O SPC W 18 -3.123 -7.945 6.222 0.00 0.00 W2
ATOM 5 H SPC W 18 -3.398 -8.739 5.680 0.00 0.00 W2
ATOM 6 H SPC W 18 -2.480 -8.251 6.924 0.00 0.00 W2
END
ATOM 1 O SPC W 60 2.501 0.443 -5.835 0.00 0.00 W1
ATOM 2 H SPC W 60 2.279 1.382 -5.574 0.00 0.00 W1
ATOM 3 H SPC W 60 3.484 0.506 -6.004 0.00 0.00 W1
ATOM 4 O SPC W 18 -3.123 -7.945 6.222 0.00 0.00 W2
ATOM 5 H SPC W 18 -3.398 -8.739 5.680 0.00 0.00 W2
ATOM 6 H SPC W 18 -2.480 -8.251 6.924 0.00 0.00 W2
ATOM 7 O SPC W 61 2.644 0.634 -6.183 0.00 0.00 W1
ATOM 8 H SPC W 61 2.242 1.068 -5.377 0.00 0.00 W1
ATOM 9 H SPC W 61 2.964 1.474 -6.622 0.00 0.00 W1
END
ATOM 1 O SPC W 60 2.668 0.342 -5.883 0.00 0.00 W1
ATOM 2 H SPC W 60 2.320 1.263 -5.707 0.00 0.00 W1
ATOM 3 H SPC W 60 3.660 0.331 -5.762 0.00 0.00 W1
ATOM 4 O SPC W 18 -2.997 -7.739 5.812 0.00 0.00 W2
ATOM 5 H SPC W 18 -3.099 -8.581 5.282 0.00 0.00 W2
ATOM 6 H SPC W 18 -2.646 -8.018 6.706 0.00 0.00 W2
END
ATOM 1 O SPC W 60 2.677 0.411 -5.957 0.00 0.00 W1
ATOM 2 H SPC W 60 2.314 1.308 -5.705 0.00 0.00 W1
ATOM 3 H SPC W 60 3.580 0.730 -6.247 0.00 0.00 W1
END
Kindly suggest to solve my problem

回答(1 个)

Rohit Pappu
Rohit Pappu 2020-10-28
The data can be imported into MATLAB using pdbread(). This data is stored in pdbstruct which is a MATLAB Structure . The X,Y,Z coordinates can be extracted from pdbstruct using dot operator
Additional documentaion and resources for working with pdb data can be found here

类别

Help CenterFile Exchange 中查找有关 Biological Physics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by