Csparc2star conversion for re-extracted particles

Hi, all.

I’m now trying to convert .cs file to .star file. I exported a re-extraction job and run the following script:

csparc2star.py J1586_particles_exported.cs J1586_particles_exported.star

However, an error always existed:

/shd/pyem/pyem/metadata.py:334: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify ‘dtype=object’ when creating the ndarray.
df[model[k]] = pd.DataFrame(np.array(
Columns must be same length as key
Traceback (most recent call last):
File “//software/pyem/csparc2star.py”, line 42, in main
df = metadata.parse_cryosparc_2_cs(cs, passthroughs=args.input[1:], minphic=args.minphic,
File “/software/pyem/pyem/metadata.py”, line 403, in parse_cryosparc_2_cs
df = cryosparc_2_cs_model_parameters(cs, df, minphic=minphic)
File “/software/pyem/pyem/metadata.py”, line 334, in cryosparc_2_cs_model_parameters
df[model[k]] = pd.DataFrame(np.array(
File “/usr/local/lib/python3.8/site-packages/pandas/core/frame.py”, line 3160, in setitem
self._setitem_array(key, value)
File “/usr/local/lib/python3.8/site-packages/pandas/core/frame.py”, line 3189, in _setitem_array
raise ValueError(“Columns must be same length as key”)
ValueError: Columns must be same length as key
Required fields could not be mapped. Are you using the right input file(s)?

It seems something’s missing. But I only have the following files in my export.

image

Do I have to link some other passthrough files from elsewhere?

Looking forward to your replies.

I think you may be using the wrong files for the conversion. See here: Export from cryoSPARC v2 and later · asarnow/pyem Wiki · GitHub

It looks like you have run an export job. This doesn’t do what you think it does, an export job is so you can import this job back into cryosparc in a different project for example.

You will need to find the passthrough.cs file from J1586 and the particles.cs file. This will work for your conversion to star. See the above guide if you need more information.

1 Like