Export particles to relion

Hi All,
I have an issue with csparc2star.py after the new update to cryosparc v3.31. I extracted particles in Relion, then imported them in Cryosparc where I did 2D classification. I would like to convert selected particles back into .star file, but I get the an error (copied below). I have done the same pipeline before the new cryosparc update and it worked fine.

Coordinates merge key: None
Traceback (most recent call last):
  File "./csparc2star.py", line 120, in <module>
    sys.exit(main(parser.parse_args()))
  File "./csparc2star.py", line 71, in main
    df = star.smart_merge(df, coord_star, fields=fields, key=key)
  File "/home/rsarsam/Scripts/pyem-master-oct2020/pyem/star.py", line 143, in smart_merge
    s2 = s2.set_index(key, drop=False)
  File "/home/rsarsam/anaconda3/lib/python3.8/site-packages/pandas/core/frame.py", line 4727, in set_index
    raise KeyError(f"None of {missing} are in the columns")

Any ideas or help how to fix this issue?
Thanks!

1 Like

Hi Reta,

I think it would be useful to check what the header of the star file is. How many columns are described?

Best,

Jean-Paul

Hi Reta,

What command did you use for csparc2star? If you are using --copy-micrograph-coordinates it will not work anymore since all the rlnMicrographName and rlnImageName paths now have a bunch of random numbers in them. Here is my workaround if that is your issue. https://github.com/ryanfeathers/CryoEM_Scripts/blob/d71957b7f2463d819aac1757688565114ff6e59e/replacepaths.py

Best,

Ryan

@retasarsam A related fix has been submitted to the pyem developer for review.

1 Like

Hi Ryan,

I am wondering which files is:
–i I input particle star file
–p P input star file with new paths

I extracted particles in Relion, and import the particles star from this extract job to Cryosparc for further 3D refinment.
Now I faced the problem to convert to star files with --copy-micrograph-coordinates.

Thank you.

Hi Yeu,

The best way to convert particles back to RELION from cryosparc is to follow the instructions for using pyem

My script is probably outdated now since pyem can remove uids with --strip-uid