-
Notifications
You must be signed in to change notification settings - Fork 43
Description
I would want to update the FAQ with some of the issues that I repeatedly see new users trip up. I am listing a few points here and use the issue as a notepad.
Basics
The Introduction in the Quickstart is already laying out most of the key things to be aware of. It should be copied into the API docs and as a separate intro chapter for the rest of the user guide — it's really important to tell people up-front what the basic philosophy is.
-
Only one frame is loaded into memory. (in principle addresses in Why do the atom positions change over trajectories?)
A key idea is that only one frame of the trajectory is read from disk into memory. All objects from the universe then work with the data of the current frame.
u.atoms.positionsare the positions at the current frame. When you dou.trajectory[-1]you will move to the end of the trajectory. Nowu.atoms.positionswill contain a new set of coordinates. -
MDAnalysis keeps track of the trajectory frame (keeps state). Think of it as a "cursor" that points to a frame on the trajectory on disk. Only this frame is "active".
-
Generally, figuring out when you need to make a copy is confusing (e.g. when using
Timestepin the canonicalfor ts in u.trajectory).
Groups (Containers)
-
"fragments" are groups of particles that are all connected by bonds, and no bonded particles are excluded (like chemical molecules); fragments are not part of the Segment/Residue/Atom hierarchy (a fragment can span multiple residues or even segments)
-
"segments" are arbitrary but mutually exclusive collections of "Residue" instances.
-
AtomGroups are arbitrary collections of Atom instances.
-
attributes are "tags" for Atoms and containers (AtomGroups, Residues, ResidueGroups, Segments, SegmentGroups) that describe the Atom or container. attributes can be used for selections. Arbitrary attributes can be added.
Selecting
- Difference between static and dynamic (
updating=True) selections and really the need to be aware of it!
Trajectory manipulation
-
"unwrap" means to "make molecules whole across periodic unit cell boundaries". "nojump" means to make trajectories continuous across periodic boundaries.
-
In order to do RMSD-superposition, you typically need to make a copy of the coordinates.