====== using cryoSPARC ====== ===== modify the particles.star file from Warp ===== The particles.star files generated by Warp during the on-the-fly processing link each particle to its tif movie. To import the particles in cryoSPARC and keep the link with the motion corrected micrographs, the star file must be edited. To edit the particles.star file in **vi** type: vi allparticles_BoxNet2Mask_*.star or vi goodparticles_BoxNet2Mask_*.star Change the location of movies to the motion corrected ones: : %s/ / average\/ Change the file type of the motion corrected micrographs: : %s/tif/mrc Save the changes and close **vi**: : wq! You can now import the particles in **cryoSPARC** using the **Import Particle Stack** job and parameters: * Micrograph data path: average/*.mrc * Particle meta path: goodparticles_BoxNet2Mask_*.star * Particle data path: particles/ * Check : Remove leading UID in input micrograph file name ---- ===== Reduce the size of a particle stack subset ===== To reduce the size of the space required on the SSD cache if you are working with a subset of the full extracted particles stack (after selecting a subset of particles with 2D classification job for example) * Run a Downsample Particles job on the subset (output of select 2D job in my previous example) without specifying any downsampling. The output can be used for further processing and will be smaller and thus faster to load on the scratch. Otherwise the full stask will be loaded in the scratch event thoush only part of it will be used. ---- ===== Generate a defect file for cryoSPARC ===== Gain/defect files coming from Glacios must be flipped along Y axis when imported in cryoSPARC. Gain file is by default named CountRef...mrc (with a pixel size of 1) Defect file is by default a text file When importing the movies you should give a defect map file as well as the gain reference file. Load IMOD module load imod (on cbi-... servers) setimod (on xtallo machines) You can make a defect map from the text file with 'clip defect' in IMOD 4.10.7 or higher: clip defect -D defects...txt fileWithFrames defects...mrc where the fileWithFrames is used only to set the size of the output and can be any file of the right X and Y size. If the defect text file is not recognized by cryoSPARC, the Gain file has to be modified to put a value of 0 on defective pixels (because any pixels that have a value of 0 in the gain reference file are treated as defects). In the Gain file, the defective pixels have a value of 1, so you need to subtract the defects...mrc file from the Gain...mrc file subimage Gain...mrc defects...mrc Gain_subimage...mrc The pixel size will messed-up and has to be fixed to get back to a value of 1 alterheader -fixpixel Gain_subimage...mrc Now the Gain_substracted...mrc file has a zero value for defective pixels instead of 1. Remark: the defect file generated by the Glacios now (2021-10-27) is a map mode 2 and has a pixel spacing of 0.9372, but the images have a pixel spacing of 0.901. It might be better to change the last command by alterheader -del 0.901,0.901,0.901 Gain_subimage...mrc subimage CountRef_9AR3_00001_Oct27_15.55.18_X+0Y+0-1.mrc defects_40S_ScVdelta_03939_Oct27_11.34.51.mrc CountRef_9AR3_00001_Oct27_15.55.18_X+0Y+0-1_subimage.mrc RO image file on unit 2 : defects_40S_ScVdelta_03939_Oct27_11.34.51.mrc Size= 13906 K Number of columns, rows, sections ..... 3838 3710 1 Map mode .............................. 2 (32-bit real) Start cols, rows, sects, grid x,y,z ... 0 0 0 3838 3710 1 Pixel spacing (Angstroms).............. 0.9372 0.9372 0.9372 Cell angles ........................... 90.000 90.000 90.000 Fast, medium, slow axes ............... X Y Z Origin on x,y,z ....................... 0.000 0.000 0.000 Minimum density ....................... 0.85517E-01 Maximum density ....................... 4.5518 Mean density .......................... 1.0010 tilt angles (original,current) ........ 0.0 0.0 0.0 0.0 0.0 0.0 Space group,# extra bytes,idtype,lens . 0 0 0 0 1 Titles : Digital Micrograph(TM), GMS v 3.32 Number of columns, rows, sections ..... 3838 3710 1 Map mode .............................. 0 (byte) Start cols, rows, sects, grid x,y,z ... 0 0 0 3838 3710 40 Pixel spacing (Angstroms).............. 0.9010 0.9010 0.9010 Cell angles ........................... 90.000 90.000 90.000 Fast, medium, slow axes ............... X Y Z Origin on x,y,z ....................... 0.000 0.000 0.000 Minimum density ....................... 0.0000 Maximum density ....................... 1.0000 Mean density .......................... 0.70932E-05 tilt angles (original,current) ........ 0.0 0.0 0.0 0.0 0.0 0.0 Space group,# extra bytes,idtype,lens . 0 0 0 0 4 Titles : SerialEMCCD: Dose frac. image, scaled by 1.00 r/f 0 CountRef_9AR3_00001_Oct27_15.55.18_X+0Y+0-1.dm4 defects_40S_ScVdelta_03939_Oct27_11.34.51.txt clip defectmap: Map of defective pixels in image 28-Oct-21 11:40:50 NEW image file on unit 3 : CountRef_9AR3_00001_Oct27_15.55.18_X+0Y+0-1_subimage.mrc Section Min Max Mean S.D. 0 0.0000 4.5518 1.0010 0.0327 alterheader -fixpixel CountRef_9AR3_00001_Oct27_15.55.18_X+0Y+0-1_subimage.mrc OLD image file on unit 2 : CountRef_9AR3_00001_Oct27_15.55.18_X+0Y+0-1_subimage.mrc Size= 55622 K Number of columns, rows, sections ..... 3838 3710 1 Map mode .............................. 2 (32-bit real) Start cols, rows, sects, grid x,y,z ... 0 0 0 3838 3710 1 Pixel spacing (Angstroms).............. 0.9372 0.9372 0.9372 Cell angles ........................... 90.000 90.000 90.000 Fast, medium, slow axes ............... X Y Z Origin on x,y,z ....................... 0.000 0.000 0.000 Minimum density ....................... 0.0000 Maximum density ....................... 4.5518 Mean density .......................... 1.0010 tilt angles (original,current) ........ 0.0 0.0 0.0 0.0 0.0 0.0 Space group,# extra bytes,idtype,lens . 0 0 0 0 2 Titles : Digital Micrograph(TM), GMS v 3.32 SUBIMAGE: Subtract section B from section A. 28-Oct-21 11:42:19 Changing sample and cell sizes to match image size, which will make pixel spacing be 1.0 1.0 1.0. RO image file on unit 3 : CountRef_9AR3_00001_Oct27_15.55.18_X+0Y+0-1_subimage.mrc Size= 55622 K Number of columns, rows, sections ..... 3838 3710 1 Map mode .............................. 2 (32-bit real) Start cols, rows, sects, grid x,y,z ... 0 0 0 3838 3710 1 Pixel spacing (Angstroms).............. 1.000 1.000 1.000 Cell angles ........................... 90.000 90.000 90.000 Fast, medium, slow axes ............... X Y Z Origin on x,y,z ....................... 0.000 0.000 0.000 Minimum density ....................... 0.0000 Maximum density ....................... 4.5518 Mean density .......................... 1.0010 tilt angles (original,current) ........ 0.0 0.0 0.0 0.0 0.0 0.0 Space group,# extra bytes,idtype,lens . 0 0 0 0 2 Titles : Digital Micrograph(TM), GMS v 3.32 SUBIMAGE: Subtract section B from section A. 28-Oct-21 11:42:19 alterheader -del 0.901,0.901,0.901 CountRef_9AR3_00001_Oct27_15.55.18_X+0Y+0-1_subimage.mrc OLD image file on unit 2 : CountRef_9AR3_00001_Oct27_15.55.18_X+0Y+0-1_subimage.mrc Size= 55622 K Number of columns, rows, sections ..... 3838 3710 1 Map mode .............................. 2 (32-bit real) Start cols, rows, sects, grid x,y,z ... 0 0 0 3838 3710 1 Pixel spacing (Angstroms).............. 1.000 1.000 1.000 Cell angles ........................... 90.000 90.000 90.000 Fast, medium, slow axes ............... X Y Z Origin on x,y,z ....................... 0.000 0.000 0.000 Minimum density ....................... 0.0000 Maximum density ....................... 4.5518 Mean density .......................... 1.0010 tilt angles (original,current) ........ 0.0 0.0 0.0 0.0 0.0 0.0 Space group,# extra bytes,idtype,lens . 0 0 0 0 2 Titles : Digital Micrograph(TM), GMS v 3.32 SUBIMAGE: Subtract section B from section A. 28-Oct-21 11:42:19 RO image file on unit 3 : CountRef_9AR3_00001_Oct27_15.55.18_X+0Y+0-1_subimage.mrc Size= 55622 K Number of columns, rows, sections ..... 3838 3710 1 Map mode .............................. 2 (32-bit real) Start cols, rows, sects, grid x,y,z ... 0 0 0 3838 3710 1 Pixel spacing (Angstroms).............. 0.9010 0.9010 0.9010 Cell angles ........................... 90.000 90.000 90.000 Fast, medium, slow axes ............... X Y Z Origin on x,y,z ....................... 0.000 0.000 0.000 Minimum density ....................... 0.0000 Maximum density ....................... 4.5518 Mean density .......................... 1.0010 tilt angles (original,current) ........ 0.0 0.0 0.0 0.0 0.0 0.0 Space group,# extra bytes,idtype,lens . 0 0 0 0 2 Titles : Digital Micrograph(TM), GMS v 3.32 SUBIMAGE: Subtract section B from section A. 28-Oct-21 11:42:19