pytme 0.1.5__cp311-cp311-macosx_14_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.1.5.data/scripts/estimate_ram_usage.py +81 -0
- pytme-0.1.5.data/scripts/match_template.py +744 -0
- pytme-0.1.5.data/scripts/postprocess.py +279 -0
- pytme-0.1.5.data/scripts/preprocess.py +93 -0
- pytme-0.1.5.data/scripts/preprocessor_gui.py +729 -0
- pytme-0.1.5.dist-info/LICENSE +153 -0
- pytme-0.1.5.dist-info/METADATA +69 -0
- pytme-0.1.5.dist-info/RECORD +63 -0
- pytme-0.1.5.dist-info/WHEEL +5 -0
- pytme-0.1.5.dist-info/entry_points.txt +6 -0
- pytme-0.1.5.dist-info/top_level.txt +2 -0
- scripts/__init__.py +0 -0
- scripts/estimate_ram_usage.py +81 -0
- scripts/match_template.py +744 -0
- scripts/match_template_devel.py +788 -0
- scripts/postprocess.py +279 -0
- scripts/preprocess.py +93 -0
- scripts/preprocessor_gui.py +729 -0
- tme/__init__.py +6 -0
- tme/__version__.py +1 -0
- tme/analyzer.py +1144 -0
- tme/backends/__init__.py +134 -0
- tme/backends/cupy_backend.py +309 -0
- tme/backends/matching_backend.py +1154 -0
- tme/backends/npfftw_backend.py +763 -0
- tme/backends/pytorch_backend.py +526 -0
- tme/data/__init__.py +0 -0
- tme/data/c48n309.npy +0 -0
- tme/data/c48n527.npy +0 -0
- tme/data/c48n9.npy +0 -0
- tme/data/c48u1.npy +0 -0
- tme/data/c48u1153.npy +0 -0
- tme/data/c48u1201.npy +0 -0
- tme/data/c48u1641.npy +0 -0
- tme/data/c48u181.npy +0 -0
- tme/data/c48u2219.npy +0 -0
- tme/data/c48u27.npy +0 -0
- tme/data/c48u2947.npy +0 -0
- tme/data/c48u3733.npy +0 -0
- tme/data/c48u4749.npy +0 -0
- tme/data/c48u5879.npy +0 -0
- tme/data/c48u7111.npy +0 -0
- tme/data/c48u815.npy +0 -0
- tme/data/c48u83.npy +0 -0
- tme/data/c48u8649.npy +0 -0
- tme/data/c600v.npy +0 -0
- tme/data/c600vc.npy +0 -0
- tme/data/metadata.yaml +80 -0
- tme/data/quat_to_numpy.py +42 -0
- tme/data/scattering_factors.pickle +0 -0
- tme/density.py +2314 -0
- tme/extensions.cpython-311-darwin.so +0 -0
- tme/helpers.py +881 -0
- tme/matching_data.py +377 -0
- tme/matching_exhaustive.py +1553 -0
- tme/matching_memory.py +382 -0
- tme/matching_optimization.py +1123 -0
- tme/matching_utils.py +1180 -0
- tme/parser.py +429 -0
- tme/preprocessor.py +1291 -0
- tme/scoring.py +866 -0
- tme/structure.py +1428 -0
- tme/types.py +10 -0
@@ -0,0 +1,81 @@
|
|
1
|
+
#!python
|
2
|
+
""" Estimate RAM 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.matching_utils import estimate_ram_usage
|
12
|
+
|
13
|
+
|
14
|
+
def parse_args():
|
15
|
+
parser = argparse.ArgumentParser(
|
16
|
+
description="Estimate RAM usage for template matching."
|
17
|
+
)
|
18
|
+
parser.add_argument(
|
19
|
+
"-m",
|
20
|
+
"--target",
|
21
|
+
dest="target",
|
22
|
+
type=str,
|
23
|
+
required=True,
|
24
|
+
help="Path to a target in CCP4/MRC format.",
|
25
|
+
)
|
26
|
+
parser.add_argument(
|
27
|
+
"-i",
|
28
|
+
"--template",
|
29
|
+
dest="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
|
+
"--matching_method",
|
36
|
+
required=False,
|
37
|
+
default=None,
|
38
|
+
help="Analyzer method to use.",
|
39
|
+
)
|
40
|
+
parser.add_argument(
|
41
|
+
"--analyzer_method",
|
42
|
+
required=False,
|
43
|
+
default=None,
|
44
|
+
help="Analyzer method to use.",
|
45
|
+
)
|
46
|
+
parser.add_argument(
|
47
|
+
"--ncores", type=int, help="Number of cores for parallelization.", required=True
|
48
|
+
)
|
49
|
+
parser.add_argument(
|
50
|
+
"--no_edge_padding",
|
51
|
+
dest="no_edge_padding",
|
52
|
+
action="store_true",
|
53
|
+
default=False,
|
54
|
+
help="Whether to pad the edges of the target. This is useful, if the target"
|
55
|
+
" has a well defined bounding box, e.g. a density map.",
|
56
|
+
)
|
57
|
+
args = parser.parse_args()
|
58
|
+
return args
|
59
|
+
|
60
|
+
|
61
|
+
def main():
|
62
|
+
args = parse_args()
|
63
|
+
target = Density.from_file(args.target)
|
64
|
+
template = Density.from_file(args.template)
|
65
|
+
|
66
|
+
target_box = target.shape
|
67
|
+
if not args.no_edge_padding:
|
68
|
+
target_box = np.add(target_box, template.shape)
|
69
|
+
|
70
|
+
result = estimate_ram_usage(
|
71
|
+
shape1=target_box,
|
72
|
+
shape2=template.shape,
|
73
|
+
matching_method=args.matching_method,
|
74
|
+
ncores=args.ncores,
|
75
|
+
analyzer_method=args.analyzer_method,
|
76
|
+
)
|
77
|
+
print(result)
|
78
|
+
|
79
|
+
|
80
|
+
if __name__ == "__main__":
|
81
|
+
main()
|