Using particle picks for local motion correction

Hi,

I hope my question is understandable.

I collected a data set and got back the patch aligned-dose weighted micrographs and raw movies. I have processed my data using the former. I would like to now try local motion correction on my final reconstruction to see if it improves the resolution.

I was wondering if there is any way of mapping my particles to the raw movies, if I have not performed the patch motion correction in the session (it was done using CryoSPARC Live in a different computer).

Thanks in advance.

@LTP You may be looking for the Reassign Particles to Micrographs job in the Utilities section.

Hi @wtempel, thanks a lot for your reply. That looks exactly like what I need.

However, I’ve tried to run it and have faced some problems.

I have the following situation.

My particles have been extracted from:
J46/imported/003154008477358034528_FoilHole_887202_Data_28395107_28395109_20220302_075513_EER_patch_aligned_doseweighted.mrc

The movies are:
J223/motioncorrected/005638605218936837203_FoilHole_28409659_Data_28395107_28395109_20220301_212526_EER_patch_aligned_doseweighted.mrc

Basically they should have the name, the only thing that changes is the path.

If I understand the job page, then I don’t need to remove any character. If I do this (put every option to 0), I get this:

[CPU: 125.3 MB]  Loaded 14356 micrographs

[CPU: 147.5 MB]    Example source micrograph filename: 

[CPU: 147.5 MB]       FoilHole_1902945_Data_1899191_1899193_20220302_115640_EER_patch_aligned_doseweighted.mrc

[CPU: 147.5 MB]    Example query micrograph filename: 

[CPU: 147.5 MB]       FoilHole_1900515_Data_1899194_1899196_20220302_220217_EER_patch_aligned_doseweighted.mrc
[CPU: 151.6 MB]  Traceback (most recent call last):
  File "cryosparc_worker/cryosparc_compute/run.py", line 85, in cryosparc_compute.run.main
  File "/data/X/X/software/cryosparc/cryosparc_worker/cryosparc_compute/jobs/utilities/run_reassign_particles_mics.py", line 55, in run_reassign_particles_mics
    assert qname in inv_index_source, "Could not find match for %s" % qname
AssertionError: Could not find match for FoilHole_2968478_Data_2967430_2967432_20220303_173257_EER_patch_aligned_doseweighted.mrc

Does this means I’m missing a micrograph somewhere?

I’d note that this is the final subset of particles from a refinement in which two data sets (tilted and untilted) have been combined (so the particles are in two import jobs, but if I’m understanding correctly, it shouldn’t matter because they have the same syntax).

Thanks a lot for the help.

Sorry, if I leave blank I get that problem.

If I put zero in each field then I get an output but no “example source/query micrograph filename”.

But if I use that output for local motion correction, I get:

[CPU: 406.9 MB] Error occurred while processing J236/imported/006948176615505950630_FoilHole_1908795_Data_1899194_1899196_20220303_081345_EER.eer
Traceback (most recent call last):
File “/data/X/X/software/cryosparc/cryosparc_worker/cryosparc_compute/jobs/pipeline.py”, line 53, in exec
return self.process(item)
File “cryosparc_master/cryosparc_compute/jobs/motioncorrection/run_local.py”, line 221, in cryosparc_compute.jobs.motioncorrection.run_local.run_local_motion_correction_multi.motionworker.process
File “cryosparc_master/cryosparc_compute/jobs/motioncorrection/run_local.py”, line 233, in cryosparc_compute.jobs.motioncorrection.run_local.run_local_motion_correction_multi.motionworker.process
File “cryosparc_master/cryosparc_compute/jobs/motioncorrection/run_local.py”, line 234, in cryosparc_compute.jobs.motioncorrection.run_local.run_local_motion_correction_multi.motionworker.process
File “cryosparc_worker/cryosparc_compute/jobs/motioncorrection/motioncorrection.py”, line 202, in cryosparc_compute.jobs.motioncorrection.motioncorrection.motion_correction
File “cryosparc_worker/cryosparc_compute/jobs/motioncorrection/motioncorrection.py”, line 230, in cryosparc_compute.jobs.motioncorrection.motioncorrection.motion_correction
File “/X/X/X/software/cryosparc/cryosparc_worker/cryosparc_compute/skcuda_internal/fft.py”, line 134, in init
onembed, X, odist, self.fft_type, self.batch)
File “/X/X/X/software/cryosparc/cryosparc_worker/cryosparc_compute/skcuda_internal/cufft.py”, line 749, in cufftMakePlanMany
cufftCheckStatus(status)
File “/X/X/X/software/cryosparc/cryosparc_worker/cryosparc_compute/skcuda_internal/cufft.py”, line 124, in cufftCheckStatus
raise e
cryosparc_compute.skcuda_internal.cufft.cufftAllocFailed

