I would like to be able to export selected classes (templates) as an mrc stack, rather than as a cs file (which I don’t know how to convert to an mrc). This would be useful for using these class averages outside of cryosparc, e.g. for picking in relion.
Thanks Juraj! Yep that should do the trick - just didn’t realize “blob” meant mrc haha… Weird that that file is not in the corresponding project directory though.
Actually that’s not exactly right on closer inspection - clicking on that (for selected classes) downloads a stack of all the classes, not just the selected classes - it doesn’t generate a stack of the selected templates.
I see. But then I would re-label this as a bug and not a feature request. If I ask for a blob of something called “templates_selected” and get back the input templates, I doubt that’s the intended behavior.
You’re right - this is not the correct behaviour.
Actually what happens is that all raw data (i.e. blobs) are stored in mrc format. But metadata (including file path and index within a file, in the case of particles or templates) is stored in a .cs file which is just a numpy tabular format. The select2D job therefore does not create a new .mrc file, just a new .cs file that points to the original .mrc file but only has rows for the selected subset of templates. We will change the behaviour so that select2D does output its own .mrc file that can be downloaded.
Coming back to this topic. Did the behaviour change again? In the most recent version (2.14.2) I again get the full template stack, even if I download only selected templates. I can see that in the project directory, the templates_selected.cs file points to the index of the selected 2d classes in the full stack, but it would be great if also a new mrc stack with the selected templates would be created. If not by default, maybe when selecting to ‘export’ the job? Thanks a lot.
Can I learn how to download mrcs file from cryosparc’s “Select 2D classes”? Even with cryosparc tutorial set, I don’t know how to do it. Once I have mrcs file, I can easily convert it into image (tif) file using eman2.
I need to extract/download selected particles after 2-d classification. Therefore, I clicked download button and blob in “particles_selected”
However, downloaded particles_selected.cs is a cryosparc file rather than mrcs.
I converted this cs file into star by pyem, and this star file has mrc and location information of 8,281 number of particles, but I’m not sure how to extract mrcs/image file from this star file.
relion_preprocess used to generate mrcs from star file, but it appears (at least to me) to have many version dependent incompatibility issues around format/options.
If I click download button in “templates_selected”,
I could download mrc file, but this seems averaged volume rather than individually selected particles.
The mrc file of the templates you can download is simply a stack of all the 2d classes (a volume is basically a stack of 2d images). Most likely your mrc viewer (eman2) of choice interprets the downloaded stack as a 3D volume. For the desired display as individual 2D classes with eman2 you can simply rename the downloaded mrc file to mrcs and eman2 will then automatically interpret the file as a stack of 2d images rather than a 3D volume. Hope this helps.
Yes, I knew this already (change mrc to mrcs and convert to image files) as Steven Ludtke suggested. It worked very well for my other sets. However, I didn’t think of applying to here as well.
Thanks to your advice, I could generate image files now.
However, for a blob (mrc) downloaded from
didn’t work as intended as Oli and you reported in 2018 and recently.
I downloaded cryosparc_P71_J30_020_class_averages.mrc and changed to cryosparc_P71_J30_020_class_averages.mrcs and converted to images files. However, it generated 50 image files (Templates selected : 18, Templates excluded : 32). It is supposed to generate only 18 image files.
looks like this is still a bug, even in the latest ver. Bummer. I just want to get the selected vs excluded in 2 separate files! pretty pls fix this bug? I’ll start a new thread over in bugs.
The select2D job outputs indices of the selected templates for subsequent jobs but doesn’t duplicate the template .mrc files themselves - we will change this behaviour in the next version.
For now, you can use the following script to split up the templates:
First, note the project (PXX) and job (JXX) number of the select 2D job. Then: cryosparcm icli
will get you into the interactive cryoSPARC shell.
I tried this, but my 3rd line attempt (dset = rc.load_output_group_direct(‘P10’,‘J401’,‘templates_selected’)) resulted in
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
in ()
----> 1 dset = rc.load_output_group_direct(‘P10’,‘J401’,‘templates_selected’)
I have recently encountered this problem using cryoSPARC V4.0.1
The original solution provided by apunjani in this thread did not work for me, below the mildly modified version which did (changed original lines 2 & 7):