|
67 | 67 |
|
68 | 68 | We will calculate the distances between an atom group of atoms 101-105
|
69 | 69 | and an atom group of atoms 4001-4005 with periodic boundary conditions.
|
70 |
| -To select these atoms: |
71 |
| -
|
72 |
| - .. testsetup:: |
73 |
| -
|
74 |
| - import MDAnalysis as mda |
75 |
| - from MDAnalysis.tests.datafiles import GRO, XTC |
76 |
| - import MDAnalysis.analysis.atomicdistances as ad |
| 70 | +To select these atoms: :: |
77 | 71 |
|
78 | 72 | >>> u = mda.Universe(GRO, XTC)
|
79 | 73 | >>> ag1 = u.atoms[100:105]
|
80 | 74 | >>> ag2 = u.atoms[4000:4005]
|
81 | 75 |
|
82 | 76 | We can run the calculations using any variable of choice such as
|
83 |
| -``my_dists`` and access our results using ``my_dists.results``: |
84 |
| -
|
85 |
| - .. testsetup:: |
86 |
| -
|
87 |
| - import MDAnalysis as mda |
88 |
| - from MDAnalysis.tests.datafiles import GRO, XTC |
89 |
| - import MDAnalysis.analysis.atomicdistances as ad |
90 |
| - u = mda.Universe(GRO, XTC) |
91 |
| - ag1 = u.atoms[100:105] |
92 |
| - ag2 = u.atoms[4000:4005] |
| 77 | +``my_dists`` and access our results using ``my_dists.results``: :: |
93 | 78 |
|
94 | 79 | >>> my_dists = ad.AtomicDistances(ag1, ag2).run()
|
95 | 80 | >>> my_dists.results
|
|
106 | 91 |
|
107 | 92 | To do the computation without periodic boundary conditions, we can enter
|
108 | 93 | the keyword argument ``pbc=False`` after ``ag2``. The result is different
|
109 |
| -in this case: |
110 |
| -
|
111 |
| - .. testsetup:: |
112 |
| -
|
113 |
| - import MDAnalysis as mda |
114 |
| - from MDAnalysis.tests.datafiles import GRO, XTC |
115 |
| - import MDAnalysis.analysis.atomicdistances as ad |
116 |
| - u = mda.Universe(GRO, XTC) |
117 |
| - ag1 = u.atoms[100:105] |
118 |
| - ag2 = u.atoms[4000:4005] |
| 94 | +in this case: :: |
119 | 95 |
|
120 | 96 | >>> my_dists_nopbc = ad.AtomicDistances(ag1, ag2, pbc=False).run()
|
121 | 97 | >>> my_dists_nopbc.results
|
|
0 commit comments