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

it works,thanks!!! :blush:

Hello Oli! I have a question: the particles that are extract and then joined have different pixel size. How can I input the microscope parameters in the job config? Thank you!

Hi,
I’m trying to import a particle.star file (generated after 2D classification) from relion3.1 to cryosparc 3.0.1 and I get the following error:

[CPU: 395.5 MB] Warning: There are 8865 files referenced by the input star file that could not be found.

[CPU: 395.5 MB] Traceback (most recent call last):
File “cryosparc_master/cryosparc_compute/run.py”, line 84, in cryosparc_compute.run.main
File “/users/cryouser/cryosparc/cryosparc_master/cryosparc_compute/jobs/imports/run.py”, line 140, in run_import_particles
assert False, “Files referenced by the input star file are missing.”
AssertionError: Files referenced by the input star file are missing.

These are my input parameters:

Any suggestions to what am I doing wrong?

Many thanks!

Hi @matzovd, have you moved the star file to the Relion base directory? Otherwise the relative paths to the particle stacks would be wrong, which can cause the error you see here.

Cheers
Oli

Thanks! that did the trick…

Hi,

I am having a new error when trying to import a particle star file into cryosparc.
I have used relion_image_handler to high pass filter the original particle.star so I am not sure if that could be causing the problem.
The error

Thank you very much

Joana

Welcome to the forum @joana.paulino .

Does the import work with the “original” particle.star file?