Project

General

Profile

Actions

Bug #3422

closed

Fix magnification in Appion generated FREALIGN par file

Added by Melody Campbell over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Urgent
Category:
-
Target version:
Start date:
08/26/2015
Due date:
% Done:

0%

Estimated time:
Affected Version:
Appion/Leginon 2.2.0
Show in known bugs:
Workaround:

Description

The FREALIGN par file in appion i think is hardcoded to have a magnification of 10000. It should change based on the pixel size and the physical pixel size. To get the magnification, do: physical pixel size/pixel size * 10000.

So for Krios/K2 at scripps with a pixel size of 1.315, the mag is 5/1.315= 38022.

Physical pixel sizes for various detection devices:

K2: 5 µm
falcon ii: 14 µm
centra: 14 µm
Tietz: ? µm
US4000: 14 µm


Files


Related issues 2 (0 open2 closed)

Related to Leginon - Bug #3763: Camera physical pixel size for GatanK2 super-resolution mode is incorrectClosedAnchi Cheng11/12/2015

Actions
Related to Appion - Bug #4088: uploaded images failed frealign preparation due to lack of sensor pixel sizeClosedAnchi Cheng04/06/2016

Actions
Actions #1

Updated by Melody Campbell over 8 years ago

Hi Anchi,

dstep should be card 6. Attached is a screenshot from the first FREALIGN paper that has the first 7 cards.
please let me know what other info you need.

Actions #2

Updated by Anchi Cheng over 8 years ago

  • Assignee changed from Anchi Cheng to Melody Campbell

Melody,

Does magnification in param file changes with refinement iteration by film or by particle, or never, leaving relative mag the number to change in magnification refinement ?

Actions #3

Updated by Anchi Cheng over 8 years ago

  • Tracker changed from EMG General Issues Tracker to Bug
  • Project changed from 131 to Appion
  • Status changed from New to Assigned
  • Priority changed from Normal to Urgent
  • Affected Version set to Appion/Leginon 2.2.0

Melody,

Please answer my question. Thank you.

Actions #4

Updated by Anchi Cheng over 8 years ago

I committed the change to change the params file to use the camera length adjusted nominal mag. This means that if you have your own script to convert the old 10000 output with a multiplication of the sore, you should revert it to no change.

The run parameter change in appion refineJobFrealign.py still needs to be done. Since database connection is not assumed here, I will have to pass apix from php output.

Actions #5

Updated by Melody Campbell over 8 years ago

  • Assignee changed from Melody Campbell to Dmitry Lyumkis

Hi Anchi,

Sorry I must have missed this email in the chaos of the past few months.

I have never actually used the magnification refinement (FMAG) option in frealign, I've always had it as disabled (F). I believe that the refinement is done per-micrograph, and it will update the resulting .par files, however maybe Dmitry can chime in if he's actually used the FMAG option.

Since I don't use it, the magnification in the .par file remains the same through out the cycles.

However, I think this issue was just about generating the initial .par file which is usually then taken outside of Appion, so the magnification could just be calculated once as outlined in the initial issue.

Cheers,
Melody

Actions #6

Updated by Dmitry Lyumkis over 8 years ago

I'm not sure if mag refinement changes by Film or particle. I've used it a long time ago, and it made things worse. Niko seems to be of the same opinion, from what I recall. Technically speaking, Frealign should work fine if the 3 values (physical pixel size, pixel size, mag) are related to one another. So 10,000 might actually work, if you're pixel size is 1.31 and dstep=1.31. I don't know how it is coded, so unfortunately can't be of more help here.
Dmitry

Actions #7

Updated by Scott Stagg over 8 years ago

The method Dmitry described is what I always do.

Actions #8

Updated by Melody Campbell over 8 years ago

Is there an advantage to not just using the real dstep value? it seems like these short cuts could cause a lot of confusion in the future...? (e.g. when the previous wrapper for ctffind3 would automatically calculate the defocus search range so that if your appion-nominal defocus was off all the ctf estimations would fail)

just a thought

Actions #9

Updated by Scott Stagg over 8 years ago

The reason I always do it this way is that the apix and mag*physical pixel are the same number calculated two different ways. I always trust the Leginon derived apix the most because it is typically very well calibrated where the post column magnification is not, and we typically derive it from the apix calibration. My thinking goes that since the magnification is really just dependent on the apix, why not just make the dstep the same as the pixel size and the magnification 10000. That way it is easy to look at the values and know that there are no math errors and the two numbers are not in disagreement.

Actions #10

Updated by Scott Stagg over 8 years ago

I just realized I made a typo I meant physical pixel/mag

Actions #11

Updated by Dmitry Lyumkis over 8 years ago

note to my earlier post (from conversation with Yong Zi): FPART = FALSE means micrograph by micrograph, FPART = TRUE means particle by particle, so this might apply to mag refinement as well.

Actions #12

Updated by Anchi Cheng over 8 years ago

  • Status changed from Assigned to In Test
  • Assignee changed from Dmitry Lyumkis to Melody Campbell
  • Target version set to Appion/Leginon 3.2

While I agree with Scott and Dmitry, since I have finally made the change after all these years, Melody can have a piece of mind, too, now. My mag value is basic a back calculation from apix and camera physical pixel size (what dstep is if mag is the real mag on camera) in the database. Ironically, if someone needs to generate run parameter manually, they will now need to know and match camera physical size to that generated from Appion.

Melody, if you can test this to make sure my unit for dstep is right (micron), and the mag comes out in agreement with what you use, we can then close the issue.

Actions #13

Updated by Melody Campbell over 8 years ago

Hi Anchi,

When I prepare the par file for a krios/k2 dataset, the actual mag comes out to be: 76336. I think is is actually supposed to be about half that. Since it's in super resolution a dstep of 2.5, not 5 µm should be used.

Sorry for the delay,
Melody

Actions #14

Updated by Anchi Cheng over 8 years ago

Well, this proves that how useless camera physical pixel size is.

The value is determined in the instrument, hard coded in K2SuperResolution camera, and has been used for 3 years in ctfestimate.py (CTFfind3), and did not break a thing.... I am afraid to change it in 3.2 now because it might actually break something....

Actions #15

Updated by Anchi Cheng over 8 years ago

  • Related to Bug #3763: Camera physical pixel size for GatanK2 super-resolution mode is incorrect added
Actions #16

Updated by Anchi Cheng over 8 years ago

The reason that nothing breaks is because we always cancel its effect. Camera physical pixel size (ppix) is recorded in the Leginon database referenced by each image. It has never been used by itself in Appion. Because pixel size at the specimen (apix) is measured independently, xmag for CTFFind has always been defined as apix / ppix. CTFFIND would internally calculate apix = xmag * ppix.

Until now that we put xmag in a text file for everyone to see : )

Opened Issue #3763 and fixed it in pyscope. It will take effect when Leginon etc is updated on a camera computer. We will not go back to change any of the old data, though, so if you process old data, the old physical pixel size will stay there and therefore xmag would be wrong.

Melody, this can not be tested further unless you collect new data, as long as the ratio is exactly 2x of what you expect, this issue can be closed.

Actions #17

Updated by Anchi Cheng over 8 years ago

  • Status changed from In Test to Closed
Actions #18

Updated by Anchi Cheng about 8 years ago

  • Related to Bug #4088: uploaded images failed frealign preparation due to lack of sensor pixel size added
Actions

Also available in: Atom PDF