pytme 0.2.9.post1__cp311-cp311-macosx_15_0_arm64.whl → 0.3b0.post1__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.3b0.post1.data/scripts/estimate_memory_usage.py +76 -0
- pytme-0.3b0.post1.data/scripts/match_template.py +1098 -0
- {pytme-0.2.9.post1.data → pytme-0.3b0.post1.data}/scripts/postprocess.py +318 -189
- {pytme-0.2.9.post1.data → pytme-0.3b0.post1.data}/scripts/preprocess.py +21 -31
- {pytme-0.2.9.post1.data → pytme-0.3b0.post1.data}/scripts/preprocessor_gui.py +12 -12
- pytme-0.3b0.post1.data/scripts/pytme_runner.py +769 -0
- {pytme-0.2.9.post1.dist-info → pytme-0.3b0.post1.dist-info}/METADATA +21 -20
- pytme-0.3b0.post1.dist-info/RECORD +126 -0
- {pytme-0.2.9.post1.dist-info → pytme-0.3b0.post1.dist-info}/entry_points.txt +2 -1
- pytme-0.3b0.post1.dist-info/licenses/LICENSE +339 -0
- scripts/estimate_memory_usage.py +76 -0
- scripts/eval.py +93 -0
- scripts/extract_candidates.py +224 -0
- scripts/match_template.py +341 -378
- pytme-0.2.9.post1.data/scripts/match_template.py → scripts/match_template_filters.py +213 -148
- scripts/postprocess.py +318 -189
- scripts/preprocess.py +21 -31
- scripts/preprocessor_gui.py +12 -12
- scripts/pytme_runner.py +769 -0
- scripts/refine_matches.py +625 -0
- tests/preprocessing/test_frequency_filters.py +28 -14
- tests/test_analyzer.py +41 -36
- tests/test_backends.py +1 -0
- tests/test_matching_cli.py +109 -54
- tests/test_matching_data.py +5 -5
- tests/test_matching_exhaustive.py +1 -2
- tests/test_matching_optimization.py +4 -9
- tests/test_matching_utils.py +1 -1
- tests/test_orientations.py +0 -1
- tme/__version__.py +1 -1
- tme/analyzer/__init__.py +2 -0
- tme/analyzer/_utils.py +26 -21
- tme/analyzer/aggregation.py +395 -222
- tme/analyzer/base.py +127 -0
- tme/analyzer/peaks.py +189 -204
- tme/analyzer/proxy.py +123 -0
- tme/backends/__init__.py +4 -3
- tme/backends/_cupy_utils.py +25 -24
- tme/backends/_jax_utils.py +20 -18
- tme/backends/cupy_backend.py +13 -26
- tme/backends/jax_backend.py +24 -23
- tme/backends/matching_backend.py +4 -3
- tme/backends/mlx_backend.py +4 -3
- tme/backends/npfftw_backend.py +34 -30
- tme/backends/pytorch_backend.py +18 -4
- tme/cli.py +126 -0
- tme/density.py +9 -7
- tme/filters/__init__.py +3 -3
- tme/filters/_utils.py +36 -10
- tme/filters/bandpass.py +229 -188
- tme/filters/compose.py +5 -4
- tme/filters/ctf.py +516 -254
- tme/filters/reconstruction.py +91 -32
- tme/filters/wedge.py +196 -135
- tme/filters/whitening.py +37 -42
- tme/matching_data.py +28 -39
- tme/matching_exhaustive.py +31 -27
- tme/matching_optimization.py +5 -4
- tme/matching_scores.py +25 -15
- tme/matching_utils.py +54 -9
- tme/memory.py +4 -3
- tme/orientations.py +22 -9
- tme/parser.py +114 -33
- tme/preprocessor.py +6 -5
- tme/rotations.py +10 -7
- tme/structure.py +4 -3
- pytme-0.2.9.post1.data/scripts/estimate_ram_usage.py +0 -97
- pytme-0.2.9.post1.dist-info/RECORD +0 -119
- pytme-0.2.9.post1.dist-info/licenses/LICENSE +0 -153
- scripts/estimate_ram_usage.py +0 -97
- tests/data/Maps/.DS_Store +0 -0
- tests/data/Structures/.DS_Store +0 -0
- {pytme-0.2.9.post1.dist-info → pytme-0.3b0.post1.dist-info}/WHEEL +0 -0
- {pytme-0.2.9.post1.dist-info → pytme-0.3b0.post1.dist-info}/top_level.txt +0 -0
tests/test_matching_utils.py
CHANGED
@@ -139,7 +139,7 @@ class TestMatchingUtils:
|
|
139
139
|
expected_size = np.subtract(
|
140
140
|
self.density.shape, self.structure_density.shape
|
141
141
|
)
|
142
|
-
expected_size +=
|
142
|
+
expected_size += 1
|
143
143
|
assert np.allclose(ret.shape, expected_size)
|
144
144
|
|
145
145
|
def test_apply_convolution_mode_error(self):
|
tests/test_orientations.py
CHANGED
@@ -50,7 +50,6 @@ class TestDensity:
|
|
50
50
|
assert np.issubdtype(orientations.translations.dtype, np.floating)
|
51
51
|
assert np.issubdtype(orientations.rotations.dtype, np.floating)
|
52
52
|
assert np.issubdtype(orientations.scores.dtype, np.floating)
|
53
|
-
assert np.issubdtype(orientations.details.dtype, np.floating)
|
54
53
|
|
55
54
|
def test_initialization_error(self):
|
56
55
|
with pytest.raises(ValueError):
|
tme/__version__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.
|
1
|
+
__version__ = "0.3.b0.post1"
|
tme/analyzer/__init__.py
CHANGED
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
|
@@ -46,10 +47,7 @@ def _convmode_to_shape(
|
|
46
47
|
if convolution_mode == "same":
|
47
48
|
output_shape = targetshape
|
48
49
|
elif convolution_mode == "valid":
|
49
|
-
output_shape = be.
|
50
|
-
be.subtract(targetshape, templateshape),
|
51
|
-
be.mod(templateshape, 2),
|
52
|
-
)
|
50
|
+
output_shape = be.subtract(targetshape, templateshape) + 1
|
53
51
|
return be.to_backend_array(output_shape)
|
54
52
|
|
55
53
|
|
@@ -161,26 +159,33 @@ def score_to_cart(
|
|
161
159
|
targetshape = be.to_backend_array(targetshape)
|
162
160
|
templateshape = be.to_backend_array(templateshape)
|
163
161
|
|
162
|
+
valid_positions = be.ones((positions.shape[0],)) == 1
|
163
|
+
|
164
164
|
# Wrap peaks around score space
|
165
165
|
if fourier_shift is not None:
|
166
166
|
fourier_shift = be.to_backend_array(fourier_shift)
|
167
167
|
positions = be.add(positions, fourier_shift)
|
168
168
|
positions = be.mod(positions, fast_shape)
|
169
169
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
be.
|
178
|
-
|
179
|
-
|
180
|
-
|
170
|
+
if convolution_mode is not None:
|
171
|
+
output_shape = _convmode_to_shape(
|
172
|
+
convolution_mode=convolution_mode,
|
173
|
+
targetshape=targetshape,
|
174
|
+
templateshape=templateshape,
|
175
|
+
convolution_shape=convolution_shape,
|
176
|
+
)
|
177
|
+
starts = be.astype(
|
178
|
+
be.divide(be.subtract(convolution_shape, output_shape), 2),
|
179
|
+
be._int_dtype,
|
180
|
+
)
|
181
|
+
stops = be.add(starts, output_shape)
|
181
182
|
|
182
|
-
|
183
|
-
|
184
|
-
|
183
|
+
valid_positions = be.multiply(positions >= starts, positions < stops)
|
184
|
+
valid_positions = be.sum(valid_positions, axis=1) == positions.shape[1]
|
185
|
+
positions = be.subtract(positions, starts)
|
185
186
|
|
187
|
+
# Get rid of -1 position peaks used to keep GPU happy
|
188
|
+
valid_positions = be.multiply(
|
189
|
+
be.sum(positions >= 0, axis=1) == positions.shape[1], valid_positions
|
190
|
+
)
|
186
191
|
return positions, valid_positions
|