Skip to content

lkinman/mask_particle_images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Generating masked particle images stacks

The code provided here multiplies a stack of mask projections against a particle stack to produce a masked particle stack. The mask projections can be generated using a mask and the project3d.py script implemented in cryoSRPNT.

Installing

The only non-standard dependency required for this script is mrcfile, which can be installed with pip:

pip install mrcfile

Using

First, generate the desired mask. As is standard practice, we recommend using a low pass filtered and dilated mask with soft edges when generating the mask projections. We usually do this by generating the mask in ChimeraX with molmap and resampling on the desired grid, then importing the resulting mask into cryoSPARC and using a Vol Tools job to apply a filter and a binarization threshold, followed by dilation and soft padding.

The mask can then be converted into a stack of mask projections, at projection angles corresponding to the particle image projection angles using cryoSRPNT, as shown below:

python project3d.py mask.mrc mask_projections.mrcs --in-pose pose.pkl --is-mask

Note the use of the is-mask flag. Note also that the particle projection angles are supplied by pose.pkl which should be a cryoDRGN-format pose file. This file can be readily generate from a .star or .cs refinement file using the parse_pose_csparc or parse_pose_star commands implemented in cryoDRGN.

Finally, use the script provided here to output the stack of masked particle images.

python mask_particles.py --mask_projections mask_projections.mrcs --particles job149.128.txt  --outfile output.mrcs

Note that --particles can be provided either as a single .mrcs file, or as a .txt file like the one generated by cryodrgn downsample when --chunk is supplied. In the latter case, the script will automatically handle index conversions across the chunked files. It is also possible to pass a --ind flag, analogous to the --ind flag in cryoDRGN that allows on-the-fly filtering of the input particle stack. In this case, only the particle stack (and not the mask projections) will be filtered.

The script will output a .mrcs with the provided name, as well as an image of the first mask projection image and the first masked particle image (named outfilename_masked_particle_0.png).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages