Data Science in Chemistry by Thorsten Gressling

Data Science in Chemistry by Thorsten Gressling

Author:Thorsten Gressling [Thorsten Gressling]
Language: eng
Format: epub
Publisher: De Gruyter
Published: 2020-10-30T00:00:00+00:00


# Analyze coordinates in a trajectory (MDAnalysis) # author: MDAnalysis team # license: GPL-2 # code: github.com/MDAnalysis/…/examples/ # activity: active (2020) # index: 53-2 import MDAnalysis from MDAnalysis.tests.datafiles import PSF, DCD # test trajectory import numpy.linalg u = MDAnalysis.Universe(PSF,DCD) # always start with a Universe # can access via segid (4AKE) and atom name # we take the first atom named N and the last atom named C nterm = u.select_atoms('segid 4AKE and name N')[0] cterm = u.select_atoms('segid 4AKE and name C')[-1] bb = u.select_atoms('protein and backbone') # a selection (AtomGroup) for ts in u.trajectory: # iterate through all frames r = cterm.position - nterm.position # end-to-end vector from atom positions d = numpy.linalg.norm(r) # end-to-end distance rgyr = bb.radius_of_gyration() # method of AtomGroup print("frame = {0}: d = {1} A, Rgyr = {2} A".format( ts.frame, d, rgyr))



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.