Bug #3547
openctffind4 hard to control defocus range
0%
Description
Ctffind4 seems unable to find the right defocus if it is far from the "nominal" defocus. I tried adding a large range (100 steps of 0.1 um) but this had is search a very small range.
From the log:
Starting image 1 ( skip:0, remain:50 ) id:294181, file: 15sep01d_02en-a
... Pixel size: 1.47
[CTF run] method: unknown | runname ctffind4run2
[CTF param] def1: 1.93e-06 | def2: 1.95e-06 | angle: 48.5 | ampcontr
0.07 | defratio 1.011
[CTF stats] conf_30-10: -0.07 | conf_5peak:
0.007 | res_0.8: 100.0A | res_0.5 100.0A
Defocus search range: 19276 A to 19296 A (1.93 to 1.93 um)
... running ctf estimation at Thu Sep 10 07:48:42 2015
input = 15sep01d_02en-a.mrc
output = 15sep01d_02en-a-pow.mrc
apix = 1.47
kv = 200.0
cs = 2.0
ampcontrast = 0.07
fieldsize = 1024
resmin = 50.0
resmax = 7.0
defmin = 19276.6
defmax = 19296.6
defstep = 1000.0
expect_astig = 500.0
phase = no
newline =
Files
Updated by William Rice about 9 years ago
sample sessions over carbon to check:
15sep01d - yACOB gOMEZ HOLDER TEST
15sep09k - test drift after OL flow adjustment and zeolite cycle
Updated by Anchi Cheng about 9 years ago
- Project changed from 138 to Appion
- Status changed from New to In Code Review
- Assignee set to Neil Voss
- Affected Version set to Appion/Leginon 3.2
Defocus input to ctffind4 is in angstroms. Fixed in r19140
Updated by William Rice about 9 years ago
Program seems to want defocus step in um. Entering 1000 as the step results in following error:
... Committing data to databaseTraceback (most recent call last):
File "/opt/myamisnap/bin/ctffind4.py", line 325, in
imgLoop = ctfEstimateLoop()
File "/opt/myamisnap/lib/appionlib/appionLoop2.py", line 27, in init
appionScript.AppionScript.__init__(self)
File "/opt/myamisnap/lib/appionlib/appionScript.py", line 83, in init
self.checkConflicts()
File "/opt/myamisnap/bin/ctffind4.py", line 63, in checkConflicts
apDisplay.printError("Please keep the defstep between 0.0001 & 2 microns")
File "/opt/myamisnap/lib/appionlib/apDisplay.py", line 65, in printError
raise Exception, colorString("\n * FATAL ERROR *\n"+text+"\n\a","red")
Exception:
- FATAL ERROR ***
Please keep the defstep between 0.0001 & 2 microns
Updated by Anchi Cheng about 9 years ago
Bill,
Sorry, I meant that in the code the gui value was supposed to convert to Angstrom before it calculates the range to input to ctffind4 program but the old code did not do that, which is why it gave tiny range when you put in the proper value in micron in gui.
The change will become live tomorrow.
Updated by William Rice about 9 years ago
Ctffind4 still seems to fail when actual defocus is far from nominal. It seems to convert properly from um to the expected A (see log below) but defocus it found is obviously wrong (see attached screenshot). Looking at the logs it seems to often have strange values for resmax (here 37A; should be 6 as entered) and expected astig (here 83.7; should be 300 as entered)
Defocus search range: 1000 A to 59408 A (0.10 to 5.94 um)
... running ctf estimation at Sun Sep 13 20:10:05 2015
input = 15sep09k_013sq_01hl_04en-a.mrc
output = 15sep09k_013sq_01hl_04en-a-pow.mrc
apix = 1.47
kv = 200.0
cs = 2.0
ampcontrast = 0.07
fieldsize = 1024
resmin = 50.0
resmax = 37.03
defmin = 1000.0
defmax = 59408.9
defstep = 1000.0
expect_astig = 83.7
phase = no
newline =
/usr/local/bin/ctffind4
15sep09k_013sq_01hl_04en-a.mrc
15sep09k_013sq_01hl_04en-a-pow.mrc
1.47
200.0
2.0
0.07
1024
50.0
37.03
1000.0
59408.9
1000.0
83.7
no
Updated by Neil Voss about 9 years ago
- Assignee changed from Neil Voss to Anchi Cheng
ResMax and astig are auto-assigned if using '*Use best values from Database*' is checked to help get a better fit. If you want only you value uncheck the box. For some reason the pop up help is not working the CTFFIND4 page, but it does specify as such on the CTFFIND3 page.
I forgot to include user resmax, so should be better now, so we should have a smarter resmax setting in r19149.
if ctfvalue is not None and self.params['bestdb'] is True: ### set res max from resolution_80_percent gmean = (ctfvalue['resolution_80_percent']*ctfvalue['resolution_50_percent']*self.params['resmin'])**(1/3.) if gmean < self.params['resmin']: # replace only if valid Issue #3291 self.params['resmax'] = round(gmean,2) apDisplay.printColor("Setting resmax to the geometric mean of resolution values", "purple")
Updated by Anchi Cheng about 9 years ago
- Assignee changed from Anchi Cheng to Neil Voss
The code change in ctfestimate.py probably has wrong indentation. gmean is not defined if self.params['bestdb'] is False. Therefore if gmean < self.params['resmin'] will crash the program.
Updated by Anchi Cheng about 9 years ago
Also, resmin is at very low resolution, so why replace resmax with a value that depends on it ?
Updated by Neil Voss about 9 years ago
- Assignee changed from Neil Voss to Anchi Cheng
Thanks for checking Anchi, should be better now.
Updated by Neil Voss over 8 years ago
- Related to Feature #3950: Create CTF test dataset within Docker added