Importing Simulated Particles

Hello everyone,

I have a set of simulated particles that I would like to import into CryoSPARC. The particles are in .mrc format, and I learned that I need a .star file to make this possible. Here are the steps I have taken:

  1. Imported all particles as micrographs.
  2. Created a custom .star file using cryosparc-tools.
  3. Used the Import Particles job in CryoSPARC.

I have managed to come a long way, but I am stuck at a point. For some reason, I keep getting this error:

Traceback (most recent call last):
  File "cryosparc_master/cryosparc_compute/run.py", line 115, in cryosparc_master.cryosparc_compute.run.main
  File "/em_data/localuser/cryoSPARC/cryosparc_worker/cryosparc_compute/jobs/imports/run.py", line 535, in run_import_particles
    fig = plotutil.plot_images_simple(dispparts, rows=4, cols=8, radwn=6, figscale=1.5)
  File "/em_data/localuser/cryoSPARC/cryosparc_worker/cryosparc_compute/plotutil.py", line 860, in plot_images_simple
    rD = img.get_original_real_data()
  File "/em_data/localuser/cryoSPARC/cryosparc_worker/cryosparc_compute/particles.py", line 34, in get_original_real_data
    data = self.blob.view()
  File "/em_data/localuser/cryoSPARC/cryosparc_worker/cryosparc_compute/blobio/mrc.py", line 145, in view
    return self.get()
  File "/em_data/localuser/cryoSPARC/cryosparc_worker/cryosparc_compute/blobio/mrc.py", line 140, in get
    _, data, total_time = prefetch.synchronous_native_read(self.fname, idx_start = self.page, idx_limit = self.page+1)
  File "cryosparc_master/cryosparc_compute/blobio/prefetch.py", line 82, in cryosparc_master.cryosparc_compute.blobio.prefetch.synchronous_native_read
OSError: 

IO request details:
Error ocurred (Invalid argument) at line 680 in mrc_readmic (1) 

The requested frame/particle cannot be accessed. The file may be corrupt, or there may be a mismatch between the file and its associated metadata (i.e. cryosparc .cs file).

filename:    /em_data/berk/cryoSPARC_Projects/CS-simulation-berk-01/J80/imported/007551211375608392020_particle1257_vacuum_finiteDose.mrc
filetype:    0
header_only: 0
idx_start:   285
idx_limit:   286
eer_upsampfactor: 2
eer_numfractions: 40
num_threads: 6
buffer:      (nil)
buffer_sz:   0
nx, ny, nz:  0 0 0
dtype:       0
total_time:  -1.000000
io_time:     0.000000

I created the .mrc files myself, and I am certain they don’t have any information regarding the eer_upsamplefactor or eer_numfractions. There is a mismatch, and I cannot really see why/how?

My .star file has the following format:

data_particles

loop_
_rlnImageName #1
_rlnMicrographName #2
_rlnCoordinateX #3
_rlnCoordinateY #4
01@particle0_vacuum_finiteDose.mrc      particle0_vacuum_finiteDose.mrc 124     124
02@particle1000_vacuum_finiteDose.mrc   particle1000_vacuum_finiteDose.mrc      124     124
03@particle1001_vacuum_finiteDose.mrc   particle1001_vacuum_finiteDose.mrc      124     124
04@particle1002_vacuum_finiteDose.mrc   particle1002_vacuum_finiteDose.mrc      124     124
...

I’m also attaching images of my job configuration.

Has anyone managed to import simulated micrographs as particles into CryoSPARC before? Any advice or insights would be greatly appreciated.

Best regards,
Berk


(I couldn’t share the second screenshot as new users are only allowed one image)

How were particles simulated? Do you have a record of all of the parameters for simulation? If so, it might be easier to generate the .star file with RELION (relion_star_datablock etc…) then load the particles as a particle stack directly.

Hey rbs_sci,

Thank you for the reply. I have a record of all the parameters for simulation.

I will give the RELION approach a try: Do you then suggest using RELION instead of cryoSPARC-tools for generation of the .star file?

Yes, but I’m more familiar with RELION than with cryosparc-tools. :wink: I presume the angles/defoci etc are in a .csv or some other text table? Then it’s easy to take different columns (as long as they’re in the same order as the particles in the stack) and generate from there.

It’s been a pretty long time since I simulated particles, though; I usually prefer to simulate micrographs, as it lets me check other things as well (and I like the level of control that TEMsimulator gives…)

1 Like

Thank you rbs_sci,

Following your suggestion, this time I did most of the work in RELION, such as picking and extracting particles, and it works pretty well. For the 3D reconstruction, I can import the particles.star file to cryoSPARC. This also works well.
And when I want to re-extract particles, re-center particles, or anything related to particles, it all fails in cryoSPARC. And the error I always get is:

Traceback (most recent call last):
  File "cryosparc_master/cryosparc_compute/run.py", line 115, in cryosparc_master.cryosparc_compute.run.main
  File "/em_data/localuser/cryoSPARC/cryosparc_worker/cryosparc_compute/jobs/extract/run.py", line 191, in run_extract_micrographs_cpu_parallel
    result = cpuextract.do_extract_particles_single_mic_cpu(mic, bg_bin,
  File "/em_data/localuser/cryoSPARC/cryosparc_worker/cryosparc_compute/jobs/extract/extraction_cpu_parallel.py", line 100, in do_extract_particles_single_mic_cpu
    mic_bin = mg.bin_mic(mic, bg_binfactor) # slow..
  File "/em_data/localuser/cryoSPARC/cryosparc_worker/cryosparc_compute/micrographs.py", line 534, in bin_mic
    clipx = (nx//binfactor)
ZeroDivisionError: integer division or modulo by zero

It seems preferable to use Relion for picking/extracting, and do the 3D reconstructions in cryoSPARC, for now.

Best,
Berk

1 Like

Seems like you’re on the right track - when doing extraction operations between RELION and CryoSPARC it sometimes takes a couple of tries to work out which parameters need tweaking for it to be optimal (or work, sometimes…)