UW walk through¶
Session 1 - Pre-processing, segmentation, and denoising¶
For this session, we will use a subset of 26 tilt-series from the dataset Imm-ADA-Oct18-dataset.
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
Locationby clicking on the icon and browsing to /nfs/bartesaghilab2/data/KellyLee/Imm-ADA-Oct18-datasetType
Oct18-b4g1-TS-1*.tifinto the filter box (lower right) and click the icon. You should see 1048 matches.Click Choose File Pattern to add the path
On the Grouping tab:
Leave
No movie framesunchecked
On the Microscope parameters tab:
Set
Pixel size (A)to 0.6818Set
Acceleration voltage (kV)to 300Set
Tilt-axis angle (degrees)to 90
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-processingOn the Frame alignment tab:
Set
Alignment methodto motioncor3
On the Tilt-series alignment tab:
Set
Alignment methodto aretomo3Disable
Auto binningSet
Binning for tilt-series alignmentto 2Disable
Reshape tilt-images into squares
On the CTF determination tab:
Set
Max resolution (A)to 6Set
Min defocus (A)to 15000Set
Max defocus (A)to 70000
On the Tomogram reconstruction tab:
Set
Tomogram thickness (unbinned voxels)to 1536Set
2D filteringto noneEnable
Generate half-tomograms
On the Resources tab
Set
Split, Threadsto 11Set
Split, Bundle sizeto 13
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.
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 tomogramsSet
Pixel size rescalingto 11Enable
Deconvolution filter
Set
Pre-trained model (*.ckpt)to /nfs/bartesaghilab/membrain-seg-models/MemBrain_seg_v10_alpha.ckptSet
Filter connected componentsto by sizeSet
Size threshold (binned voxels)to 15000
Enable
Test time augmentationSet
Sliding window sizeto 96
Click Run. Follow the status of the run in the Jobs panel
Filtering tomograms¶
To speed up the next step, we will create a filtered dataset that only includes the fist 10 tomograms.
Create filter
Click inside the Pre-processing block and go to the Table view.
Create a new filter by providing a name and clicking Save.
Manually include or exclude individual tomograms using the Exclude column in the table.
Once you are satisfied with the results, click Save to store the filter settings.
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: Training
Click on
Tomograms(output of the Pre-processing block) and select Denoising (train)Select the filter we created in the previous step from the
Filter tomogramsdropdown menu.On the Tomogram denoising tab:
Set
Methodto isonet2Enable
Use maskingSet
Epochs for trainingto 30Set
Loss functionto HuberSet
CTF modeto “None”Set
B-factorto 200
Set
Epochs for trainingto 30Set
Loss functionto HuberSet
Missing wedge weight in lossto 200Set
B-factorto 200
Click Run. Follow the status of the run in the Jobs panel
Step 2: Evaluation
Click on
Tomograms(output of the Pre-processing block) and select Denoising (eval)On the Tomogram denoising tab:
Set
Methodto isonet2Set
Trained modelto isonet2/isonet_network_isonet2-n2n_unet-medium_96_full.pt (if you skipped the previous step, you can use the model /nfs/bartesaghilab2/data/KellyLee/Imm-ADA-Oct18-dataset/isonet_network_isonet2-n2n_unet-medium_96_full.pt)
Click Run. Follow the status of the run in the Jobs panel
Session 2: Molecular pattern mining¶
In this session, we will demonstrate how to use MiLoPYP-2, a new membrane-aware framework designed to facilitate particle picking from irregular and more challenging samples. The basic workflow is composed of two stages:
an exploration phase to identify particles of interest
a refinement phase to accurately pick all instances of the identified target
Part 1: MiLoPYP-2 exploration¶
In the exploration phase, we use the segmentations we calculated yesterday to automatically filter out the candidate particle locations that are too close or too distant to any surface. We also orient the patches so that they are normal to the surface, making all the spike proteins aligned.
We also use a feature called iterative exploration, which is one of the main strengths of this pipeline. Even after the initial filtering, it can still initially be difficult to cluster all the good patches we want since their numbers are usually quite low compared to bad patches. Luckily, it is usually much easier to cluster bad patches. We use this to our advantage by doing multiple iterations of exploration, where each iteration removes clusters with bad patches rather than trying to find clusters with only good patches.
Iteration 1
Click on
Tomograms(output of the Denoising (eval) block) and select MiLoPYP (train)On the Pattern Mining tab:
Set
Input typeto 3D onlySet
Epochsto 50Set
Bounding box (binned voxels)to 72Set
Interval to perform validationto 5Set
Gaussian filterto 0Set
DoG sizesto 2,5Set
DoG cutoff (std multiplier)to 2Set
DoG diameter (binned voxels)to 20Set
DoG boundary margin (binned voxels)to 0Enable
Surface constrainedSet
Segmentation directoryto the location of themrcfolder in the segmentation block. You can get the path to the segmentation block by clickingShow filesystem locationfrom the block menuSet
Use DoGto DoGSet
Min distanceto 5Set
Max distanceto 10
Enable
Save patches
Click Run
Click on
MiLoPYP model(output of the first MiLoPYP (train) block) and select MiLoPYP (eval)On the Pattern mining tab:
Set
Trained model (*.pth)to the location of the model you want to evaluate, for example,YYYYMMDD_HHMMSS/model_50.pthwhereYYYYMMDD_HHMMSSis the date and time of training.Set
Clustersto 30Set
Read patchesto the location of thetrain/3d_patch_info_train.npzfile in the first training block.
Click Run
Iteration 2
Click on
MiLoPYP particles(output of the first MiLoPYP (eval) block) and select MiLoPYP (train)On the Pattern mining tab:
Set
Epochsto 100Set
Bounding box (binned voxels)to 36Set
Interval to perform validationto 10Enable
Surface constrainedSet
Segmentation directoryto the location of themrcfolder in the segmentation block. You can get the path to the segmentation block by clickingShow filesystem locationfrom the block menuSet
Use DoGto DoGSet
Min distanceto 5Set
Max distanceto 10
Disable
Remove segmentationEnable
IterateSet
Patch coordinate locationto the location of thetrain/interactive_info_parquet.gzipfile in the first evaluation block.Set
Class labelsto a comma separated list of classes that contain spike proteinEnable
Save patchesClear
Read patches
Click Run
Click on
MiLoPYP Model(output of the second MiLoPYP (train) block) and select MiLoPYP (eval)On the Pattern mining tab:
Set
Trained model (*.pth)to the location of the model you want to evaluate, for example,YYYYMMDD_HHMMSS/model_10.pthSet
Clustersto 30Set
Read patchesto the location of thetrain/3d_patch_info_train.npzfile in the second training block.
We did 2 iterations for the exploration phase in this tutorial. However, the strategy can be changed depending on the preferred trade off between time and accuracy. In some cases, it may be necessary to change parameters such as min/max distance, DoG sizes, or DoG cutoff to start with more candidate locations.
Part 2: MiLoPYP-2 refinement¶
Refinement phase also uses the segmentations to constrain particle picking to surfaces. This is done by creating a binary mask based on the distance from the segmentation. This binary mask is then used to filter input and output coordinates, in the loss function, or to modify the input tomograms to directly remove any signal outside the mask.
Refinement
Step 1: Training
Click on
MiLoPYP particles(output of the last MiLoPYP (eval) block) and select Particle picking (train)On the Training/Evaluation tab:
Set
Coordinates for trainingto class labels from MiLoPYPSet
Class IDsto a comma separated list of classes that contain spike protein
Set
Epochsto 30Set
Max number of particlesto 600Set
Validation interval (epochs)to 1Set
Validation debug interval (epochs)to 5Enable
Use maskingSet
Segmentation directoryto the location of themrcfolder in the segmentation blockSet
Mask radiusto 10
Set
Patch size downscalingto 8
On the Resources tab:
Set
Split, Gresto gpu:4
Click Run
Step 2: Evaluation
Click on
Particles model(output of the Particle picking (train) block) and select Particle picking (eval)On the Training/Evaluation tab:
Set
Trained model (*.pth)to the location of the model you want to evaluate, for example,YYYYMMDD_HHMMSS/model_30.pthwhereYYYYMMDD_HHMMSSis the date and time of training.Set
Particle radius (A)to 80Set
Threshold for soft/hard positivesto 0.95Set
Initial particle orientation(s)to “from segmentation(s)”Set
Segmentation directoryto the location of themrcfolder in the segmentation block
On the Resources tab:
Clear
Split, Gres
Click Run
Click on
Particles model(output of the Particle picking (train) block) and select Particle picking (eval)On the Training/Evaluation tab:
Set
Trained model (*.pth)to “/nfs/bartesaghilab2/data/KellyLee/Imm-ADA-Oct18-dataset/model_50.pth”Set
Particle radius (A)to 80Set
Threshold for soft/hard positivesto 0.95Set
Initial particle orientation(s)to “from segmentation(s)”Set
Segmentation directoryto the location of themrcfolder in the segmentation block
On the Resources tab:
Clear
Split, Gres
Click Run
Session 3: Sub-tomogram averaging¶
Traditional sub-tomogram averaging is a powerful strategy for de novo structure determination that involves doing iterative 3D classification, alignment, and averaging of sub-tomograms. The results can be used as a starting point for high-resolution refinement using constrained single-particle tomography.
For this session, we will use the particles we obtained yesterday for the SARS-CoV-2 dataset.
Step 1: Sub-volume extraction
We first need to generate the sub-tomograms via the Particle picking (eval) block.
On the Training/Evaluation tab:
Set
Initial particle orientation(s)to from segmentations(s)Set
Path to segmentation(s)to the location of themrcfolder in the segmentation block
On the Particle extraction tab:
Set
Sub-volume export formatto 3davg (do not invert contrast)Set
Sub-tomogram size (voxels)to 64Set
Sub-tomogram binningto 4Disable
Use existing reconstruction settingsSet
2D filteringto noneSet
Radial filteringto fakeSIRT (mimic SIRT reconstruction)
Click Run.
After generating the sub-volumes, add the four STA blocks in order (each block is one mode; iteration numbers come from the parent block — you do not type them). See Sub-tomogram averaging.
Iteration 1
Click
Particleson Particle picking (eval) and choose STA centeringSet
Alignments from sub-volume averaging (*.txt)by navigating to thefrealigndirectory from the upstream block and selecting the file*_original_volumes.txtSet
Apply offset (binned voxels)to 10Set
Centering iterationsto 1Set
Translation tolerance (binned voxels)to 15Set
Mask radius (binned voxels)to 16,16,24Set
Mask apodization (binned voxels)to 0Set
Low-pass filter (cutoff, decay)to 0.2,0.05On the Resources tab
Set
Launch, Threadsto 128
Click Run.
Review results on View of the STA centering block.
Click
Particleson STA centering and choose STA classificationClick Run.
On View, include or exclude classes and pick the reference class.
Click
Particleson STA classification and choose STA refinementSelect
Center referenceif it appearsClick Run.
Review aligned class averages on View.
Click
Particleson STA refinement and choose STA alignmentClick Run.
Review the aligned reference on View.
Iterations 2–4
Add another STA classification after STA alignment to start the next round (classification → refinement → alignment). Repeat through iteration 4.
Iteration 2 classification: set
Mask radius (binned voxels)to 20,20,24Iteration 2 refinement: do not center the reference
Iteration 3 classification: set
Low-pass filter (cutoff, decay)to 0.25,0.05Iteration 4 refinement: set
C symmetry orderto 3
If everything went well, you should have a good low-resolution model of the spike.
Session 4: Constrained single-particle tomography (CSPT)¶
In this session, we will use 2D projections extracted from the the raw tilt-series to reconstruct and refine the structure to higher-resolution.
Constrained single-particle tomography (CSPT)¶
Step 1: Calculate reconstruction
Click on
Particles(output of the STA alignment block) and select Calculate reconstructionOn the Sample tab
Set
Molecular weight (kDa)to 500Set
Particle radius (A)to 90Set
Symmetryto C3
On the Extraction tab
Set
Box size (pixels/voxels)to 64Set
Image binningto 4
On the Alignments tab
From the
Import fromdropdown menu, select 3DAVG (.txt)*
Set
Input parameter file (*.bz2)to tomo-sva-gclK6N3haDRIsnzp_iteration_00?_alignments_to_reference_0.txtGo to the Resources tab
Set
Split, Threadsto 16
Click Run
Step 2: Particle translation and rotation refinement
Click on
Particles(output of the Calculate reconstruction block) and select 3D refinementOn the Particle scoring function tab
Set
Max resolution (A)to 16
On the Refinement tab
Set
Input parameter file (*.bz2)to the file _r01_02_clean.bz2 file in the parent blockCheck
Refine particle alignmentsSet
Particle rotation Phi range (degrees)to 0Set
Particle rotation Psi range (degrees)to 0Set
Particle rotation Theta range (degrees)to 0Set
Particle translation range (A)to 50Set
Optimizer exhaustive search pointsto 10000
Click Run
Step 3: Particle filtering
Click on
Particles(output of the 3D refinement block) and select Particle filteringOn the Particle filtering tab
Set
Input parameter file(*.bz2)to the*.bz2file that appears in the parent directorySet
Score thresholdto 5.0Set
Min distance between particles (unbinned pixels)to 54Enable
Permanently remove particles
Click Run
Step 4: Masking (optional)
Click on
Particles(output of the 3D refinement block) and select MaskingGo to the Masking tab
Set
Input map (*.mrc)as the file that you want to use as a reference for masking (for example, _r01_0?.mrc)Set
Threshold for binarizationto 0.5
Click Run
Step 5: Region-based refinement and tilt-geometry refinement (advanced)
Click on
Particles(output of the Particle filtering block) and select 3D refinementOn the Particle extraction tab
Set
Box size (pixels/voxels)to 256Set
Image binningto 1
On the Particle scoring function tab
Set
Last tilt for refinementto 8Set
Max resolution (A)to 14:13From the
Masking strategydropdown menu, selectfrom fileClick the icon to select the
Shape mask (*.mrc), browse to the desired mask file location, and click Choose File
On the Refinement tab
Set
Input parameter file (*.bz2)to the file _r01_02_clean.bz2 file in the parent blockSet
Last iterationto 3Check
Refine tilt-geometryCheck
Refine particle alignmentsSet
Number of regionsto 8,8,2
Click Run
Region-based refinement splits tomograms into patches and refines them independently¶
Step 6: Movie frame refinement (advanced)
Click on
Particles(output of the 3D refinement block) and select Movie refinementGo to the Particle scoring function tab
Set
Last tilt for refinementto 4Set
Max resolution (A)to 12
Go to the Frame refinement tab
Next to
Input parameter file (*.bz2)click the icon. Select the _r01_03.bz2 file and click Choose FileSet
Spatial sigmato 400Set
Time sigmato 16
Click Run
Refinement of individual tilt-frames¶
Step 7: Post-processing
Click on
Particles(output of any 3D refinement block) and select Post-processingGo to the Post-processing tab
Set
First half map (*_half1.mrc)to the file _half1.mrc in the parent blockUncheck
Estimate local resolution
Click Run