Importing subtracted particles from Relion and re-export

Hi all,
I’m having some troubles with exporting subtracted particles to Relion. I started the initial processing in cryosparc and exported 3D aligned particles from cryosparc. Then I’ve done some more classification and subtraction in Relion and imported back to cryosparc. When I tried to re-export these particles to Relion after homogeneous refinement I found that the original micrograph path is disappeared in the star file as the following screenshots.

Before

After

What I want to do next is to revert particles back keeping the last alignment from cryosparc but since the last column is gone it didn’t work. Is there any way to put missing columns to the star file rather than using excel? (in pyem maybe?)

Thank you.

Best,
Junsun

Hi,

csparc2star.py script from Daniel Asarnow can add mics’ path back. You need to use the option “–micrograph-path” (If I remember correctly).

Best,
Pengxin

This option should work “–copy-micrograph-coordinates /path/particle.star”

Hi @Pengxin

Thank you for the advise! I tried the option “-micrograph-path” like this.
csparc2star.py input.cs passthrough.cs ouput.star --copy-micrograph-coordinates /the_original subtracted_particles_from_Relion.star
The script worked without any error but the output star file still have missing columns as follows (#15, 16, 17, 18, and #19)

Do I need an additional option to concatenate the last columns?

-Junsun

I also tried “particles extracted outside cryosparc” protocol in pyem github
but it only added another subtract path to the star file, not the original particle path.

Does anyone have a suggestion to solve this problem?

Junsun

Could you try this command: csparc2star.py input.cs ouput.star --copy-micrograph-coordinates /the_originalsubtracted_particles_from_Relion.star

I tried as what you suggested, but still the ouput.star is missing the last 5 columns… Pyem seems to work very well with other columns! I wonder whether others are also experiencing the same problem with this…

@Junsun you should link the micrographs when imported in cryoSPARC (there is an input are for exposures within the Import Particles job).

You can also usually get what you want using star.py and the --copy-X or --merge options (and maybe --by-original).

Thank you, @DanielAsarnow Your advise helped me a lot to understand what’s happening! I also found that my converted star file somehow does not have micrograph name, CoordinateX, Y values. Maybe this is the reason behind it.

I have some more questions. What happens if you link the micrographs when imported in cryoSPARC? When I linked the micrograph while importing and converted the cs file, the result star file was similiar to the previous one.

I also tried merge option like this.

star.py --merge-fields rlnImageOriginalName --merge-source ./JoinStar/job088/join_particles.star merge_test4.star(which is a converted star file from sparc) new_merged.star

The resulting star file had rlnImageOriginalName #2 column but the actual path was different from the source. It copied the ImageName column. I’m wondering why this is happening. Is it because the star file does not have information (the micrograph name, x, y coordinates) to match the particles?

new_merged.star (#2 is merged but the path is same with #1 not the source)

The source star (#19 has the original path J119/extract/~)

You need the micrograph names and coordinates, either from an original imported star file (--copy-micrograph-coordinates) or from a cryoSPARC passthrough file which had linked particle locations.

PS the matching order is defined in pyem.star.merge_key(), which is used whenever you don’t give explicit --merge-key on the command line. star.py also has --by-original.

Thank you @DanielAsarnow. Your comments were really helpful to use pyem. Now I have another question for pyem --copy-alignment option. When I tried to copy alignment information from another file, some particles were doubled in the ouput file.

000001@Subtract/job138/Particles/subtracted_rank1_opticsgroup1.mrcs 000007@J119/extract/10001673353554531893_Movie_04470_patch_aligned_doseweighted_particles.mrcs J97/motioncorrected/10001673353554531893_Movie_04470_patch_aligned_doseweighted.mrc 1841.000000 507.000000 -174.439529 101.509010 -148.483856 -1.019350 7.135450 19332.140625 18937.029297 11.943156 0.000000 0.000000 1 2 1 0.501647 121957.600000 1.000000 1
000001@Subtract/job138/Particles/subtracted_rank1_opticsgroup1.mrcs 000007@J119/extract/10001673353554531893_Movie_04470_patch_aligned_doseweighted_particles.mrcs J97/motioncorrected/10001673353554531893_Movie_04470_patch_aligned_doseweighted.mrc 1841.000000 507.000000 172.872055 93.967804 165.308762 -3.916450 4.452950 19332.140625 18937.029297 11.943156 0.000000 0.000000 1 2 1 0.501647 121957.600000 1.000000 1
000001@Subtract/job139/Particles/subtracted_rank1_opticsgroup1.mrcs 000009@J119/extract/10001673353554531893_Movie_04470_patch_aligned_doseweighted_particles.mrcs J97/motioncorrected/10001673353554531893_Movie_04470_patch_aligned_doseweighted.mrc 2307.000000 5062.000000 -174.439529 101.509010 -148.483856 -1.019350 7.135450 19339.582031 18944.470703 11.943156 0.000000 0.000000 1 2 1 0.478802 154967.700000 1.000000 1
000001@Subtract/job139/Particles/subtracted_rank1_opticsgroup1.mrcs 000009@J119/extract/10001673353554531893_Movie_04470_patch_aligned_doseweighted_particles.mrcs J97/motioncorrected/10001673353554531893_Movie_04470_patch_aligned_doseweighted.mrc 2307.000000 5062.000000 172.872055 93.967804 165.308762 -3.916450 4.452950 19339.582031 18944.470703 11.943156 0.000000 0.000000 1 2 1 0.478802 154967.700000 1.000000 1

The lists above are part of my star file.
So I manually checked the alignment values and found that the ouput 000001@Subtract/job138/Particles/subtracted_rank1_opticsgroup1.mrcs had values of both the original 000001@Subtract/job138/Particles/subtracted_rank1_opticsgroup1.mrcs and the 000001@Subtract/job139/Particles/subtracted_rank1_opticsgroup1.mrcs.
Could you explain why the job 138 takes values from 138 itself and job 139?