Getting 3D distances for two structures with different atom indices

26 views
Skip to first unread message

Carlos Bornes

unread,
Jan 11, 2022, 1:51:08 PM1/11/22
to MDnalysis discussion
Hi there,

I'm trying to compare the positions of the atoms of a structure converged in two different ways using DFT and MD. 

I've tried to align the atoms using the code but I noticed that this is not doing what I want.

dft = mda.Universe('dft.pdb')
md = mda.Universe('md.pdb')
align.alignto(md.select_atoms('index 575'), dft.select_atoms('index 575'), select='all', match_atoms=True)
dft_pos = dft.select_atoms('all').positions
md_pos = md_dft.select_atoms('all').positions
squared_dist = np.sum((dft_pos - md_dft_pos)**2, axis = 1)
dist = np.sqrt(squared_dist)


You can also see by the input attached that the first atoms in the dft.pdb file are oxygen and the md.pdb are silicon.

I wonder if MDanalysis has a way to load the file such that it takes into account the crystallographic positions. For example, when I open the structures in Avogadro or Pymol they superimpose perfectly (i mean that are changes in the positions but only small changes related to the convergence method). 

Sorry if this is a noob question but I'm new to MDanalysis and Python and I'm trying to learn it on my own.

Thanks
Carlos

md_dft.zip
Reply all
Reply to author
Forward
0 new messages