Table of Contents

Overview

ISAC (Iterative Stable Alignment and Clustering) is a 2D classification algorithm to sort cryo-EM particles into classes depicting the same view of a target protein. It is based around iterations of alternating equal size k-means clustering and repeated 2D alignment routines.

You can find the details of the ISAC algorithm in this paper. To cite ISAC, use the following: Yang, Z., Fang, J., Chittuluru, J., Asturias, F. J. and Penczek, P. A. (2012) Iterative stable alignment and clustering of 2D transmission electron microscope images. Structure 20, 237–247.

ISAC2 is an improved version of ISAC, and the default tool to produce 2D class averages in the SPHIRE (git) software package and the TranSPHIRE automated pipeline for processing cryo-EM data. ISAC2 is a CPU-only implementation that is usually run on a computer cluster.

GPU ISAC is designed to run ISAC2 on a single workstation by outsourcing its computationally expensive calculations to any available GPUs.

Beta version: The currently available version of GPU ISAC is a beta version. A significantly improved and significantly faster version is being tested right now and will be released shortly.

Download & Installation

  • CUDA required: The following installation instructions assume that CUDA is already installed on your system.
  • SPHIRE required: In order to use GPU ISAC, SPHIRE needs to be installed first and the following instructions assume that this is the case. You can find the SPHIRE download and installation instructions here.

Note: To confirm a working version of SPHIRE 1.3 (or later), use which sphire in your terminal. It should return to you the path to your SPHIRE installation.

Download

Installation

  1. Extract the archive to your chosen GPU ISAC installation folder.
  2. Open a terminal and navigate to your installation folder.
  3. Untar the archive:
    tar -xf GPU_ISAC_CHIMERA.tar
  4. Check CUDA path variables using:
    1. echo $PATH

      Confirm your PATH variable contains the path to your cuda/bin folder.

    2. echo $LD_LIBRARY_PATH

      Confirm your LD_LIBRARY_PATH variable contain the path to your cuda/lib64 folder.

    3. If the path variables do not contain these path variables, you can add them like so:
      export PATH=/path/to/cuda/bin:${PATH}
      export LD_LIBRARY_PATH=/path/to/cuda/lib64:${LD_LIBRARY_PATH}

      Where path/to/cuda/bin and path/to/cuda/lib64 need to be replaced with the real paths to the respective folders. If you do not know where to find them, by default they should be located in /usr/local/cuda.

  5. Compile the GPU ISAC C++/CUDA library:
    1. cd vChimera/cuda

      Note: This assumes you did not change directories after unpacking the .tar archive.

    2. nvcc gpu_aln_common.cu gpu_aln_noref.cu -o gpu_aln_pack.so -shared -Xcompiler -fPIC -lcufft -std=c++11
  6. Adjust sparx libraries to work with the C++/CUDA library we just compiled:
    1. cd ../eman2/sparx/libpy
    2. sed -i.bkp "s|/home/schoenf/work/code/cuISAC/cuda|$(realpath ../../../cuda)|g" applications.py
    3. sed -i.bkp2 's|statistics.sum_oe( data, "a", CTF, EMData(), myid=myid|statistics.sum_oe( data, "a", CTF, EMData()|g' applications.py
  7. Set the correct libraries and environment:
    1. cd ../bin

      Note: We are now in the /eman2/sparx/bin folder of your GPU ISAC installation folder.

    2. ln -rs ../libpy/* .

      Note: Don't forget the dot at the end!

    3. sed -i.bkp "s|/home/schoenf/applications/sphire/v1.1/envs/sphire_1.3/bin|$(dirname $(which sphire))|g" sxisac2_gpu.py
    4. sed -i.bkp2 "s/^\(.*options, args.*\)$/\1\n    os.environ['CUDA_VISIBLE_DEVICES'] = options.gpu_devices\n    options.gpu_devices = ','.join(map(str, range(len(options.gpu_devices.split(',')))))/g" sxisac2_gpu.py
  8. Bugfix for the Chimera beta:
    1. sed -i.bkp3 "s/output_text = \"\n/output_text = \"/g" sxisac2_gpu.py

Usage

An example call to use GPU ISAC looks as follows:

mpirun -np 6 /path/to/sxisac2_gpu.py bdb:path/to/stack out_dir --CTF -–radius=160 --target_radius=29 --target_nx=76 --img_per_grp=100 --minimum_grp_size=60 --thld_err=0.7 --center_method=0 --gpu_devices=0,1

More readable:

mpirun -np 6 /path/to/sxisac2_gpu.py
bdb:path/to/stack out_dir
--CTF 
-–radius=160
--target_radius=29
--target_nx=76
--img_per_grp=100
--minimum_grp_size=60
--thld_err=0.7
--center_method=0
--gpu_devices=0,1

[ ! ] - Mandatory parameters in the GPU ISAC call:

[?] - Optional parameters in the GPU ISAC call:

  • The full list of ISAC2 parameters can be found here.
  • Additional utilities that are helpful when using any version of ISAC can be found here.
  • More information about using ISAC for 2D classification can also be found in the ISAC chapter of the official SPHIRE tutorial (link to .pdf file).