DHVI workshop (day 1)

On this session, we will import raw data from two datasets from the EMPIAR database:

Session 1 - Data import and pre-processing

For this session, we will use the HIV-1 dataset that was collected on a 300kV Titan Krios TEM using a Gatan K2 detector at 1.35A per pixel. Each tilt-series has 41 images recorded between -60 and 60 degrees with a spacing of 3 degrees. Each tilt image was collected as a sequence of 8-10 frames.

Step 1: Create a project

Data processing runs are organized into projects. We will create a new project for this tutorial:

  • Click on Create new project, give the project a name, and select Create

  • Select the new project from the Projects page and click Open

  • The newly created project will be empty and a Jobs panel will appear on the right

Step 2: Import raw tilt-series
  • Go to Import Data and select the Tomography tab, then Raw Data

  • On the Sources tab:

    • Set the Location of the raw data by clicking on the icon and browse to /nfs/bartesaghilab/nextpyp/workshop/10164/

    • Type *.tif into the filter box (lower right) and click the icon. You should see 123 matches.

    • Click Choose File Pattern to add the path

  • On the Grouping tab:

    • Leave No movie frames unchecked (this dataset has movie frames)

  • On the Microscope Parameters tab:

    • Set Pixel size (A) to 1.35

    • Set Acceleration voltage (kV) to 300

    • Set Tilt-axis angle (degrees) to 85.3

  • The block appears on the Graph immediately. Open Parameters (edits autosave). The block is in the modified state (indicated by the sign) and is ready to run

  • Click Run on the block status bar to launch the job

You can follow its progress from the Jobs tab of the Jobs/Run panel.

Once the job finishes, click on the image inside the block to see a larger version of the result.

Step 3: Pre-processing
  • Click on Tilt-series (output of the Tomography (from Raw Data) block) and select Pre-processing

  • On the Frame alignment tab:

    • Grouping was set on the import Grouping tab. Use unblur for Alignment method (the default).

  • On the Tilt-series alignment tab

    • Our Alignment method will be IMOD (fiducials) which is the default so make no changes.

  • On the CTF determination tab

    • Set Max resolution to 5

  • On the Tomogram reconstruction tab

    • Our Reconstruction method will be IMOD, this is the default so make no changes.

  • On the Resources tab

    • Set Split, Threads to 11

  • Click Run. Follow the status of the run in the Jobs panel

  • When the block finishes running, examine the Tilt-series, Plots, Table, and Gallery tabs inside the block.

Session 2 - Tomogram denoising and segmentation

For this session, we will use the SARS-CoV-2 dataset that was collected on a 300kV Titan Krios TEM using a Gatan K2 detector. Each tilt-series has 41 images recorded between -60 and 60 degrees with a spacing of 3 degrees. We won’t use movie frames in this case.

Import data and pre-processing

Step 1: Import raw tilt-series
  • Click Import Data and select the Tomography tab, then Raw Data

  • On the Sources tab:

    • Set the Location by clicking on the icon and browsing to /nfs/bartesaghilab/nextpyp/workshop_dhvi/10453/

    • Type *.mrc into the filter box (lower right) and click the icon. You should see 10 matches.

    • Click Choose File Pattern to add the path

  • On the Grouping tab:

    • Enable No movie frames (these are already single-image tilts)

  • On the Microscope parameters tab:

    • Set Pixel size (A) to 1.329

    • Set Acceleration voltage (kV) to 300

    • Set Tilt-axis angle (degrees) to 84.8

  • Click Run on the block status bar.

Step 2: Pre-processing
  • Click on Tilt-series (output of the Tomography (from Raw Data) block) and select Pre-processing

  • There is no Frame alignment tab because import enabled No movie frames.

  • On the Tilt-series alignment tab:

    • Disable Reshape tilt-images into squares

  • On the CTF determination tab:

    • Set Max resolution (A) to 5

  • On the Tomogram reconstruction tab:

    • Set Tomogram thickness (unbinned voxels) to 1536

    • Set 2D filtering to none

    • Enable Erase fiducials

    • Enable Generate half-tomograms

  • On the Resources tab

    • Set Split, Threads to 11

  • Click Run. Follow the status of the run in the Jobs panel

Tomogram segmentation

For segmenting tomograms, we will use a pre-trained MemBrain-Seg model that can be directly applied to tomograms produced by the pre-processing block. In addition, we will clean up the segmentation results using geometric criteria.

Step 3: Segmentation
  • Click on Tomograms (output of the Pre-processing block) and select Segmentation (pre-trained models)

  • On the Tomogram segmentation tab:

    • Enable Pre-process tomograms

      • Set Pixel size rescaling to 11

      • Enable Deconvolution filter

    • Set Pre-trained model (*.ckpt) to /nfs/bartesaghilab/membrain-seg-models/MemBrain_seg_v10_alpha.ckpt

    • Set Filter connected components to by number

      • Set Components to keep to 16

    • Set Thickness of slab to keep (unbinned voxels) to 1228

    • Enable Test time augmentation

    • Set Sliding window size to 96

  • On the Resources tab (make sure Show advanced options is enabled):

    • Set Split, Bundle size to 10

  • Click Run. Follow the status of the run in the Jobs panel

nextPYP can also use the TARDIS package for tomogram segmentation. The workflow is similar, with the exception that some of the parameters are different.

Tomogram denoising

For denoising tomograms, we will demonstrate the use of IsoNet2. Unlike segmentation models that can generalize well to different types of data, denoising models typically require re-training to achieve the best performance.

Step 1: Evaluation
  • Click on Tomograms (output of the Pre-processing block) and select Denoising (eval)

  • On the Tomogram denoising tab:

    • Set Method to isonet2

    • Set Trained model to /nfs/bartesaghilab/nextpyp/workshop_dhvi/10453/isonet_network_isonet2-n2n_unet-medium_96_full.pt

  • On the Resources tab:

    • Set Split, Bundle size to 10

  • Click Run. Follow the status of the run in the Jobs panel

Step 1: Training
  • Click on Tomograms (output of the Pre-processing block) and select Denoising (train)

  • On the Tomogram denoising tab:

    • Set Method to isonet2

    • Enable Use masking

      • Set Epochs for training to 30

      • Set Loss function to Huber

      • Set CTF mode to “None”

      • Set B-factor to 200

    • Set Epochs for training to 30

    • Set Loss function to Huber

    • Set Missing wedge weight in loss to 200

    • Set B-factor to 200

  • Click Run. Follow the status of the run in the Jobs panel

Step 2: Evaluation
  • Click on Denoising model (output of the Denoising (train) block) and select Denoising (eval)

  • On the Tomogram denoising tab:

    • Set Method to isonet2

    • Set Trained model to isonet2/isonet_network_isonet2-n2n_unet-medium_96_full.pt

  • On the Resources tab:

    • Set Split, Bundle size to 10

  • Click Run. Follow the status of the run in the Jobs panel

nextPYP also supports other denoising algorithms, including Topaz-Denoise, IsoNet, Noise2Map, and cryoCARE. The workflow for these algorithms follows a similar sequence of steps to the ones we saw here.

Day 1 summary

What we learned today
  • How to import raw tilt-series data into nextPYP

  • How to pre-process tilt-series (frame alignment, tilt-series alignment, tilted CTF estimation)

  • How to reconstruct tomograms (adjust thickness, erase fiducials, increase contrast)

  • How to segment tomograms using MemBrain-Seg

  • How to denoise tomograms using IsoNet2

On day 2 we will demonstrate the use of particle picking tools in nextPYP.