Plot the histogram of local resolution values of a cryo-EM reconstruction
Project description
localres
Plot the histogram of local resolution values of a cryo-EM reconstruction.
From a cryo-EM reconstruction, one can calculate local resolution and generate a
color-coded 3D map showing local resolution across the 3D reconstruction (or
within slices of it). This command-line tool complements this by allowing one to
quantitatively answer the question "how many map voxels inside the mask have a
given local resolution?". This tool generates a histogram of local resolution
values from a local resolution map and a mask (relion_locres.mrc
and
mask.mrc
files from RELION, respectively; cryosparc_*_map_locres.mrc
and
cryosparc_*_volume_mask_refine.mrc
from cryoSPARC, respectively).
FAQ
Q: Doesn't RELION already do this?
A: Yes, RELION-3.1 already prints out this histogram. This tool, however, doesn't require an installation of RELION, allowing one to inspect files quickly from a different computer. This tool also lets you adjust the number of bins in the histogram, and save the histogram as an SVG file (which is useful for adjusting styling to make a pretty figure).
Q: Doesn't cryoSPARC already do this?
A: Yes, cryoSPARC already prints out this histogram. This tool, however, doesn't require an installation of cryoSPARC, allowing one to inspect files quickly from a different computer. This tool also lets you adjust the number of bins in the histogram, and save the histogram as an SVG file (which is useful for adjusting styling to make a pretty figure).
Q: Will it work with MRC files produced by my favorite software (not RELION or cryoSPARC)?
A: If these MRC files have the same structure, then yes. But I don't know for sure, because this tool has only been tested with files produced by RELION and cryoSPARC.
Acknowledgments
I would not have been able to put this tool together without the
mrcfile
library.
I reused code suggested by @biochem_fan. My contribution was simply to package it into a command-line tool that's documented and easy to install.
Installation
I recommend to install this tool in a dedicated conda environment. You can
create one like so (replace ENV_NAME
with the name you want to give to this
environment):
$ conda deactivate
$ conda create --name ENV_NAME python=3.9
$ conda activate ENV_NAME
Once the conda environment is active, you can install the tool with the following command:
$ pip install localres
Usage
$ localres --help
Usage: localres [OPTIONS] <relion_locres.mrc> <mask.mrc>
Plot a histogram of local resolution values from a local resolution map
and a mask both produced by RELION.
For meaningful results, the mask.mrc file must be the one used for the 3D
refinement and post-processing jobs that produced the relion_locres.mrc
file.
Options:
-t, --title TEXT Title of the histogram (default: no title).
-b, --bins INTEGER Number of bins in the histogram (default: 100).
-o, --output TEXT File name to save the histogram (optional: with no file
name, simply display the histogram on screen without
saving it; recommended file formats: .png, .pdf, .svg or
any format supported by matplotlib).
-h, --help Show this message and exit.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file localres-1.7.tar.gz
.
File metadata
- Download URL: localres-1.7.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e6aa733124fc34014c61e096e07189e14cf9ce45efa2425b5c4b51411a72404 |
|
MD5 | 445c8fc4002e3cb5c1115c73986b770f |
|
BLAKE2b-256 | d522e792062604649b57571f0410ba4bf2f2d477ef0aae1c9ac844d592a314bf |
File details
Details for the file localres-1.7-py3-none-any.whl
.
File metadata
- Download URL: localres-1.7-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db28e249d32c8b2450d391c31083d103462bba42b44d10e215ec30e7f94016c9 |
|
MD5 | 3ae9ebf76b4aa0002d833ec523b4e27c |
|
BLAKE2b-256 | 215223348df57846a9b07d7853cb8ad816d318dd0804f78941fde8492ff3ff2f |