pytme 0.2.1__cp311-cp311-macosx_14_0_arm64.whl → 0.2.3__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 (52) hide show
  1. {pytme-0.2.1.data → pytme-0.2.3.data}/scripts/match_template.py +219 -216
  2. {pytme-0.2.1.data → pytme-0.2.3.data}/scripts/postprocess.py +86 -54
  3. pytme-0.2.3.data/scripts/preprocess.py +132 -0
  4. {pytme-0.2.1.data → pytme-0.2.3.data}/scripts/preprocessor_gui.py +181 -94
  5. pytme-0.2.3.dist-info/METADATA +92 -0
  6. pytme-0.2.3.dist-info/RECORD +75 -0
  7. {pytme-0.2.1.dist-info → pytme-0.2.3.dist-info}/WHEEL +1 -1
  8. pytme-0.2.1.data/scripts/preprocess.py → scripts/eval.py +1 -1
  9. scripts/extract_candidates.py +20 -13
  10. scripts/match_template.py +219 -216
  11. scripts/match_template_filters.py +154 -95
  12. scripts/postprocess.py +86 -54
  13. scripts/preprocess.py +95 -56
  14. scripts/preprocessor_gui.py +181 -94
  15. scripts/refine_matches.py +265 -61
  16. tme/__init__.py +0 -1
  17. tme/__version__.py +1 -1
  18. tme/analyzer.py +458 -813
  19. tme/backends/__init__.py +40 -11
  20. tme/backends/_jax_utils.py +187 -0
  21. tme/backends/cupy_backend.py +109 -226
  22. tme/backends/jax_backend.py +230 -152
  23. tme/backends/matching_backend.py +445 -384
  24. tme/backends/mlx_backend.py +32 -59
  25. tme/backends/npfftw_backend.py +240 -507
  26. tme/backends/pytorch_backend.py +30 -151
  27. tme/density.py +248 -371
  28. tme/extensions.cpython-311-darwin.so +0 -0
  29. tme/matching_data.py +328 -284
  30. tme/matching_exhaustive.py +195 -1499
  31. tme/matching_optimization.py +143 -106
  32. tme/matching_scores.py +887 -0
  33. tme/matching_utils.py +287 -388
  34. tme/memory.py +377 -0
  35. tme/orientations.py +78 -21
  36. tme/parser.py +3 -4
  37. tme/preprocessing/_utils.py +61 -32
  38. tme/preprocessing/composable_filter.py +7 -4
  39. tme/preprocessing/compose.py +7 -3
  40. tme/preprocessing/frequency_filters.py +49 -39
  41. tme/preprocessing/tilt_series.py +44 -72
  42. tme/preprocessor.py +560 -526
  43. tme/structure.py +491 -188
  44. tme/types.py +5 -3
  45. pytme-0.2.1.dist-info/METADATA +0 -73
  46. pytme-0.2.1.dist-info/RECORD +0 -73
  47. tme/helpers.py +0 -881
  48. tme/matching_constrained.py +0 -195
  49. {pytme-0.2.1.data → pytme-0.2.3.data}/scripts/estimate_ram_usage.py +0 -0
  50. {pytme-0.2.1.dist-info → pytme-0.2.3.dist-info}/LICENSE +0 -0
  51. {pytme-0.2.1.dist-info → pytme-0.2.3.dist-info}/entry_points.txt +0 -0
  52. {pytme-0.2.1.dist-info → pytme-0.2.3.dist-info}/top_level.txt +0 -0
@@ -108,6 +108,12 @@ def parse_args():
108
108
  type=int,
109
109
  help="Box size for extraction, defaults to two times the template.",
110
110
  )
111
+ extraction_group.add_argument(
112
+ "--translation_uncertainty",
113
+ required=False,
114
+ type=int,
115
+ help="Sets box size for extraction to template box plus this value.",
116
+ )
111
117
  extraction_group.add_argument(
112
118
  "--keep_out_of_box",
113
119
  action="store_true",
@@ -150,6 +156,9 @@ def main():
150
156
  box_size = args.box_size
151
157
  if box_size is None:
152
158
  box_size = np.multiply(template.shape, 2)
159
+ if args.translation_uncertainty is not None:
160
+ box_size = np.add(template.shape, args.translation_uncertainty)
161
+
153
162
  box_size = np.array(box_size)
154
163
  box_size = np.repeat(box_size, template.data.ndim // box_size.size).astype(int)
155
164
 
@@ -195,8 +204,6 @@ def main():
195
204
  )
196
205
  dens.data[:] = target.metadata["mean"]
197
206
 
198
- print(target.data.shape)
199
- # There appears to be an isseu with the stack creation. Trace this further
200
207
  data_subset = np.zeros(extraction_shape, dtype = target.data.dtype)
201
208
  pbar = ProgressBar(message = "Orientation ", nchars = 80, total = len(obs_slices))
202
209
  for index, (obs_slice, cand_slice) in enumerate(zip(obs_slices, cand_slices)):
@@ -219,13 +226,13 @@ def main():
219
226
  )
220
227
  target_subset.pad(box_size, center=True)
221
228
 
222
- target_value = target.data[tuple(orientations.translations[index].astype(int))]
223
- center = np.divide(target_subset.data.shape, 2).astype(int ) + np.mod(target_subset.shape, 2)
224
- print(np.where(target_subset.data == target_value), center)
225
- print(target_subset.data[tuple(center.astype(int))],
226
- target_value,
227
- target_subset.data[tuple(center.astype(int))] == target_value
228
- )
229
+ # target_value = target.data[tuple(orientations.translations[index].astype(int))]
230
+ # center = np.divide(target_subset.data.shape, 2).astype(int ) + np.mod(target_subset.shape, 2)
231
+ # print(np.where(target_subset.data == target_value), center)
232
+ # print(target_subset.data[tuple(center.astype(int))],
233
+ # target_value,
234
+ # target_subset.data[tuple(center.astype(int))] == target_value
235
+ # )
229
236
 
230
237
  dens.data[index] = target_subset.data
231
238
  print("")
@@ -241,10 +248,10 @@ def main():
241
248
  f"{splitext(args.output_file)[0]}_aligned.tsv",
242
249
  file_format="text"
243
250
  )
244
- orientations.to_file(
245
- f"{splitext(args.output_file)[0]}_aligned.star",
246
- file_format="relion"
247
- )
251
+ # orientations.to_file(
252
+ # f"{splitext(args.output_file)[0]}_aligned.star",
253
+ # file_format="relion"
254
+ # )
248
255
 
249
256
  if __name__ == "__main__":
250
257
  main()