Exporting particles to Relion steps

Hi everyone,

I am using Csparc v4.4.0. I want to extract the particles from Csparc to Relion and build a new 2D class average. I have used the following command to convert the exported “cs” file to “star” file.

I have followed the following steps:

  1. mkdir -p J35/extract

  2. cd J35/extract

  3. ln -s /path/to/cryosparc/P01/J35/extract/*.mrc -t .

  4. *rename .mrc .mrcs .mrc

  5. python csparc2star.py --inverty /home/bioschool/phd/blz218474/scratch/FHV_46C/Micrograph/CS-fhv46/J35/extracted_particles.cs /home/bioschool/phd/blz218474/scratch/FHV_46C/Micrograph/CS-fhv46/J35/J35_passthrough_particles.cs from_csparc_J35.star

  6. sed -i ‘s/particles.mrc/particles.mrcs/g’ from_csparc_J35.star


A few lines from the star file
data_optics

loop_
_rlnVoltage #1
_rlnImagePixelSize #2
_rlnSphericalAberration #3
_rlnAmplitudeContrast #4
_rlnOpticsGroup #5
_rlnImageSize #6
_rlnImageDimensionality #7
_rlnOpticsGroupName #8
300.000000 1.380000 2.600000 0.100000 1 384 2 opticsGroup1

data_particles

loop_
_rlnImageName #1
_rlnMicrographName #2
_rlnCoordinateX #3
_rlnCoordinateY #4
_rlnDefocusU #5
_rlnDefocusV #6
_rlnDefocusAngle #7
_rlnPhaseShift #8
_rlnCtfBfactor #9
_rlnOpticsGroup #10
000001@J35/extract/000007318550799742358_FoilHole_5311948_Data_5312779_5312781_20240206_201149_fractions_patch_aligned_doseweighted_particles.mrcss J2/motioncorrected/000007318550799742358_FoilHole_5311948_Data_5312779_5312781_20240206_201149_fractions_patch_aligned_doseweighted.mrc 4165 1151 2790.947998 2529.266846 -41.203949 0.000000 0.000000 1
000002@J35/extract/000007318550799742358_FoilHole_5311948_Data_5312779_5312781_20240206_201149_fractions_patch_aligned_doseweighted_particles.mrcss J2/motioncorrected/000007318550799742358_FoilHole_5311948_Data_5312779_5312781_20240206_201149_fractions_patch_aligned_doseweighted.mrc 5065 370 2827.624023 2565.943115 -41.203949 0.000000 0.000000 1

However, I am confused about the following steps:

sed -i 's/J2/motioncorrected/MotionCorr/job003/Micrographs/g ’ from_csparc_J35.star

Do I have to create an empty directory MotionCorr/job003/Mirographs in my J35 directory? If I do that still the doseweighted.mrc files are not “mrscs”.

000001@J35/extract/000007318550799742358_FoilHole_5311948_Data_5312779_5312781_20240206_201149_fractions_patch_aligned_doseweighted_particles.mrcss MotionCorr/job003/Micrographs/000007318550799742358_FoilHole_5311948_Data_5312779_5312781_20240206_201149_fractions_patch_aligned_doseweighted.mrc 4165 1151 2790.947998 2529.266846 -41.203949 0.000000 0.000000 1

and it throws an error in Relion.
Cannot read file J35/extract/014441083777823066663_FoilHole_5308013_Data_5312763_5312765_20240207_010209_fractions_patch_aligned_doseweighted_particles.mrcs It does not exist

Could you please advise on the best way forward and point out any areas where I may be making mistakes?

Regards

Subhomoi

HI,

For use with relion, I believe the micrographs (_rlnMicrographsName) should be .mrc and particles (_rlnImageName) should be .mrcs. Perhaps you have a typo or two above and for some reason your particles are *particles.mrcss (with an extra s at the end). Use sed command to fix that.

However, I am confused about the following steps:
sed -i 's/J2/motioncorrected/MotionCorr/job003/Micrographs/g ’ from_csparc_J35.starDo I have to create an empty directory MotionCorr/job003/Mirographs in my J35 directory? If I do that still the doseweighted.mrc files are not “mrscs”.

You do not need to convert the cryosparc file naming system to relion naming system (J2/motioncorrected does not need to become MotionCorr/job003). When you run motioncor within relion it will generate a folder with that name, but that’s not related to what your are doing (and your step is still not needed). For relion to see micrographs the folder name does not need to use this relion writing convention.

You ned to make the folder J2/motioncorrected/*doseweighted.mrc within your relion directory for relion to see these microgrpahs (it looks where the starfile points) so it can extract particles from them. The listed directory for _rlnMicrographName needs to be accessible within your relion directory (not in your particles folder). You can use the same mechanism that you used to symlink J35 particles to symlink the micrographs into a new folder in the relion directory. It should be J2/motioncorrected/*aligned_doseweighted.mrc.

So the relion directory should contain:
/J35/extract/*particles.mrc
/J2/motioncorrected/*doseweighted.mrc

If I do that still the doseweighted.mrc files are not “mrscs”.

The particles should be .mrcs and micrographs should be .mrc

ln -s /path/to/cryosparc/P01/J35/extract/*.mrc -t .

I never used -t at the end. Once in the /relion/J35/extract/ path, my command would be (including the period at the end)
ln -s /path/to/cryosparc/P01/J35/extract/*.mrc .

and it throws an error in Relion.
Cannot read file J35/extract/014441083777823066663_FoilHole_5308013_Data_5312763_5312765_20240207_010209_fractions_patch_aligned_doseweighted_particles.mrcs It does not exist

Relion is looking in J35/extract for those specific *.mrcs files. This error indicates that path does not exist (either the J35/extract or the *.mrcs are wrong). Ensure you have made J35/extract and it contains the symbolic links to *particles.mrcs.

One last thing,

I want to extract the particles from Csparc to Relion and build a new 2D class average.

Use of the term “extract” is confusing here as extract is a specific job function that generates particles. You can extract particles using relion to write a new particle stack and you only need the star file with particle locations and the micrographs (as in J2/motioncorrected above).
If you want to run 2D classification on the exact particles that cryosparc generated, you will not run extract job. You make the J35/extract/*particles.mrcs accessible to relion, give the correct star file, and then run 2D classification.

You don’t actually need to the micrographs AND particles accessible to cryosparc for running new extract job (only needs micrographs) or 2D classification (only needs particles).

2 Likes

Hi,

Thank you for the detailed reply. I will work on your suggestion.