Before converting to STAR, put refined shifts in terms of blob apix #125
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR ensures that refined shifts are correct in STAR files created with
csparc2star.py
This discussion in our forum led to us noticing that
csparc2star.py
uses the image pixel size to convert shifts from pixels to angstroms. However, the shifts inalignment{2D,3D}/shift
are in terms of the pixels inalignment{2D/3D}/psize_A
, which may differ from the image pixel size if the job which refined these shifts performed on-the-fly downsampling. This results in shifts which are wrong by a factor of the ratio between the two pixel sizes.(the last 0.02 Å is from all the per-particle scales being reset to 1.0)
Since we don't care about the refinement pixel size in the final star file, I took what seemed the simplest route and just converted them immediately after loading the first
.cs
file. I tested this with an exported.cs
file and the passthrough.cs
file from the job itself. Since it looks likecryosparc_2_cs_model_parameters()
is never called on passthroughs I think this should always work...The change to
star.py
fixes a separate issue in which.star
files produced by csparc2star.py never had particle shifts becausesync_origins_from_angst()
didn't save the_rlnOrigin{X/Y}Angst
columns and the_rlnOrigin{X/Y}
columns were dropped as deprecated. The missing shifts then prevented CryoSPARC from importing the poses at all. Please do let me know if this isn't a bug and I missed a setting somewhere!Thanks, and please let me know if you have any more questions or if you need me to rework it some other way!