Importing modules into Python

Which python do I need to run to be able to load the module cryosparc2_compute? Setting the environment with:
eval $(cryosparcm env)

points to:


However, this python returns:
No module named cryosparc2_compute

I need to set the ctf/exp_group_id and location/exp_group_id of my .cs file for CTF refinement. These particles were imported from Relion3.1 and their opticsGroup were stripped during import (version 2.14.2). Thanks.

Best wishes,

Hi @rkhayat,

This is currently a bug. You’re correct that the entire opticsGroup is not imported, but the _rlnOpticsGroup field should be. The fix for this will be released in the next version of cryoSPARC (v2.15.0)

First, navigate to cryosparc2_worker

$ cd cryosparc2_worker`
$ eval $(./bin/cryosparcw env)
$ python
> import cryosparc2_compute.dataset
> import cryosparc2_compute.common
> #load the dataset
> particle_dataset = dataset.Dataset().from_file(<path_to_particle_dataset>)
> #add missing fields (this example is for particle datasets)
> particle_dataset = common.create_missing_fields_in_dataset(particle_dataset, 'ctf', 'particle.ctf')
#set the exposure group id
>['ctf/exp_group_id'][:] = 2

Please also note the “Exposure Group Utilities” Tool, that will allow you to split these groups without having to use the CLI: