Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert zernike parameters #94

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

GenevieveBuckley
Copy link
Contributor

Continuing work from #87

I've done some testing with files from our lab, and it looks like there are some changes needed to make the output here march an equivalent output created in Relion.

Summarizing what I've found:

  1. For files processed in Relion, the Zernike coordinates are reported per optics group, not per particle. That could mean this commit may not be necessary. Additionally, the OddZernike and EvenZernike results are enclosed in square brackets in the .star file table.
  2. The values for BeamTiltX and BeamTiltY do not seem to match between the star file generated with pyem and a star file created with an equivalent process in Relion.
  3. The values for the OddZernike and EvenZernike parameters really do not match, and can differ by several orders of magnitude. This suggests to me that we should re-examine the conversion factors, and what units they are in.
  4. For the specific example file I used, the magnetic anisotropy values reported in the numpy cs data structure were all zeros. The Relion-processed version of this file reports non-zero magnetic anisotropy values. I wonder if a default value of zero was given here, and that could be the reason for the mismatch?

This PR was created from a straight copy of @asarnow's convert_zernike branch, which builds on top of #87. I haven't made any changes to my copy of branch just yet. I've opened the pull request like this so that both of us could make changes to the same branch (because I can't push to Daniel's convert_zernike branch but he can push to this one).

@GenevieveBuckley
Copy link
Contributor Author

GenevieveBuckley commented Nov 22, 2022

I've been given some example data I've been told I can share here. You can download the files from here.

They include:

  • The original CryoSPARC file: cryosparc_P19_J15_004_particles.cs
  • The equivalent file, where the processing was done in Relion: `particles_ctf_refine.star'
  • The output file from this convert_zernike branch in pyem: P19_J15_TEST.star

I generated the pyem .star file like this:

git checkout convert_zernike
conda activate pyem
python csparc2star.py cryosparc_P19_J15_004_particles.cs P19_J15_TEST.star 

@GenevieveBuckley
Copy link
Contributor Author

I've also been taking a look at the output of the first particle. It says that particle was from optics group 2, so I'm comparing those values to the ones from the optics group table in line 2.

I'm not expecting to see the values match exactly, but in some cases I see values that differ by several orders of magnitude which does indicate a problem.

_rlnBeamTiltX

  • Our value: 0.139732
  • Comparison value: -0.17211

_rlnBeamTiltY

  • 0.004448
  • -0.00737

_rlnOddZernike

  • Our values: -0.5242066, -0.0163615, -2046.5356, 10863.444, 345.8468, 446.96567
  • Comparison values: [0.0660126589623, -0.747051186802, 0.0765784837569, 0, 0, -0.491995657821]
  • Order: [Z_neg1_1, Z_1_1, Z_neg3_3, Z_neg1_3, Z_1_3, Z_3_3]

_rlnEvenZernike

  • Our values: -1.5191425, -60.817818, 23648.635, 199.8599, -42220.414, -60377.215, -13760387.0, -6899.2617, 6093.788
  • Comparison values: [-9.69149485623, 1.02735691862, -15.4058572474, 1.06613070624, 0.037328990874, 0.373459808777, -5.71798906572, 0.405861567659, -0.0347846377059]
  • Order: [Z_0_0, Z_neg2_2, Z_0_2, Z_2_2, Z_neg4_4, Z_neg2_4, Z_0_4, Z_2_4, Z_4_4]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants