Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCS: Align.py changes made #4182

Merged
merged 20 commits into from
Jul 3, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions package/MDAnalysis/analysis/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,13 @@ def rotation_matrix(a, b, weights=None):
:meth:`MDAnalysis.core.groups.AtomGroup.rotate` to generate a rotated
selection, e.g. ::

>>> R = rotation_matrix(A.select_atoms('backbone').positions,
>>> B.select_atoms('backbone').positions)[0]
>>> A.atoms.rotate(R)
>>> from MDAnalysisTests.datafiles import TPR, TRR
>>> from MDAnalysis.analysis import align
>>> A = mda.Universe(TPR, TRR)
>>> B = A.copy()
>>> R = align.rotation_matrix(A.select_atoms('backbone').positions,
... B.select_atoms('backbone').positions)[0]
>>> A.atoms.rotate(R) # doctest: +SKIP
MohitKumar020291 marked this conversation as resolved.
Show resolved Hide resolved
>>> A.atoms.write("rotated.pdb")

Notes
Expand Down