Hello all, I am having trouble linking micrographs that were motion-corrected using Relion to their source movies - already imported to CryosSparc. I am using CryoSPARC v5.0.7.
The job takes as input 10,566 micrographs (motion-corrected .mrc files) and 10,566 connected movies from an upstream Import Movies job, both confirmed correctly populated. To sanity-check the filename structure before trimming anything, I first ran the job with all four prefix/suffix parameters set to 0. As expected the job failed and produced the following log output:
“Example source (input) movie filename: 016139559791521557533_FoilHole_3117233_Data_3098164_5_20260704_072947_EER.eer
Example query (imported) micrograph filename: FoilHole_3117233_Data_3098164_5_20260704_072947_EER.mrc “
These two filenames clearly share an identical core string, FoilHole_3117233_Data_3098164_5_20260704_072947_EER, differing only by a 22-character hash-plus-underscore prefix on the movie side and the file extension (i.e., 4-character sufix) on both. Based on that, I’d expect the following parameters to produce a correct match:
Length of movie path prefix to cut : 22
Length of movie path suffix to cut : 4
Length of mic. path prefix to cut : 0
Length of mic. path suffix to cut : 4
However, when attemping a job with the parameters above, the job also fails and produces the following error message:
“Example source (input) movie filename:
Example query (imported) micrograph filename: Foil
Traceback (most recent call last):
File “cli/run.py”, line 106, in cli.run.run_job
File “cli/run.py”, line 211, in cli.run.run_job_function
File “/pathto/cryosparc_worker/compute/jobs/imports/run_import_micrographs.py”, line 72, in run_import_micrographs
assert qname in inv_index_source, (
^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Could not find match for Foil. If the source/query filepaths do not match in structure, try re-importing after adjusting the movie correspondence prefix/suffix parameters.”
I then tried a second combination with smaller values — movie prefix/suffix of 11/2 and mic prefix/suffix of 0/2 — and got an analogous result, with the movie filename truncated to Fo.
Putting the two failing tests side by side, a clear pattern emerges: the resulting micrograph query string is always exactly as long as the “suffix to cut” value I entered, and it consists of the first N characters of the filename rather than the filename with the last N characters removed. In other words, it looks like the suffix parameter is being applied as “keep only the first N characters” instead of “cut N characters from the end.” Separately, and I haven’t been able to explain this part, the source (movie) filename example prints as completely blank in both of these tests rather than showing a truncated movie filename — possibly a related issue, possibly separate. To verify the path to the movie files is correct, I have ran a second Import Movies (alone) and it ran succesfully. I can also verify that the CS-folder containing my CryoSPARC-imported movies is visible and not empty.
Would anyone have any idea of what I am doing wrong? Or is this a bug?
Thanks in advance,
Marcelo