Visualizing orientation distribution other than heatmap?

issue_recorded

#1

Is there a way to visualize the orientation distribution of particles contributing to a map other than the Elevation/Azimuth heatmap? Can I export the cryosparc metadata file to another program for visualization of this distribution?

In particular, I’d like to view as cylinders with height proportional to the number of particles in the orientation indicated (similar to Relion).

Thanks!


#2

Hi Aaron,

You could export to relion and run a “fake” 3D auto refine run - setting searches to 0.1 degree, lowpass to the global res from cryosparc, and offsets to 0 & 0 - that should more or less accomplish this I think.

Cheers
Oli


#3

If you convert to a star file, you can use the star2bild.py program in pyem to produce a XMIPP/Chimera style orientation plot like the ones made by Relion. This program works with any particle star file. I set the colors and cylinder sizes to mimic the ones made by Relion, and it uses the same HealPix angle bins as Relion.


#4

Thanks so much for your response, Oli! I’ll try to get this going and report back on the final result in case anyone else is interested.
-Aaron


#5

Thank you, Daniel! I will definitely be trying this out.
-Aaron


#6

Hi Daniel,

I have had some trouble updating pyem on linux. I was previously on the version that could not handle cryosparc2 files. Perhaps you may have some insight to my problems. I tried just installing fresh after removing the old version and got this error. Then I tried to git pull in the old folder (after putting it back in its original location) and still had this error. After completing the " pip install -e ." command, it says installation was successful.

Sorry, this is my first time trying to update any program from github.

Thanks for any help,
Aaron

Traceback (most recent call last):
File “/home/user/pyem/csparc2star.py”, line 28, in
from pyem import metadata
File “/home/user/pyem/pyem/ init .py”, line 3, in
from . import metadata
File “/home/user/pyem/pyem/metadata.py”, line 25, in
from . import star
File “/home/user/pyem/pyem/star.py”, line 31, in
from pyem.util import rot2euler
File “/home/user/pyem/pyem/util/ init .py”, line 3, in
from .util import *
File “/home/user/pyem/pyem/util/util.py”, line 25, in
from … import geom
File “/home/user/pyem/pyem/geom/ init .py”, line 4, in
from .geom import *
File “/home/user/pyem/pyem/geom/geom.py”, line 22, in
from .quat_numba import qslerp
File “/home/user/pyem/pyem/geom/quat_numba.py”, line 153, in
“(m)->(m), (m), (m), (m)”, nopython=True, cache=False)
File “/home/user/miniconda2/lib/python2.7/site-packages/numba/npyufunc/decorators.py”, line 179, in wrap
guvec.add(fty)
File “/home/user/miniconda2/lib/python2.7/site-packages/numba/npyufunc/ufuncbuilder.py”, line 198, in add
self.nb_func, targetoptions, sig)
File “/home/user/miniconda2/lib/python2.7/site-packages/numba/npyufunc/ufuncbuilder.py”, line 129, in _compile_element_wise_function
cres = nb_func.compile(sig, **targetoptions)
File “/home/user/miniconda2/lib/python2.7/site-packages/numba/npyufunc/ufuncbuilder.py”, line 78, in compile
return self._compile_core(sig, flags, locals)
File “/home/user/miniconda2/lib/python2.7/site-packages/numba/npyufunc/ufuncbuilder.py”, line 113, in _compile_core
flags=flags, locals=locals)
File “/home/user/miniconda2/lib/python2.7/site-packages/numba/compiler.py”, line 871, in compile_extra
return pipeline.compile_extra(func)
File “/home/user/miniconda2/lib/python2.7/site-packages/numba/compiler.py”, line 365, in compile_extra
return self._compile_bytecode()
File “/home/user/miniconda2/lib/python2.7/site-packages/numba/compiler.py”, line 802, in _compile_bytecode
return self._compile_core()
File “/home/user/miniconda2/lib/python2.7/site-packages/numba/compiler.py”, line 789, in _compile_core
res = pm.run(self.status)
File “/home/user/miniconda2/lib/python2.7/site-packages/numba/compiler.py”, line 251, in run
raise patched_exception
TypeError: Failed at nopython (analyzing bytecode)
Signature mismatch: 2 argument types given, but function takes 1 arguments


#7

Thanks for trying out my stuff. I have been making some breaking changes in the master branch lately, which is why you’ve seen this error.

Try git checkout tags/v0.4 to switch to the latest release version. Since you installed with pip install -e it should be updated immediately and no new pip command should be required.


#9

Really fantastic! Thank you so much, Daniel! This worked after performing git pull, followed by your command and installing healpy. The bild file looks nice.
Now, is there a way to customize the visualization of this file? For example, I have seen figures showing just half of this bild sphere.
-Aaron


#10

you can just do that in Chimera, Aaron - e.g. use per model clipping


#12

Thanks for pointing out the missing healpy requirement, I added it to the requirements.txt for future users.

Right now star2bild.py just uses the angles in the star file, so if Relion isn’t accounting for projection ambiguity (and it indeed does not) then you get the whole sphere covered.

It would be easy to force half the sphere, or a certain symmetry group, using my implementation (I take advantage of the order-preserving surjection between great circle arc length and secant distance, and use a kD-tree to rapidly histogram the Euler angles). If there’s interest, and in particular if there are good suggestions, I could revisit it.


#13

Thanks for the info and all the help, Daniel. It’s working great for my needs at the moment. I know clipping is not perfect, but to achieve the 1/4 sphere, I use the per model clipping as suggested by Oli, with global clipping in the second plane.
Thanks to you both for the advice!
Aaron


#14

@user123 @olibclarke I implemented a --sym argument for star2bild.py which will apply the symmetry to the angles from cryoSPARC. It was trickier than I thought!


#15

Great, I look forward to giving it a spin!