11.4.1. Core functions of MDAnalysis

The basic class is an AtomGroup; the whole simulation is called the Universe. Selections are computed on an AtomGroup and return another AtomGroup.

To get started, load the Universe:

u = Universe(topology_file, trajectory_file)

A simple selection of all water oxygens within 4 A of the protein:

water_shell = u.select_atoms('name OH2 and around 4.0 protein')
water_shell.n_atoms           # how many waters were selected
water_shell.total_mass()       # their total mass

AtomGroup instances have various methods that allow calculation of simple properties. For more complicated analysis, obtain the coordinates as a numpy array

coords = water_shell.positions

and write your own Python code.