turonova / cryoCAT

Contextual Analysis Tools for cryoET and subtomogram averaging
GNU General Public License v3.0
18 stars 2 forks source link

Question about Template and Mask for template matching #16

Closed elemeng closed 6 days ago

elemeng commented 6 days ago

Title: Clarification on Template Preparation for GAPSTOP_TM in cryoCAT

Hi there,

I’m working on template matching (TM) using cryoCAT with a template of the human 80S ribosome. Here’s what I’ve done so far:

  1. Downsampled the template to match my tomogram pixel size (8 Å).
  2. Inverted the contrast by multiplying by factor -1.

I have a few questions regarding further steps:

  1. Lowpass Filtering: Should I apply a lowpass filter to the template? After inverting contrast, it appears somewhat noisy.
  2. Mask Creation: Should the mask be based on the contrast-inverted map, or on the downsampled map before inversion? Alternatively, should I create the mask from the downsampled map, then invert the contrast afterward?
  3. Smoothing Mask Edges: To smooth the mask edges, is it appropriate to blur the mask? Is this similar to applying a soft edge (like in Relion_mask_create), or would a lowpass filter be better?

Thank you very much for your help!

Original map: image

Downsampled map: image

contrast-inverted map: image

turonova commented 6 days ago

To your questions:

1. Lowpass Filtering: Should I apply a lowpass filter to the template? After inverting contrast, it appears somewhat noisy.

The map looks noisy because you are looking into the inverse signal, thus noise. If you want to display the structure you have to go for threshold values below 0 in chimeraX. This will give you a box, you have to type "volume capFaces False" in the comman line there to remove the box and see the structure. It should look exactly as in the second image.

That being said - you still should use lowpass filter in TM as you most likely do not need that much detail in the map for TM to reliably find the particles. I would suggest to use something from the half to 3/4 of Fourier space. Note, that in GAPSTOP you need to set the low-pass filter in voxels, not Angstroms. For box size of e.g. 96, the Fourier space would go to 96/2 -> 48, so low-pass between half and 2/3 would be between values 24 to 36. You can also use functions in cryoCAT in cryomap module: resolution2pixels() and pixels2resolution() to compute the number of voxels based on desired resolution.

2. Mask Creation: Should the mask be based on the contrast-inverted map, or on the downsampled map before inversion? Alternatively, should I create the mask from the downsampled map, then invert the contrast afterward?

If you are familiar with relion_mask_create you can use it (that requires non-inverted map as input) - you can use your down-sampled template and create a mask from it. It will be in mrc format and you can directly use it as an input to GAPSTOP, no additional changes or conversion necessary.

cryoCAT offers similar functions for mask creation, including the tight-mask (see cryomask module for more). For that you can use even the inverted template, but the output should be similar to relion. The masks should be always between 0 and 1.

3. Smoothing Mask Edges: To smooth the mask edges, is it appropriate to blur the mask? Is this similar to applying a soft edge (like in Relion_mask_create), or would a lowpass filter be better?

Yes. The blurring is similar to softening the edges, although the values might differ. I suggest to play around a bit first and ensure the mask is as expected. The non-blurred part should always cover the main features one wants to template match, the blurring should happen on the outside of the particle.