Skip to content

Picker: AutoCryoPicker

Seb Seager edited this page Apr 15, 2023 · 4 revisions

Summary

AutoCryoPicker is built for MATLAB and is available as a GitHub repo. We ran it in MATLAB 2020b.

Installation

First, clone the AutoCryoPicker repo into pickers/autocryopicker/ using

git clone https://github.com/jianlin-cheng/AutoCryoPicker.git pickers/autocryopicker

As is, AutoCryoPicker produces detections for its own intensity-based clustering (IBC) approach, as well as for k-means and fuzzy c-means clustering algorithms (for comparison purposes). It also does not output particle centers, radii, or confidence metrics by default.

To apply our patch, replace the AutoPicker_Final_Demo.m file in the Signle Particle Detection_Demo [sic] directory with our version as follows:

sh patches/autocryopicker/patch_autocryopicker.sh pickers/autocryopicker/

Usage

Before running AutoCryoPicker, .mrc micrograph files must be converted to a .png format. Our script at scripts/mrc_to_img.py can be used for this.

We assume the MATLAB executable is available at the matlab command. Yale HPC users can use the following command to load MATLAB as a module.

module load MATLAB/2020b

Use the following to run AutoCryoPicker on micrograph files. We assume a patched version of AutoCryoPicker as described above.

# set to some output directory
out_dir=/path/to/out/dir/

# change path as necessary
for f in /full/path/to/pngs/*.png; do
    out_name=$(basename $f)
    label_file="${out_dir}/${out_name%.png}.box"
    matlab -nosplash -nodisplay -r "mrc='$f';out_dir='$out_dir';AutoPicker_Final_Demo" -logfile "$label_file"
    # removes headers prepended by MATLAB by looking for our magic string in the output
    awk '/AUTOCRYOPICKER_DETECTIONS_START/ ? c++ : c' ${label_file} > ${label_file/.box/.tmp} && mv ${label_file/.box/.tmp} ${label_file}
done
Clone this wiki locally