pytme 0.2.9.post1__cp311-cp311-macosx_15_0_arm64.whl → 0.3b0__cp311-cp311-macosx_15_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pytme-0.2.9.post1.data/scripts/estimate_ram_usage.py → pytme-0.3b0.data/scripts/estimate_memory_usage.py +16 -33
- {pytme-0.2.9.post1.data → pytme-0.3b0.data}/scripts/match_template.py +224 -223
- {pytme-0.2.9.post1.data → pytme-0.3b0.data}/scripts/postprocess.py +283 -163
- {pytme-0.2.9.post1.data → pytme-0.3b0.data}/scripts/preprocess.py +11 -8
- {pytme-0.2.9.post1.data → pytme-0.3b0.data}/scripts/preprocessor_gui.py +10 -9
- {pytme-0.2.9.post1.dist-info → pytme-0.3b0.dist-info}/METADATA +10 -9
- {pytme-0.2.9.post1.dist-info → pytme-0.3b0.dist-info}/RECORD +61 -58
- {pytme-0.2.9.post1.dist-info → pytme-0.3b0.dist-info}/entry_points.txt +1 -1
- scripts/{estimate_ram_usage.py → estimate_memory_usage.py} +16 -33
- scripts/extract_candidates.py +224 -0
- scripts/match_template.py +224 -223
- scripts/postprocess.py +283 -163
- scripts/preprocess.py +11 -8
- scripts/preprocessor_gui.py +10 -9
- scripts/refine_matches.py +626 -0
- tests/preprocessing/test_frequency_filters.py +9 -4
- tests/test_analyzer.py +143 -138
- tests/test_matching_cli.py +85 -30
- tests/test_matching_exhaustive.py +1 -2
- tests/test_matching_optimization.py +4 -9
- tests/test_orientations.py +0 -1
- tme/__version__.py +1 -1
- tme/analyzer/__init__.py +2 -0
- tme/analyzer/_utils.py +25 -17
- tme/analyzer/aggregation.py +384 -220
- tme/analyzer/base.py +138 -0
- tme/analyzer/peaks.py +150 -91
- tme/analyzer/proxy.py +122 -0
- tme/backends/__init__.py +4 -3
- tme/backends/_cupy_utils.py +25 -24
- tme/backends/_jax_utils.py +4 -3
- tme/backends/cupy_backend.py +4 -13
- tme/backends/jax_backend.py +6 -8
- tme/backends/matching_backend.py +4 -3
- tme/backends/mlx_backend.py +4 -3
- tme/backends/npfftw_backend.py +7 -5
- tme/backends/pytorch_backend.py +14 -4
- tme/cli.py +126 -0
- tme/density.py +4 -3
- tme/filters/__init__.py +1 -1
- tme/filters/_utils.py +4 -3
- tme/filters/bandpass.py +6 -4
- tme/filters/compose.py +5 -4
- tme/filters/ctf.py +426 -214
- tme/filters/reconstruction.py +58 -28
- tme/filters/wedge.py +139 -61
- tme/filters/whitening.py +36 -36
- tme/matching_data.py +4 -3
- tme/matching_exhaustive.py +17 -16
- tme/matching_optimization.py +5 -4
- tme/matching_scores.py +4 -3
- tme/matching_utils.py +41 -3
- tme/memory.py +4 -3
- tme/orientations.py +9 -6
- tme/parser.py +5 -4
- tme/preprocessor.py +4 -3
- tme/rotations.py +10 -7
- tme/structure.py +4 -3
- tests/data/Maps/.DS_Store +0 -0
- tests/data/Structures/.DS_Store +0 -0
- {pytme-0.2.9.post1.dist-info → pytme-0.3b0.dist-info}/WHEEL +0 -0
- {pytme-0.2.9.post1.dist-info → pytme-0.3b0.dist-info}/licenses/LICENSE +0 -0
- {pytme-0.2.9.post1.dist-info → pytme-0.3b0.dist-info}/top_level.txt +0 -0
tme/analyzer/_utils.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
"""
|
1
|
+
"""
|
2
|
+
Analyzer utility functions.
|
2
3
|
|
3
|
-
|
4
|
+
Copyright (c) 2023-2025 European Molecular Biology Laboratory
|
4
5
|
|
5
|
-
|
6
|
+
Author: Valentin Maurer <valentin.maurer@embl-hamburg.de>
|
6
7
|
"""
|
7
8
|
|
8
9
|
from typing import Tuple
|
@@ -161,26 +162,33 @@ def score_to_cart(
|
|
161
162
|
targetshape = be.to_backend_array(targetshape)
|
162
163
|
templateshape = be.to_backend_array(templateshape)
|
163
164
|
|
165
|
+
valid_positions = be.ones((positions.shape[0],)) == 1
|
166
|
+
|
164
167
|
# Wrap peaks around score space
|
165
168
|
if fourier_shift is not None:
|
166
169
|
fourier_shift = be.to_backend_array(fourier_shift)
|
167
170
|
positions = be.add(positions, fourier_shift)
|
168
171
|
positions = be.mod(positions, fast_shape)
|
169
172
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
be.
|
178
|
-
|
179
|
-
|
180
|
-
|
173
|
+
if convolution_mode is not None:
|
174
|
+
output_shape = _convmode_to_shape(
|
175
|
+
convolution_mode=convolution_mode,
|
176
|
+
targetshape=targetshape,
|
177
|
+
templateshape=templateshape,
|
178
|
+
convolution_shape=convolution_shape,
|
179
|
+
)
|
180
|
+
starts = be.astype(
|
181
|
+
be.divide(be.subtract(convolution_shape, output_shape), 2),
|
182
|
+
be._int_dtype,
|
183
|
+
)
|
184
|
+
stops = be.add(starts, output_shape)
|
181
185
|
|
182
|
-
|
183
|
-
|
184
|
-
|
186
|
+
valid_positions = be.multiply(positions >= starts, positions < stops)
|
187
|
+
valid_positions = be.sum(valid_positions, axis=1) == positions.shape[1]
|
188
|
+
positions = be.subtract(positions, starts)
|
185
189
|
|
190
|
+
# Get rid of -1 position peaks used to keep GPU happy
|
191
|
+
valid_positions = be.multiply(
|
192
|
+
be.sum(positions >= 0, axis=1) == positions.shape[1], valid_positions
|
193
|
+
)
|
186
194
|
return positions, valid_positions
|