Hi, I created templates with ~30 “import volumes → create templates” pairs, and want to use them across multiple projects. However, the “import templates” allows me to import templates in mrc format only. I can import them one-by-one from respective job folders, but it’s still quite tedious.
Can I merge multiple template MRC files into one with either some external tool or within cryosparc?
Apologies for the delayed response. This is an interesting case!
To answer your question – right now the best way to merge templates from different mrc files is through CryoSPARC Tools. CryoSPARC Tools allows you to read/write
mrc files generated by CryoSPARC, to run custom scripts as jobs in the UI, and a lot more. In your case, you may find the following of interest:
- Walkthrough for Generating High-Res 2D Class images. In particular, the first few code blocks, which show you how to load in
mrc files of 2D classes/templates into a python script. In your case, you’d want to call
project.download_mrc on the path of the output
mrc files for each of the Create Templates jobs, rather than the Select 2D job as shown in the tutorial
- Once you have the templates as numpy arrays, you can then use numpy.concatenate to concatenate them all into one huge array containing the templates from all 30 of these jobs, and then write them out to a
mrc file using cryosparc.mrc submodule. Specifically, the
mrc.write() function, which will write out the mrc to the specified path passed in as an argument
- Finally, you’ll have to import this mrc back into CryoSPARC, which should be doable without scripting by simply using the Import Templates job, and setting the “Templates data path” parameter to the specified path in the previous step.
I hope this helps! Could we ask for what purposes you are using this workflow? Is it for template-based picking of a large number of similar datasets?
thanks, I’ll look into that next time I need it – for now, I simply re-imported everything into the second project.
Answering your question:
Could we ask for what purposes you are using this workflow? Is it for template-based picking of a large number of similar datasets?
We usually have a policy “single data collection – single project” in CryoSPARC, and different data processing attempts happening inside. Hence, if something gets re-collected, we simply import volumes that we’ll use for “Align 3D” or “Template picker” jobs, it’s not a big deal.
With new samples, we wanted to use all known 3D conformations of a certain protein as templates, imported our known volumes and known EMDB volumes into CryoSPARC and used for template picking.
The rational way to do that would be to determine which conformations are actually substantially different from each other, and use only those (which I assume would reduce the number of conformations), but I was too lazy to do that and simply used all of them.