Marking as incomplete and continuing…
[CPU: 239.3 MB] Traceback (most recent call last):
File “cryosparc_worker/cryosparc_compute/run.py”, line 85, in cryosparc_compute.run.main
File “cryosparc_master/cryosparc_compute/jobs/motioncorrection/run_local.py”, line 362, in cryosparc_compute.jobs.motioncorrection.run_local.run_local_motion_correction_multi
AssertionError: First exposure failed with exception: <cryosparc_compute.jobs.pipeline.PipelineExceptionResult object at 0x7fac08a85250>

So something is not working…

This log excerpt suggests

  1. The input particle descriptors and micrographs are correctly truncated for matching.
  2. The micrograph corresponding FoilHole_1900515_Data_1899194_1899196_20220302_220217_EER_patch_aligned_doseweighted.mrc is either missing, or the set of micrographs to which FoilHole_1900515_Data_1899194_1899196_20220302_220217_EER_patch_aligned_doseweighted.mrc belongs hasn’t been properly specified as an input.

The remainder of your problem description left me with the (incorrect?) impression that there currently is one set of particles that you wish to assign to (possibly two sets, one for each tilt angle) micrographs. But I realize that you wrote

So I may be missing something…
Please can you share the Inputs and Parameters tab of the job that produced this log, and a brief description of the job that produced each input?
P.S. I noticed the follow-up post,

but would like to ensure a successful Reassign Particles to Micrographs job initially.

Hi @wtempel, sorry for the late reply and thanks for your answer.

So basically the input is a particle set from a refinement. The particles used in the refinement are composed of two sets: one from a tilted dataset and one from an untilted data set. These were merged at the refinement step (so two particle files into one refinement). This is why I have two exposures as input for the reassign job.

This is the input and parameters tab from the job that gives the error:

If instead of leaving blank the fields I put “0”, then I don’t get the error, I get an output which doesn’t work when using it for local motion correction.

Hope this makes sense.

Thanks a lot for your help!

Maybe the micrograph isn’t missing, but “hiding somewhere”.
Please can you run these three single-line commands (with the correct <path-to-project-directory>) in a shell:

  1. find <path-to-project-directory> -name "*FoilHole_1902945_Data_1899191_1899193_20220302_115640*"
  2. find <path-to-project-directory> -name "*FoilHole_1900515_Data_1899194_1899196_20220302_220217*"
  3. find <path-to-project-directory> -name "*FoilHole_2968478_Data_2967430_2967432_20220303_173257*"

These commands should show us if some relevant files do exist, but have their names modified in an unexpected way.

Sorry, I don’t have much experience programming or related…how do I run these commands?

The commands would need to be executed inside a Linux shell, but I was too quick in assuming that you actually had “shell access” on the cryoSPARC computer. After all, much of the cryoSPARC functionality can be accessed through a web browser. In case you do have local or remote “terminal” access, here is one of many primers on the subject. Otherwise, maybe a colleague can help you run the commands and capture their output.
In any case, the commands I posted need to be modified to include your specific project directory. I can write down the actual commands if you let me know (via direct message, if you prefer) the “path” of your project directory. You can find the project directory under the Reassign job’s Overview tab. Push Show from top; the project directory can be derived from a line with Working in directory: near the top (sixth line?).

Thanks and sorry for the dumb questions. I ran the commands and it finds all of the micrographs.

A guess based on the search results you sent via direct message:
The micrograph corresponding to
FoilHole_2968478_Data_2967430_2967432_20220303_173257_EER_patch_aligned_doseweighted.mrc isn’t linked to either job J223 or J237. You may have to connect an additional set of exposures, or replace one of the existing connections.

Hi,

Thanks a lot for your help. I’ll look more carefully to see what is going on with that file.