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
@@ -0,0 +1,76 @@
|
|
1
|
+
#!python
|
2
|
+
"""Estimate memory requirements for template matching jobs.
|
3
|
+
|
4
|
+
Copyright (c) 2023 European Molecular Biology Laboratory
|
5
|
+
|
6
|
+
Author: Valentin Maurer <valentin.maurer@embl-hamburg.de>
|
7
|
+
"""
|
8
|
+
import numpy as np
|
9
|
+
import argparse
|
10
|
+
from tme import Density
|
11
|
+
from tme.memory import estimate_memory_usage
|
12
|
+
from tme.matching_exhaustive import MATCHING_EXHAUSTIVE_REGISTER
|
13
|
+
|
14
|
+
|
15
|
+
def parse_args():
|
16
|
+
parser = argparse.ArgumentParser(
|
17
|
+
description="Estimate memory usage for template matching.",
|
18
|
+
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
19
|
+
)
|
20
|
+
parser.add_argument(
|
21
|
+
"-m",
|
22
|
+
"--target",
|
23
|
+
type=str,
|
24
|
+
required=True,
|
25
|
+
help="Path to a target in CCP4/MRC format.",
|
26
|
+
)
|
27
|
+
parser.add_argument(
|
28
|
+
"-i",
|
29
|
+
"--template",
|
30
|
+
type=str,
|
31
|
+
required=True,
|
32
|
+
help="Path to a template in PDB/MMCIF or CCP4/MRC format.",
|
33
|
+
)
|
34
|
+
parser.add_argument(
|
35
|
+
"-s",
|
36
|
+
"--score",
|
37
|
+
type=str,
|
38
|
+
default="FLCSphericalMask",
|
39
|
+
help="Template matching scoring function.",
|
40
|
+
choices=MATCHING_EXHAUSTIVE_REGISTER.keys(),
|
41
|
+
)
|
42
|
+
parser.add_argument(
|
43
|
+
"--ncores", type=int, help="Number of cores for parallelization.", required=True
|
44
|
+
)
|
45
|
+
parser.add_argument(
|
46
|
+
"--pad-edges",
|
47
|
+
action="store_true",
|
48
|
+
default=False,
|
49
|
+
help="Whether to pad the edges of the target. Useful if the target does not "
|
50
|
+
"a well-defined bounding box. Defaults to True if splitting is required.",
|
51
|
+
)
|
52
|
+
args = parser.parse_args()
|
53
|
+
return args
|
54
|
+
|
55
|
+
|
56
|
+
def main():
|
57
|
+
args = parse_args()
|
58
|
+
target = Density.from_file(args.target, use_memmap=True)
|
59
|
+
template = Density.from_file(args.template, use_memmap=True)
|
60
|
+
|
61
|
+
template_box = template.shape
|
62
|
+
if not args.pad_edges:
|
63
|
+
template_box = np.ones(len(template_box), dtype=int)
|
64
|
+
|
65
|
+
result = estimate_memory_usage(
|
66
|
+
shape1=target.shape,
|
67
|
+
shape2=template_box,
|
68
|
+
matching_method=args.score,
|
69
|
+
ncores=args.ncores,
|
70
|
+
analyzer_method="MaxScoreOverRotations",
|
71
|
+
)
|
72
|
+
print(result)
|
73
|
+
|
74
|
+
|
75
|
+
if __name__ == "__main__":
|
76
|
+
main()
|