Cryosparc to relion

Dear All,

I am experiencing some issues exporting 2D classification results back into relion where the particles were originally extracted. I am using the latest relion, pyem, conda, and cryosparc.

The command:
/data/CRYOSPARC/pyem/ --copy-micrograph-coordinates /data/XXX/Extract/job41/ /data/CRYOSPARC/USERS/Omid/P1/J154/particles_selected.cs

I now get the following error:
Traceback (most recent call last):
File “/data/CRYOSPARC/pyem/”, line 28, in
from pyem import metadata
File “/data/CRYOSPARC/pyem/pyem/ init .py”, line 3, in
from . import metadata
File “/data/CRYOSPARC/pyem/pyem/”, line 401
ptdf = util.dataframe_from_records_mapped(pt, {**general, **micrograph})

I removed the top part (data_optics section) as suggested in the forums in order to import it into cryosparc. I assume that pyem will re-import this info back from cryosparc.

I saw your recent post ( rlnMicrographName error) as well on this issue but it was not clear to me what the command should be to get around this problem or if this is the same problem at all.


Hi All,

After reinstalling miniconda and pyem I get another error but I think it is related:

/data/CRYOSPARC/miniconda3/pyem/ --copy-micrograph-coordinates /data/XXX/movies_raw/Sep06_collect/Extract/job41/ /data/CRYOSPARC/USERS/Omid/P1/J154/particles_selected.cs
Traceback (most recent call last):
File “/data/CRYOSPARC/miniconda3/pyem/”, line 28, in
from pyem import metadata
File “/data/CRYOSPARC/miniconda3/pyem/pyem/”, line 3, in
from . import metadata
File “/data/CRYOSPARC/miniconda3/pyem/pyem/”, line 23, in
from . import star
File “/data/CRYOSPARC/miniconda3/pyem/pyem/”, line 28, in
from pyem.util import natsort_values
File “/data/CRYOSPARC/miniconda3/pyem/pyem/util/”, line 3, in
from .util import *
File “/data/CRYOSPARC/miniconda3/pyem/pyem/util/”, line 28, in
from … import vop
File “/data/CRYOSPARC/miniconda3/pyem/pyem/vop/”, line 3, in
from .vop import *
File “/data/CRYOSPARC/miniconda3/pyem/pyem/vop/”, line 22, in
from pyfftw.interfaces.numpy_fft import rfftn
File “/data/CRYOSPARC/miniconda3/lib/python3.7/site-packages/pyfftw/”, line 43, in
from . import interfaces
File “/data/CRYOSPARC/miniconda3/lib/python3.7/site-packages/pyfftw/interfaces/”, line 237, in
from . import scipy_fftpack
File “/data/CRYOSPARC/miniconda3/lib/python3.7/site-packages/pyfftw/interfaces/”, line 65, in
from scipy.fftpack import (dct, idct, dst, idst, diff, tilbert, itilbert,
ImportError: cannot import name ‘_fftpack’ from ‘scipy.fftpack’ (/data/CRYOSPARC/miniconda3/lib/python3.7/site-packages/scipy/fftpack/


Dear @DanielAsarnow,

I moved the post from github to here since more people might see it. Although I never solved the issue fully, I did make the symbolic link as suggested at the bottom of the installation wiki. So now the environment seem to be reading in correctly and csparc2star works on its own without any inputs. The issue was related to reading in the correct python.

However I am still getting an error:

(pyem) [omid@c105445 Sort1]$ /data/CRYOSPARC/pyem/ --copy-micrograph-coordinates /data/XXX/movies_raw/Sep06_collect/Extract/job041/ /data/CRYOSPARC/USERS/Omid/P1/J154/particles_selected.cs --loglevel debug
Detected CryoSPARC 2+ .cs file
Reading primary file
Classification parameters not found
Directly copied fields: ucsfImagePath, rlnDetectorPixelSize, ucsfImageIndex, ucsfUid, rlnMagnification
Defocus values not found
Traceback (most recent call last):
File “/data/CRYOSPARC/pyem/”, line 106, in
File “/data/CRYOSPARC/pyem/”, line 62, in main
glob(args.copy_micrograph_coordinates)), join=“inner”)
File “/data/CRYOSPARC/miniconda2/envs/pyem/lib/python3.7/site-packages/pandas/core/reshape/”, line 255, in concat
File “/data/CRYOSPARC/miniconda2/envs/pyem/lib/python3.7/site-packages/pandas/core/reshape/”, line 301, in init
objs = list(objs)
File “/data/CRYOSPARC/pyem/”, line 61, in
(star.parse_star(inp, keep_index=False, augment=True) for inp in
File “/data/CRYOSPARC/pyem/pyem/”, line 282, in parse_star
df = pd.read_csv(starfile, skiprows=ln, delimiter=’\s+’, header=None, nrows=nrows)
File “/data/CRYOSPARC/miniconda2/envs/pyem/lib/python3.7/site-packages/pandas/io/”, line 685, in parser_f
return _read(filepath_or_buffer, kwds)
File “/data/CRYOSPARC/miniconda2/envs/pyem/lib/python3.7/site-packages/pandas/io/”, line 463, in _read
data =
File “/data/CRYOSPARC/miniconda2/envs/pyem/lib/python3.7/site-packages/pandas/io/”, line 1154, in read
ret =
File “/data/CRYOSPARC/miniconda2/envs/pyem/lib/python3.7/site-packages/pandas/io/”, line 2059, in read
data =
File “pandas/_libs/parsers.pyx”, line 881, in
File “pandas/_libs/parsers.pyx”, line 896, in pandas._libs.parsers.TextReader._read_low_memory
File “pandas/_libs/parsers.pyx”, line 950, in pandas._libs.parsers.TextReader._read_rows
File “pandas/_libs/parsers.pyx”, line 937, in pandas._libs.parsers.TextReader._tokenize_rows
File “pandas/_libs/parsers.pyx”, line 2132, in pandas._libs.parsers.raise_parser_error
pandas.errors.ParserError: Error tokenizing data. C error: Expected 10 fields in line 41, saw 16

Hi All,

Problem is solved. I was using the wrong python and not the original particle stack from relion because I made a new copy with the optics removed, but did not specify that particle stack, which was causing the last error.


Great, glad you figured it out!