Skip to content

Instantly share code, notes, and snippets.

@jrhaberstroh
Last active February 22, 2017 06:24
Show Gist options
  • Save jrhaberstroh/031ce765b2ee5d56d597067977d0307c to your computer and use it in GitHub Desktop.
Save jrhaberstroh/031ce765b2ee5d56d597067977d0307c to your computer and use it in GitHub Desktop.
Simple MDAnalysis script to read in coordinates, modify them, and write them back out
from MDAnalysis import *
filename_in ="fakefile_{}.gro".format("in")
filename_out="fakefile_{}.gro".format("out")
ref = Universe(filename)
R = [[1, 0, 0], [0, 0, 1], [0, 1, 0]]
ref.atoms.translate(-ref.atoms.center_of_mass())
ref.atoms.rotate(R)
ref.atoms.write(filename_out)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment