Unrealistic inter-frame jumps in motion correction

Hi,

I was running the built-in motion correction on some lowish quality movies. In some of the jobs I got dramatic jumps in the middle of trajectories and the resulting images clearly had artifacts. There seems to be nowhere to put parameters to constrain the inter-frame jumps. It would be helpful to have some control over this.
Motioncorr2 seems to deal with the same movies fine. However I guess we won’t be able to do the per-particle motion correction if I have to use motioncorr2 outside the cryosparc2?

Zhijie

Hi Zhijie, do the resulting images look ‘doubled’? That is, two copies of the images averaged with a small shift between the images? Presume this is from F20 data. If so, we saw this effect previously with alignframes outside of cryoSPARC. It could be overcome by changing the highest resolution information used during alignment (I think we generally reduced it).

I’ve seen this effect with Motioncor2 as well…

In Motioncor2 I figured it was due to the low default B-factor, and asked Shawn to introduce a different, (default higher) B-factor for whole frame alignment (in 1.1.0), which seemed to help (and is more or less the same as what you’re saying re using less high res info in alignment)

Cheers
Oli

1 Like

Hi John and Oli,

Thanks for the suggestions. Yes the movies were from F20+K2 camera, and the resulting images of the failed ones look “doubled”.

I have tested with a few different “maximum alignment resolution” (1.45, 3, 4, 5, 8, 15, 30) and B factors (500 and 1000) in cryosparc2. Unfortunately the problem persists. So far the only thing that have greatly improved the success rate is to reduce the number of frames to align from 30 to 15.

(BTW, “Generally 500 to 100 is best.” -should be 1000? this is the pop-up help for the B-factor option)

I then went to the CPU version alignframe.f90 found on the Rubinstein lab website. This version works fine for the movies I have tested, generating shiftlists similar in values to what I got from motioncorr2 (an example is listed at bottom). I didn’t find a place to put a maximum resolution parameter to this version though. Changing the B factor in the script file did have some subtle effect (500 and 2000 A**2 tested).

I guess the alignframe program used in cryosparc2 is an up-to-date GPU version with more functionalities such as dose-weighing? One thing I noticed is that the whole movie reading-motion correction process in cryosparc2 seems to be faster than reading the movies with the alignframes.f90.

The following is an example of a failed movie alignment shiftlist found in the cryoSPARC2 xxxxx_traj.npy file (in this run I set the 0-shift frame to be 0, only to make the shiftlist easier to compare with other programs, normally I leave the 0-shift option unfilled):

==from cryosparc2==
0 0
2.37947949 -0.74008103
4.73263957 -1.24764039
7.08875403 -1.41714796
9.47938629 -1.31996544
11.85514392 -1.10036054
14.19050537 -0.8999441
16.60584937 -0.72024232
19.22228719 -0.49300218
21.96381873 -0.19455965
24.53046526 0.09584892
26.09585698 0.33220394
25.28927577 0.46556976
20.75378169 0.48093774
13.05406855 0.34892005 <<===the jump starts here
8.05993754 0.22808499
6.60184859 0.17721905
7.58787392 0.1688384
9.82121056 0.17357636
12.45751796 0.17686086
15.0399382 0.14129768
17.4771589 0.07574159
19.84094715 0.04760063
22.19727851 0.13190813
24.46905464 0.33358154
26.58944705 0.60946709
28.66350876 0.96044645
30.8591351 1.34641002
33.22672923 1.71155657
35.68609509 2.05897026

For comparison, the CPU version alignframes.f90 gives:
0 0
2.9707 -1.248759
5.286782 -2.250366
8.106437 -1.228737
9.710836 -2.166215
12.697242 -2.319349
13.88445 -0.538235
16.834305 -1.349111
20.089884 -1.822489
22.260424 0.576868
23.422894 -1.325688
27.032527 -0.575195
28.710932 -0.376273
32.132742 0.56778
33.582505 -0.653138
35.895446 -0.363994
38.16827 1.37736
41.735225 0.591563
42.82523 0.676228
45.425913 1.018245
46.707938 0.025247
50.069778 0.43708
52.474112 -0.532835
54.415645 0.180279
57.013249 1.582059
60.24235 0.509002
60.097591 -0.524601
63.751571 0.216506
66.173772 1.014442
68.536736 2.376934

, which is quite similar to the Motioncorr2 result:

0.000 0.000
-2.290 1.340
-4.540 1.980
-6.980 2.000
-9.530 1.770
-12.080 1.450
-14.150 1.360
-16.440 1.290
-18.840 1.140
-21.240 0.740
-23.590 0.390
-26.120 0.150
-28.590 -0.050
-30.950 -0.180
-33.460 -0.320
-35.720 -0.340
-38.070 -0.310
-40.230 -0.310
-42.590 -0.480
-44.980 -0.360
-47.160 -0.230
-49.380 -0.130
-51.720 -0.100
-54.320 -0.170
-56.580 -0.480
-58.800 -0.390
-60.550 -0.930
-62.910 -1.370
-65.260 -1.940
-68.230 -2.260

Zhijie

Hi @ZhijieLi,
Thanks for reporting this and the experiments you tried.
Would it be possible for you to share with us a dozen or so movies from this set that we can test internally? I’ll email you about this.
Thanks,
Ali