|
14 | 14 | # Ribosome, sourced from EMDB: https://www.ebi.ac.uk/emdb/EMD-2660. |
15 | 15 | # This is one of several volume maps that can be downloaded with |
16 | 16 | # ASPIRE's data downloading utility by using the following import. |
| 17 | + |
17 | 18 | # sphinx_gallery_start_ignore |
18 | 19 | # flake8: noqa |
19 | 20 | # sphinx_gallery_end_ignore |
| 21 | + |
20 | 22 | from aspire.downloader import emdb_2660 |
21 | 23 |
|
22 | 24 | # Load 80s Ribosome as a ``Volume`` object. |
|
244 | 246 | # Instantiate an ``OrientedSource``. |
245 | 247 | oriented_src = OrientedSource(avgs, orient_est) |
246 | 248 |
|
| 249 | +# Estimate Rotations. |
| 250 | +est_rotations = oriented_src.rotations |
247 | 251 |
|
248 | 252 | # %% |
249 | 253 | # Mean Error of Estimated Rotations |
|
255 | 259 | from aspire.utils import mean_aligned_angular_distance |
256 | 260 |
|
257 | 261 | # Compare with known true rotations |
258 | | -mean_ang_dist = mean_aligned_angular_distance(oriented_src.rotations, true_rotations) |
| 262 | +mean_ang_dist = mean_aligned_angular_distance(est_rotations, true_rotations) |
259 | 263 | print(f"Mean aligned angular distance: {mean_ang_dist} degrees") |
260 | 264 |
|
261 | 265 |
|
|
286 | 290 | # Get the first 10 projections from the estimated volume using the |
287 | 291 | # estimated orientations. Recall that ``project`` returns an |
288 | 292 | # ``Image`` instance, which we can peek at with ``show``. |
289 | | -projections_est = estimated_volume.project(oriented_src.rotations[0:10]) |
| 293 | +projections_est = estimated_volume.project(est_rotations[0:10]) |
290 | 294 |
|
291 | 295 | # We view the first 10 projections of the estimated volume. |
292 | 296 | projections_est.show() |
|
308 | 312 |
|
309 | 313 | # `find_registration` returns the best aligning rotation, `Q`, as well as |
310 | 314 | # a `flag` which indicates if the volume needs to be reflected. |
311 | | -Q, flag = Rotation(oriented_src.rotations).find_registration(true_rotations) |
| 315 | +Q, flag = Rotation(est_rotations).find_registration(true_rotations) |
312 | 316 | aligned_vol = estimated_volume |
313 | 317 | if flag == 1: |
314 | 318 | aligned_vol = aligned_vol.flip() |
|
0 commit comments