Home MDAnalysis
Post
Cancel

MDAnalysis

MDAnalysis

Atoms, residules, and segments

The data structure in MDAnalysis Atoms and atom groups

Source: https://userguide.mdanalysis.org/stable/groups_of_atoms.html

Selecting atoms

Numerical ranges can be written as first-last or first:last where the range is inclusive. Note that in slicing, the last index is not included.

1
2
3
4
print(u.select_atoms('resid 50-100').n_residues)
print(u.residues[50:100].n_residues)
> 51
> 50

Constructing, modifying, and adding to a Universe

https://userguide.mdanalysis.org/stable/examples/constructing_universe.html

Angles, Dihedral angles

1
2
3
4
nhh = u.atoms[:3]
print(nhh.names)
angle_nhh = nhh.angle
print(f"N-H-H angle: {angle_nhh.value():.2f}")

Rotating around a dihedral with MDAnalysis

Parallelizing analysis

Ref:
Quick start guide
MDAnalysis Examples

This post is licensed under CC BY 4.0 by the author.