Hi Daniel,
I’ve been looking at all the availible .cs files in the MotionCorr and movie import jobs with the cryosparc icli to see the available fields. I’m not sure any of these contain the Z size unless this is stored in ‘shape’.
Either way I attach these incase you spot something I don’t…
From the motion corr job:
micrographs_rigid_aligned.cs
uid <u8
micrograph_blob/path |O
micrograph_blob/idx <u4
micrograph_blob/shape <u4 (2,)
micrograph_blob/psize_A <f4
micrograph_blob/format |O
micrograph_blob/is_background_subtracted <u4
micrograph_blob/vmin <f4
micrograph_blob/vmax <f4
micrograph_blob/import_sig <u8
micrograph_blob_non_dw/path |O
micrograph_blob_non_dw/idx <u4
micrograph_blob_non_dw/shape <u4 (2,)
micrograph_blob_non_dw/psize_A <f4
micrograph_blob_non_dw/format |O
micrograph_blob_non_dw/is_background_subtracted <u4
micrograph_blob_non_dw/vmin <f4
micrograph_blob_non_dw/vmax <f4
micrograph_blob_non_dw/import_sig <u8
micrograph_thumbnail_blob_1x/path |O
micrograph_thumbnail_blob_1x/idx <u4
micrograph_thumbnail_blob_1x/shape <u4 (2,)
micrograph_thumbnail_blob_1x/format |O
micrograph_thumbnail_blob_1x/binfactor <u4
micrograph_thumbnail_blob_1x/micrograph_path |O
micrograph_thumbnail_blob_1x/vmin <f4
micrograph_thumbnail_blob_1x/vmax <f4
micrograph_thumbnail_blob_2x/path |O
micrograph_thumbnail_blob_2x/idx <u4
micrograph_thumbnail_blob_2x/shape <u4 (2,)
micrograph_thumbnail_blob_2x/format |O
micrograph_thumbnail_blob_2x/binfactor <u4
micrograph_thumbnail_blob_2x/micrograph_path |O
micrograph_thumbnail_blob_2x/vmin <f4
micrograph_thumbnail_blob_2x/vmax <f4
background_blob/path |O
background_blob/idx <u4
background_blob/binfactor <u4
background_blob/shape <u4 (2,)
background_blob/psize_A <f4
rigid_motion/type |O
rigid_motion/path |O
rigid_motion/idx <u4
rigid_motion/frame_start <u4
rigid_motion/frame_end <u4
rigid_motion/zero_shift_frame <u4
rigid_motion/psize_A <f4
spline_motion/type |O
spline_motion/path |O
spline_motion/idx <u4
spline_motion/frame_start <u4
spline_motion/frame_end <u4
spline_motion/zero_shift_frame <u4
spline_motion/psize_A <f4
passthrough_micrographs.cs
uid <u8
movie_blob/path |O
movie_blob/shape <u4 (3,)
movie_blob/psize_A <f4
movie_blob/is_gain_corrected <u4
movie_blob/format |O
movie_blob/has_defect_file <u4
movie_blob/import_sig <u8
gain_ref_blob/path |O
gain_ref_blob/idx <u4
gain_ref_blob/shape <u4 (2,)
gain_ref_blob/flip_x <u4
gain_ref_blob/flip_y <u4
gain_ref_blob/rotate_num <u4
mscope_params/accel_kv <f4
mscope_params/cs_mm <f4
mscope_params/total_dose_e_per_A2 <f4
mscope_params/phase_plate <u4
mscope_params/neg_stain <u4
mscope_params/exp_group_id <u4
mscope_params/defect_path |O
From the movies import job, imported_movies.cs
uid <u8
movie_blob/path |O
movie_blob/shape <u4 (3,)
movie_blob/psize_A <f4
movie_blob/is_gain_corrected <u4
movie_blob/format |O
movie_blob/has_defect_file <u4
movie_blob/import_sig <u8
gain_ref_blob/path |O
gain_ref_blob/idx <u4
gain_ref_blob/shape <u4 (2,)
gain_ref_blob/flip_x <u4
gain_ref_blob/flip_y <u4
gain_ref_blob/rotate_num <u4
mscope_params/accel_kv <f4
mscope_params/cs_mm <f4
mscope_params/total_dose_e_per_A2 <f4
mscope_params/phase_plate <u4
mscope_params/neg_stain <u4
mscope_params/exp_group_id <u4
mscope_params/defect_path |O
Our Motion Corr job was run offline and the output with --loglevel=info is:
Writing per-movie star files into MovieExport/Movies/
Creating movie data_general tables
Copying micrograph size
Traceback (most recent call last):
File "/xxx/miniconda3/envs/pyem/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 3361, in get_loc
return self._engine.get_loc(casted_key)
File "pandas/_libs/index.pyx", line 76, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 5198, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 5206, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'rlnImageSizeZ'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/xxx/software/pyem/csparc2star.py", line 170, in <module>
sys.exit(main(parser.parse_args()))
File "/xxx/software/pyem/csparc2star.py", line 59, in main
data_general = metadata.cryosparc_2_cs_movie_parameters(cs, passthrough=pt, trajdir=trajdir, path=args.micrograph_path)
File "/xxx/software/pyem/pyem/metadata/cryosparc2.py", line 222, in cryosparc_2_cs_movie_parameters
data_general[star.Relion.MICROGRAPHDOSERATE] /= data_general[star.Relion.IMAGESIZEZ]
File "/xxx/software/miniconda3/envs/pyem/lib/python3.9/site-packages/pandas/core/frame.py", line 3458, in __getitem__
indexer = self.columns.get_loc(key)
File "/xxx/software/miniconda3/envs/pyem/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 3363, in get_loc
raise KeyError(key) from err
KeyError: 'rlnImageSizeZ'
Z size is is something cryosparc should automatically read from the input movies I’m guessing? Perhaps there is a way for me to modify the .cs file to include an extra field if this is missing? Or is it stored in ‘shape’?
Thanks so much for you help on all of this!
Max