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.
Files changed (63) hide show
  1. pytme-0.1.5.data/scripts/estimate_ram_usage.py +81 -0
  2. pytme-0.1.5.data/scripts/match_template.py +744 -0
  3. pytme-0.1.5.data/scripts/postprocess.py +279 -0
  4. pytme-0.1.5.data/scripts/preprocess.py +93 -0
  5. pytme-0.1.5.data/scripts/preprocessor_gui.py +729 -0
  6. pytme-0.1.5.dist-info/LICENSE +153 -0
  7. pytme-0.1.5.dist-info/METADATA +69 -0
  8. pytme-0.1.5.dist-info/RECORD +63 -0
  9. pytme-0.1.5.dist-info/WHEEL +5 -0
  10. pytme-0.1.5.dist-info/entry_points.txt +6 -0
  11. pytme-0.1.5.dist-info/top_level.txt +2 -0
  12. scripts/__init__.py +0 -0
  13. scripts/estimate_ram_usage.py +81 -0
  14. scripts/match_template.py +744 -0
  15. scripts/match_template_devel.py +788 -0
  16. scripts/postprocess.py +279 -0
  17. scripts/preprocess.py +93 -0
  18. scripts/preprocessor_gui.py +729 -0
  19. tme/__init__.py +6 -0
  20. tme/__version__.py +1 -0
  21. tme/analyzer.py +1144 -0
  22. tme/backends/__init__.py +134 -0
  23. tme/backends/cupy_backend.py +309 -0
  24. tme/backends/matching_backend.py +1154 -0
  25. tme/backends/npfftw_backend.py +763 -0
  26. tme/backends/pytorch_backend.py +526 -0
  27. tme/data/__init__.py +0 -0
  28. tme/data/c48n309.npy +0 -0
  29. tme/data/c48n527.npy +0 -0
  30. tme/data/c48n9.npy +0 -0
  31. tme/data/c48u1.npy +0 -0
  32. tme/data/c48u1153.npy +0 -0
  33. tme/data/c48u1201.npy +0 -0
  34. tme/data/c48u1641.npy +0 -0
  35. tme/data/c48u181.npy +0 -0
  36. tme/data/c48u2219.npy +0 -0
  37. tme/data/c48u27.npy +0 -0
  38. tme/data/c48u2947.npy +0 -0
  39. tme/data/c48u3733.npy +0 -0
  40. tme/data/c48u4749.npy +0 -0
  41. tme/data/c48u5879.npy +0 -0
  42. tme/data/c48u7111.npy +0 -0
  43. tme/data/c48u815.npy +0 -0
  44. tme/data/c48u83.npy +0 -0
  45. tme/data/c48u8649.npy +0 -0
  46. tme/data/c600v.npy +0 -0
  47. tme/data/c600vc.npy +0 -0
  48. tme/data/metadata.yaml +80 -0
  49. tme/data/quat_to_numpy.py +42 -0
  50. tme/data/scattering_factors.pickle +0 -0
  51. tme/density.py +2314 -0
  52. tme/extensions.cpython-311-darwin.so +0 -0
  53. tme/helpers.py +881 -0
  54. tme/matching_data.py +377 -0
  55. tme/matching_exhaustive.py +1553 -0
  56. tme/matching_memory.py +382 -0
  57. tme/matching_optimization.py +1123 -0
  58. tme/matching_utils.py +1180 -0
  59. tme/parser.py +429 -0
  60. tme/preprocessor.py +1291 -0
  61. tme/scoring.py +866 -0
  62. tme/structure.py +1428 -0
  63. 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()