Import of star files generated by relion 3.1 fails [bug]

Hi,

The format of star files used by Relion has changed in 3.1, and now includes a data_optics section at the top specifying microscope parameters.

CryoSPARC cannot recognize these files and throws an error on particle stack import.

Cheers,
Oli

1 Like

(meant to say - there is an easy workaround for this, which is to just delete the data_optics section before import and to manually enter this info in the job config. But it would be better to handle automatically.)

Thanks for the workaround suggestion, Oli!

I also found that the good old export command in relion throws an error:

How did you get it to export?

mpirun -np 64 relion_preprocess_mpi --operate_on Refine3D/job860/run_data.star --operate_out job860_cryosparc_import

ERROR: 
ERROR: this functionality is no longer supported on STAR files. You can still operate on image stacks.
=== Backtrace  ===
relion_preprocess_mpi(_ZN11RelionErrorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_l+0x6d) [0x426afd]
relion_preprocess_mpi(_ZN13Preprocessing21runOperateOnInputFileEv+0xab0) [0x453880]
relion_preprocess_mpi(_ZN16PreprocessingMpi3runEv+0xa1) [0x462a21]
relion_preprocess_mpi(main+0x4e) [0x41ef3e]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7febfaac9830]
relion_preprocess_mpi(_start+0x29) [0x41f8c9]
==================
ERROR: 
ERROR: this functionality is no longer supported on STAR files. You can still operate on image stacks.
application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0
1 Like

That’s annoying mostly if you are planning on using cistem - you shouldn’t need to do this prior to import into cryosparc though - what reason do you need a single stack/star combo for?

Cheers
Oli

1 Like

No particular reason. It simply worked flawlessly for me in the past, and was simple enough to execute, so I ended up using it for all of my relion ==> cryosparc exports.

Importing the run_data.star file directly throws this error in cryosparc:

Traceback (most recent call last):
  File "cryosparc2_master/cryosparc2_compute/run.py", line 78, in cryosparc2_compute.run.main
  File "cryosparc2_compute/jobs/imports/run.py", line 232, in run_import_particles
    assert do_blob or do_ctf or do_location or do_pose, "Could not import star file: too many fields missing. "
AssertionError: Could not import star file: too many fields missing. 

I guess I would need to play with those parameters to get this to work:
image

I’ll also try removing the data_optics section as you suggested.

Okay, it looks like your workaround worked, Oli!

I needed to delete the optics section from the .star file, specify the path to my relion directory in “particle data path”, and also input all microscope parameters in the job config.

I’m working on improved .star IO routines that will handle the Relion 3.1 change (and also future changes as long as they are still legal STAR files as per the spec).

That will streamline things a bit when using csparc2star.py, or stack.py to make stacks instead of relion_preprocess.

3 Likes

a bit late for my answer but i just copy the data from the optics_group to the particle_data part just adding more column. then remove the optics_group section.
It seems to work fine at at least i have all the right parameters

Thanks Eric! How do you conveniently copy those parameters as extra columns? Do you have an easy one-liner for that?

Oli

Because I am a little lazy (and mainly don’t have time to learn how to write script) I open in excel copy the columns and save as txt. Works a treat. I am sure their is a nice little script somewhere

1 Like

@ehanssen @olibclarke That’s great that this way works. I will add support for these columns, without the optics group table, tonight or tomorrow. The .star format is unwieldy for good/efficient parsing with multiple tables, but converting these fields is trivial.

Hey @olibclarke, @DanielAsarnow, @kacper, @ehanssen,

In cryoSPARC v2.13+, you can now import Relion 3.1 generated .star files into cryoSPARC, but the data_optics table is ignored. We’re currently working on converting rlnOddZernike and rlnEvenZernike to cryoSPARC’s conventions.

2 Likes