Euclidian distances between coordinates in pdb file

13 views (last 30 days)
Hi everbody,
I want to calculate all the Euclidian from the pdb file. First of all, I extracted the lines that contains a specific element from the file.
After obtaining the element coordinates, I need the calculate all the Euclidian distances between two atoms(CA-CA) by x1, x2, x3 coordinates .For this, I have to use this formulation:
d =sqrt[(x1-x2)^2 +(x1-x3)^2+(x2-x3)^2], maybe with looping and I should obtain 76x76 matrix.
I attached the file. After that I need to plot all the entries of this matrix where the calculated
distance is <5.
I tried R studio, but I could not do this in R. Can you help for this?

Accepted Answer

Meg Noah
Meg Noah on 10 Jan 2020
Solution:
% euclid
filename = '1UBQ_CA.txt';
CA_CA = readtable(filename);
[iatom1,iatom2] = meshgrid(1:76,1:76);
distance = zeros(76,76);
distance_CA_CA = sqrt((CA_CA.x1(iatom1)-CA_CA.x1(iatom2)).^2 + ...
(CA_CA.x2(iatom1)-CA_CA.x2(iatom2)).^2 + ...
(CA_CA.x3(iatom1)-CA_CA.x3(iatom2)).^2);

More Answers (0)

Categories

Find more on Guidance, Navigation, and Control (GNC) in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!