@@ -110,41 +110,41 @@ def reduce_dimensionality(ensembles,
110
110
Here, we reduce two ensembles to two dimensions, and plot the result using
111
111
matplotlib: ::
112
112
113
+ >>> import matplotlib.pyplot as plt
113
114
>>> from MDAnalysis import Universe
114
115
>>> import MDAnalysis.analysis.encore as encore
115
116
>>> from MDAnalysis.tests.datafiles import PSF, DCD, DCD2
116
117
>>> ens1 = Universe(PSF, DCD)
117
118
>>> ens2 = Universe(PSF, DCD2)
118
119
>>> coordinates, details = encore.reduce_dimensionality([ens1,ens2])
119
120
>>> plt.scatter(coordinates[0], coordinates[1],
120
- color=[["red", "blue"][m-1] for m
121
- in details["ensemble_membership"]])
121
+ ... color=[["red", "blue"][m-1] for m
122
+ ... in details["ensemble_membership"]]) # doctest: +SKIP
122
123
123
124
Note how we extracted information about which conformation belonged to
124
125
which ensemble from the details variable.
125
126
126
127
You can change the parameters of the dimensionality reduction method
127
128
by explicitly specifying the method ::
128
129
129
- >>> coordinates, details =
130
- encore.reduce_dimensionality([ens1,ens2],
131
- method=encore.StochasticProximityEmbeddingNative (dimension=3))
130
+ >>> coordinates, details = encore.reduce_dimensionality([ens1,ens2],
131
+ ... method= encore.StochasticProximityEmbeddingNative
132
+ ... (dimension=3))
132
133
133
134
Here is an illustration using Principal Component Analysis, instead
134
135
of the default dimensionality reduction method ::
135
136
136
- >>> coordinates, details =
137
- encore.reduce_dimensionality(
138
- [ens1,ens2],
139
- method=encore.PrincipalComponentAnalysis(dimension=2))
137
+ >>> coordinates, details = encore.reduce_dimensionality(
138
+ ... [ens1,ens2],
139
+ ... method=encore.PrincipalComponentAnalysis(dimension=2))
140
140
141
141
You can also combine multiple methods in one call ::
142
142
143
- >>> coordinates, details =
144
- encore.reduce_dimensionality(
145
- [ens1,ens2] ,
146
- method=[ encore.PrincipalComponentAnalysis(dimension=2),
147
- encore.StochasticProximityEmbeddingNative (dimension=2)])
143
+ >>> coordinates, details = encore.reduce_dimensionality(
144
+ ... [ens1,ens2],
145
+ ... method=[encore.PrincipalComponentAnalysis(dimension=2) ,
146
+ ... encore.StochasticProximityEmbeddingNative
147
+ ... (dimension=2)])
148
148
149
149
"""
150
150
0 commit comments