Hi Daniel:
My colleague Elmar has been using CryoSPRAC at OHSU and ran into an issue (using cs files in Relion after converting it to star). I could not resolve it myself. His notes on the issue:
I run CryoSPARC v2.15.0+200710.
I try to convert cs files to star files that I would be able to read, either with relion 3.1.0-commit-72f783 or relion 3.0.7
I generated star files in 3 ways:
executing an export job in cryosparc and then:
csparc2star.py P2_J12_particles_exported.cs P2_J12_particles_exported_relion31.star
csparc2star.py -r2 P2_J12_particles_exported.cs P2_J12_particles_exported_relion30.star
It does not matter, which of the 3 version I take.
If I try to load a relion 31 compatible star file into relion 31 I get the error:
=== Backtrace ===
/sw/relion/3.1/bin/relion_refine(_ZN11RelionErrorC1ERKSsS1_l+0x41) [0x529ce1]
/sw/relion/3.1/bin/relion_refine(_ZNK16ObservationModel10getBoxSizeEi+0x6b) [0x5769eb]
/sw/relion/3.1/bin/relion_refine(_ZN7MlModel20initialiseFromImagesE8FileNamebR10ExperimentRbS3_S3_dbbb+0x605) [0x50d115]
/sw/relion/3.1/bin/relion_refine(_ZN11MlOptimiser17initialiseGeneralEi+0x4f1) [0x47ca91]
/sw/relion/3.1/bin/relion_refine(_ZN11MlOptimiser10initialiseEv+0x484) [0x47f8c4]
/sw/relion/3.1/bin/relion_refine(main+0x33) [0x430f83]
/lib64/libc.so.6(__libc_start_main+0xf3) [0x7fd4360421a3]
/sw/relion/3.1/bin/relion_refine() [0x4343ff]
ERROR:
ObservationModel::getBoxSize: box sizes not available. Make sure particle images are available before converting/importing STAR files from earlier versions of RELION.
If I try ti load a relion 30 compatible star file into relion 30 I get the error:
ERROR:
Cannot read file J10/extract/1782638280813807455_14sep05c_00024sq_00003hl_00005es.frames_patch_aligned_doseweighted_particles.mrc It does not exist
Is there any obvious thing I do wrong?
How could I get this running?
Any help is appreciated.
Hi Elmar, yes that is correct - add the _rlnImageSize label and the corresponding entry in the data string. Yes it is just the box size in pixels (of the particles, not the movies). I believe rln is shorthand for relion.
This makes sense now, and I found the correct value in the T20S tutorial (that is the data I am working at the moment with) https://cryosparc.com/docs/tutorials/t20s ,
In Step 7.5 Box size is written: āIn this case, enter a box size of 384ā.
If I enter this value I run into the same error like I run with the relion30 version.
This is a good sign. So I have now to work on the folder structure.
I still can not resolve this issue, and I donāt see where the problem is.
This is what I did:
I went to cryosparc āextract from micrographsā job and exported the job.
I copied the exported job into a workingdirectory relionprj to mess around with it: cp -r ../cspark/P2/exports/jobs/P2_J10_extract_micrographs_m_rlnImageSizeulti .
I followed the āRelion project setupā instruction in the āofficial documentationā to set up the correct relion project folder structure: https://github.com/asarnow/pyem/wiki/Export-from-cryoSPARC-v2
The produced star file is now in the main relionprj folder
The symbolic lincs to the mrc files are at relionprj/J10/extract/*.mrcs
Inside the star file I add the _rlnImageSize into the data_optics table, as discussed
I fire up the relion form the relionprj folder
I go to 2D_classification/IO/Input_image_STAR _file, and selece the star file form its real location (not form the .Node/3/ folder).
I hit the Run! button.
I get the error ERROR: Cannot read file >J10/extract/10910654411162275952_14sep05c_00024sq_00004hl_00002es.frames_patch_aligned_doseweighted_particles.mrcs It does not exist
At the location I started relion (~/relionprj/) it do: ls -l J10/extract/10910654411162275952_14sep05c_00024sq_00004hl_00002es.frames_patch_aligned_doseweighted_particles.mrcs
The file is there! xxd J10/extract/10910654411162275952_14sep05c_00024sq_00004hl_00002es.frames_patch_aligned_doseweighted_particles.mrcs
I can open the file with no problem!
I thought it migh be a unix right issue, so I followed the symbolic lincs. readlink -f J10/extract/10910654411162275952_14sep05c_00024sq_00004hl_00002es.frames_patch_aligned_doseweighted_particles.mrcs
I copied the real mrc file right there, renamed the extension to mrcs.
Made a chmod 777 on the file and later on, recursive on the whole J10 folder.
Nothing helped.
It is like region is not looking at the right place.
Looking at this file now, maybe I have to make a relion folder structure for J2 as well?
Could this cause the error?
Also, these doseweighted.mrc files are still mrc files, not mrcs files, because the sed command I used only replaced s/ particles.mrc/particle.mrcs/g.
Although the error message is clearly about the _particles.mrcs file.
This is the whole error message I get:
- Warning: the optics groups in P2_J10_particles_exported_relion31.star are not in the right order - renaming them now
in: /sw/relion/relion-3.1-src/src/image.h, line 272
ERROR:
Cannot read file >J10/extract/10910654411162275952_14sep05c_00024sq_00004hl_00002es.frames_patch_aligned_doseweighted_particles.mrcs It does not exist
=== Backtrace ===
/sw/relion/3.1/bin/relion_refine(_ZN11RelionErrorC1ERKSsS1_l+0x41) [0x529ce1]
/sw/relion/3.1/bin/relion_refine() [0x447056]
/sw/relion/3.1/bin/relion_refine(_ZN11MlOptimiser41calculateSumOfPowerSpectraAndAverageImageER13MultidimArrayIdEb+0x3c8) [0x478c08]
/sw/relion/3.1/bin/relion_refine(_ZN11MlOptimiser10initialiseEv+0x6be) [0x47fafe]
/sw/relion/3.1/bin/relion_refine(main+0x33) [0x430f83]
/lib64/libc.so.6(__libc_start_main+0xf3) [0x7fae7a3ba1a3]
/sw/relion/3.1/bin/relion_refine() [0x4343ff]
==================
ERROR:
Cannot read file >J10/extract/10910654411162275952_14sep05c_00024sq_00004hl_00002es.frames_patch_aligned_doseweighted_particles.mrcs It does not exist
Yes, nice that it works now. Thank you Oli for all your help!
Do you think this s/@>/@/g issue is caused by a bug in the latest csparc2star.py source code?
Would it make sense to file a bug report?
Iāve never seen that issue before - not sure whether it is from csparc2star or something weird about your input cs files, does this happen with every file you try to convert?
It has some specific cause, maybe caused by some pattern of symbolic links. In normal operation, the > isnāt prepended. I can lstrip(">") but Iād rather know what situation causes the > is prepended, because then there might be something more useful to do (like dereferencing).
Iāve also been trying to follow the āRelion project setupā instruction in the āofficial documentationā to set up the correct relion project folder structure:
but when I try to create the symbolic link I get the following error message:
ā/usr/bin/ln: Argument list too longā
As far as I understand the issue is that there are to many files to be linked (I tried to follow the same instruction with a smaller extract job and everything worked fine).