Moving Forward#
Having worked through the examples, you are now ready to analyze your own data. This page summarizes the previous sections and lists further things to watch out for.
Summary#
match_template.py
facilitates template matching using various scoring metrics.
match_template.py --help
preprocess.py
enables template generation, masks can be created interactively using preprocessor_gui.py
or the API.
Scoring Functions#
Different scoring functions are optimized for specific mask geometries and data conditions. You can instruct match_template.py
to use a suitable scoring function from the table below using the --score
flag.
Score |
Best For |
Mask Type |
Speed |
Application |
---|---|---|---|---|
|
Ribosomes, virus particles, globular proteins |
Spherical/elliptical |
Fast |
Particle picking |
|
Membrane proteins, filaments, asymmetric structures |
Cylindrical, tube, custom shapes |
Medium |
Particle picking |
|
Quick screening |
None required |
Fast |
EM map fitting |
|
Edge-enhanced correlation, High S/N |
None required |
Fast |
EM map fitting |
|
General normalized correlation |
Spherical/elliptical |
Fast |
EM map fitting |
|
Partial volume matching |
Any (requires target mask) |
Slow |
EM map fitting |
Warning
Match your scoring function to your mask geometry to avoid artifacts.
Compute Backend#
Depending on available hardware and use case, there might be a more ideal compute backend for template matching. You can select the computational backend using --backend
in match_template.py
.
numpyfftw |
cupy |
pytorch |
jax |
|
---|---|---|---|---|
Hardware |
CPU |
GPU (CUDA) |
CPU/GPU |
CPU/GPU/TPU |
Performance |
Fastest CPU |
Good GPU allrounder |
Best for peak calling |
Fastest GPU (aggregation) |
Analyzer Support |
All |
All |
All |
MaxScoreOverRotations only |
When to Use |
CPU-only systems |
New users with NVIDIA GPU |
Peak calling workflows |
Maximum performance |