janas 2.2.2__tar.gz → 2.2.3__tar.gz

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 (85) hide show
  1. {janas-2.2.2 → janas-2.2.3}/CHANGELOG.md +16 -0
  2. {janas-2.2.2 → janas-2.2.3}/PKG-INFO +1 -1
  3. {janas-2.2.2 → janas-2.2.3}/setup.py +1 -1
  4. {janas-2.2.2 → janas-2.2.3}/src/janas/bin/janas_app_starProcess +0 -0
  5. {janas-2.2.2 → janas-2.2.3}/src/janas.egg-info/PKG-INFO +1 -1
  6. {janas-2.2.2 → janas-2.2.3}/src/src_cpp/euler_libs.h +8 -4
  7. {janas-2.2.2 → janas-2.2.3}/src/src_cpp/janas_app_starProcess.cxx +5 -3
  8. {janas-2.2.2 → janas-2.2.3}/tests/test_euler_anchor_assignment.py +19 -6
  9. {janas-2.2.2 → janas-2.2.3}/CMakeLists.txt +0 -0
  10. {janas-2.2.2 → janas-2.2.3}/LICENSE +0 -0
  11. {janas-2.2.2 → janas-2.2.3}/MANIFEST.in +0 -0
  12. {janas-2.2.2 → janas-2.2.3}/README.md +0 -0
  13. {janas-2.2.2 → janas-2.2.3}/pyproject.toml +0 -0
  14. {janas-2.2.2 → janas-2.2.3}/requirements.txt +0 -0
  15. {janas-2.2.2 → janas-2.2.3}/setup.cfg +0 -0
  16. {janas-2.2.2 → janas-2.2.3}/src/janas/IO_utils.py +0 -0
  17. {janas-2.2.2 → janas-2.2.3}/src/janas/__init__.py +0 -0
  18. {janas-2.2.2 → janas-2.2.3}/src/janas/assessParticles.py +0 -0
  19. {janas-2.2.2 → janas-2.2.3}/src/janas/benchmarking_janas_cmd_session_manager.py +0 -0
  20. {janas-2.2.2 → janas-2.2.3}/src/janas/bin/janas_app_meanMinMax +0 -0
  21. {janas-2.2.2 → janas-2.2.3}/src/janas/bin_wrapper.py +0 -0
  22. {janas-2.2.2 → janas-2.2.3}/src/janas/images/selection_finished.png +0 -0
  23. {janas-2.2.2 → janas-2.2.3}/src/janas/images/selection_step1.png +0 -0
  24. {janas-2.2.2 → janas-2.2.3}/src/janas/images/selection_step2.png +0 -0
  25. {janas-2.2.2 → janas-2.2.3}/src/janas/images/selection_step3.png +0 -0
  26. {janas-2.2.2 → janas-2.2.3}/src/janas/images/selection_step4.png +0 -0
  27. {janas-2.2.2 → janas-2.2.3}/src/janas/images/selection_unstarted.png +0 -0
  28. {janas-2.2.2 → janas-2.2.3}/src/janas/janas_alternative_selector.py +0 -0
  29. {janas-2.2.2 → janas-2.2.3}/src/janas/janas_cmd_caller.py +0 -0
  30. {janas-2.2.2 → janas-2.2.3}/src/janas/janas_cmd_optimizer.py +0 -0
  31. {janas-2.2.2 → janas-2.2.3}/src/janas/janas_cmd_session_manager.py +0 -0
  32. {janas-2.2.2 → janas-2.2.3}/src/janas/janas_cmd_utils.py +0 -0
  33. {janas-2.2.2 → janas-2.2.3}/src/janas/janas_developer_test.py +0 -0
  34. {janas-2.2.2 → janas-2.2.3}/src/janas/janas_mapProcess.py +0 -0
  35. {janas-2.2.2 → janas-2.2.3}/src/janas/janas_progress.py +0 -0
  36. {janas-2.2.2 → janas-2.2.3}/src/janas/janas_reconstructor.py +0 -0
  37. {janas-2.2.2 → janas-2.2.3}/src/janas/locres_repro.py +0 -0
  38. {janas-2.2.2 → janas-2.2.3}/src/janas/locres_utils.py +0 -0
  39. {janas-2.2.2 → janas-2.2.3}/src/janas/projector_utils.py +0 -0
  40. {janas-2.2.2 → janas-2.2.3}/src/janas/reconstructor_utils.py +0 -0
  41. {janas-2.2.2 → janas-2.2.3}/src/janas/setup_environment_shell.sh +0 -0
  42. {janas-2.2.2 → janas-2.2.3}/src/janas/starDisplay.py +0 -0
  43. {janas-2.2.2 → janas-2.2.3}/src/janas/starHandler.py +0 -0
  44. {janas-2.2.2 → janas-2.2.3}/src/janas/utils.py +0 -0
  45. {janas-2.2.2 → janas-2.2.3}/src/janas/utils_csparc.py +0 -0
  46. {janas-2.2.2 → janas-2.2.3}/src/janas/version.py +0 -0
  47. {janas-2.2.2 → janas-2.2.3}/src/janas.egg-info/SOURCES.txt +0 -0
  48. {janas-2.2.2 → janas-2.2.3}/src/janas.egg-info/dependency_links.txt +0 -0
  49. {janas-2.2.2 → janas-2.2.3}/src/janas.egg-info/entry_points.txt +0 -0
  50. {janas-2.2.2 → janas-2.2.3}/src/janas.egg-info/not-zip-safe +0 -0
  51. {janas-2.2.2 → janas-2.2.3}/src/janas.egg-info/requires.txt +0 -0
  52. {janas-2.2.2 → janas-2.2.3}/src/janas.egg-info/top_level.txt +0 -0
  53. {janas-2.2.2 → janas-2.2.3}/src/src_cpp/CsvStarReadWriteAnalyseLibs.h +0 -0
  54. {janas-2.2.2 → janas-2.2.3}/src/src_cpp/ctfLibs.h +0 -0
  55. {janas-2.2.2 → janas-2.2.3}/src/src_cpp/derivative_libs.h +0 -0
  56. {janas-2.2.2 → janas-2.2.3}/src/src_cpp/imageProcessingLib.h +0 -0
  57. {janas-2.2.2 → janas-2.2.3}/src/src_cpp/janas_app_meanMinMax.cxx +0 -0
  58. {janas-2.2.2 → janas-2.2.3}/src/src_cpp/janas_core.cpp +0 -0
  59. {janas-2.2.2 → janas-2.2.3}/src/src_cpp/matrix_computations.h +0 -0
  60. {janas-2.2.2 → janas-2.2.3}/src/src_cpp/mrcIO.h +0 -0
  61. {janas-2.2.2 → janas-2.2.3}/src/src_cpp/randomLibs.h +0 -0
  62. {janas-2.2.2 → janas-2.2.3}/src/src_cpp/recline.c +0 -0
  63. {janas-2.2.2 → janas-2.2.3}/src/src_cpp/recline.h +0 -0
  64. {janas-2.2.2 → janas-2.2.3}/src/src_cpp/scores.h +0 -0
  65. {janas-2.2.2 → janas-2.2.3}/tests/test_backmap_stars.py +0 -0
  66. {janas-2.2.2 → janas-2.2.3}/tests/test_behaviour_preserving_fixes.py +0 -0
  67. {janas-2.2.2 → janas-2.2.3}/tests/test_clean_csparc_blob_path.py +0 -0
  68. {janas-2.2.2 → janas-2.2.3}/tests/test_create_stack_path_mode.py +0 -0
  69. {janas-2.2.2 → janas-2.2.3}/tests/test_csparc2star_missing_pose.py +0 -0
  70. {janas-2.2.2 → janas-2.2.3}/tests/test_csparc_finalise.py +0 -0
  71. {janas-2.2.2 → janas-2.2.3}/tests/test_csparc_login.py +0 -0
  72. {janas-2.2.2 → janas-2.2.3}/tests/test_custom_selected_stacks.py +0 -0
  73. {janas-2.2.2 → janas-2.2.3}/tests/test_eulerhist_show_flag.py +0 -0
  74. {janas-2.2.2 → janas-2.2.3}/tests/test_fixstack.py +0 -0
  75. {janas-2.2.2 → janas-2.2.3}/tests/test_generated_session_scripts.py +0 -0
  76. {janas-2.2.2 → janas-2.2.3}/tests/test_janas_progress.py +0 -0
  77. {janas-2.2.2 → janas-2.2.3}/tests/test_locres_release_fixes.py +0 -0
  78. {janas-2.2.2 → janas-2.2.3}/tests/test_locres_reproducibility.py +0 -0
  79. {janas-2.2.2 → janas-2.2.3}/tests/test_locres_v3_closure.py +0 -0
  80. {janas-2.2.2 → janas-2.2.3}/tests/test_mrc_reader.py +0 -0
  81. {janas-2.2.2 → janas-2.2.3}/tests/test_reconstructor_nan_guard.py +0 -0
  82. {janas-2.2.2 → janas-2.2.3}/tests/test_sanitize_particle.py +0 -0
  83. {janas-2.2.2 → janas-2.2.3}/tests/test_score_particles_arrays_equivalence.py +0 -0
  84. {janas-2.2.2 → janas-2.2.3}/tests/test_scoreparticles_additional_options.py +0 -0
  85. {janas-2.2.2 → janas-2.2.3}/tests/test_support_floor.py +0 -0
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.2.3
4
+
5
+ - **Anchor lattice generated exactly.** The Fibonacci lattice of anchor
6
+ views used by the Euler-balanced ranking (`getEulerClassGroup`,
7
+ `src/src_cpp/euler_libs.h`) computed the z-coordinate of the anchors as a
8
+ running sum `K += 2/(n-1)`. For about half of all view numbers (1,396 of
9
+ the 2,999 values between 2 and 3000, among them 200 and 500) the sum
10
+ drifted just past 1.0 and the polar anchor was dropped, so that
11
+ `--numViews 500` produced 499 anchors and `--numViews 200` produced 199.
12
+ The coordinate is now computed as `-1 + 2 i/(n-1)` and clamped to 1.0;
13
+ every requested anchor exists and the regression test checks the anchor
14
+ count. For the other view numbers (for example 350 and 1500) the anchor
15
+ positions change only by floating-point rounding (below 1e-5 degrees).
16
+ The same loop in the homogeneous-distribution simulation of
17
+ `janas_app_starProcess.cxx` is corrected in the same way.
18
+
3
19
  ## 2.2.2
4
20
 
5
21
  - **Refined particle metadata retrieved through the cryosparc-tools API.**
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: janas
3
- Version: 2.2.2
3
+ Version: 2.2.3
4
4
  Summary: Pipeline for per-particle selection and 3D class reassignment in single-particle cryo-EM.
5
5
  Home-page: https://gitlab.com/topf-lab/janas
6
6
  Author: Mauro Maiorca
@@ -99,7 +99,7 @@ janas_core = Extension(
99
99
 
100
100
  setup(
101
101
  name='janas',
102
- version='2.2.2',
102
+ version='2.2.3',
103
103
  description='Pipeline for per-particle selection and 3D class reassignment in single-particle cryo-EM.',
104
104
  long_description=read_long_description(),
105
105
  long_description_content_type='text/markdown',
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: janas
3
- Version: 2.2.2
3
+ Version: 2.2.3
4
4
  Summary: Pipeline for per-particle selection and 3D class reassignment in single-particle cryo-EM.
5
5
  Home-page: https://gitlab.com/topf-lab/janas
6
6
  Author: Mauro Maiorca
@@ -85,9 +85,11 @@ std::vector<double> scoreNormalizationHomogeneousViews ( std::vector<double> & p
85
85
 
86
86
  std::vector<double> phiV;
87
87
  std::vector<double> thetaV;
88
- double K=-1.0;
88
+ const double Kstep = (numActualViews > 1) ? 2.0/((double)numActualViews-1.0) : 0.0;
89
89
  double numEffectiveViews=0;
90
- for (unsigned long int ii=0; ii<numActualViews; ii++, K+=2.0/((double)numActualViews-1.0)){
90
+ for (unsigned long int ii=0; ii<numActualViews; ii++){
91
+ double K = -1.0 + (double)ii*Kstep; // exact; a running sum drifted past 1.0 for some numViews and dropped the polar anchor
92
+ if ( K > 1.0 ) K = 1.0;
91
93
  if ( K <= 1.0 ){
92
94
  double anglePhi = wrapAngles(ii*ga, 2*M_PI)*180.0/M_PI;
93
95
  double angleTheta = acos(K)*180.0/M_PI;
@@ -299,9 +301,11 @@ std::vector<std::string> getEulerClassGroup ( std::vector<double> & phiListParti
299
301
 
300
302
  std::vector<double> phiV;
301
303
  std::vector<double> thetaV;
302
- double K=-1.0;
304
+ const double Kstep = (numActualViews > 1) ? 2.0/((double)numActualViews-1.0) : 0.0;
303
305
  double numEffectiveViews=0;
304
- for (unsigned long int ii=0; ii<numActualViews; ii++, K+=2.0/((double)numActualViews-1.0)){
306
+ for (unsigned long int ii=0; ii<numActualViews; ii++){
307
+ double K = -1.0 + (double)ii*Kstep; // exact; a running sum drifted past 1.0 for some numViews and dropped the polar anchor
308
+ if ( K > 1.0 ) K = 1.0;
305
309
  if ( K <= 1.0 ){
306
310
  double anglePhi = wrapAngles(ii*ga, 2*M_PI)*180.0/M_PI;
307
311
  double angleTheta = acos(K)*180.0/M_PI;
@@ -3737,10 +3737,12 @@ if ( parameters.tag1_toInvert && parameters.tag2_toInvert && parameters.starFile
3737
3737
 
3738
3738
 
3739
3739
  const unsigned long int numActualViews=parameters.numHomogeneousDistribution+1;
3740
- const double ga = (3.0 - pow(5.0,0.5)) * PI; // golden angle
3741
- double K=-1.0;
3740
+ const double ga = (3.0 - pow(5.0,0.5)) * PI; // golden angle
3741
+ const double Kstep = (numActualViews > 1) ? 2.0/((double)numActualViews-1.0) : 0.0;
3742
3742
  long int views=0;
3743
- for (unsigned long int ii=0; ii<numActualViews; ii++, K+=2.0/((double)numActualViews-1.0)){
3743
+ for (unsigned long int ii=0; ii<numActualViews; ii++){
3744
+ double K = -1.0 + (double)ii*Kstep; // exact; a running sum drifted past 1.0 for some numViews and dropped the polar anchor
3745
+ if ( K > 1.0 ) K = 1.0;
3744
3746
  if ( K <= 1.0 ){
3745
3747
  //wrapping angle
3746
3748
  double angle=ii*ga;
@@ -25,16 +25,15 @@ NUM_VIEWS = 350
25
25
 
26
26
 
27
27
  def anchor_lattice(num_views):
28
- """The anchor views of getEulerClassGroup, with the same floating-point steps."""
28
+ """The anchor views of getEulerClassGroup: a Fibonacci lattice with K = -1 + 2 i / (n - 1)."""
29
29
  golden = (3.0 - math.pow(5.0, 0.5)) * math.pi
30
30
  two_pi = 2.0 * math.pi
31
+ step = 2.0 / (num_views - 1.0) if num_views > 1 else 0.0
31
32
  phi, theta = [], []
32
- K = -1.0
33
33
  for ii in range(num_views):
34
- if K <= 1.0:
35
- phi.append(math.fmod(two_pi + math.fmod(ii * golden, two_pi), two_pi) * 180.0 / math.pi)
36
- theta.append(math.acos(K) * 180.0 / math.pi)
37
- K += 2.0 / (num_views - 1.0)
34
+ K = min(1.0, -1.0 + ii * step)
35
+ phi.append(math.fmod(two_pi + math.fmod(ii * golden, two_pi), two_pi) * 180.0 / math.pi)
36
+ theta.append(math.acos(K) * 180.0 / math.pi)
38
37
  return np.array(phi), np.array(theta)
39
38
 
40
39
 
@@ -60,6 +59,20 @@ def test_tilt_and_mirror_tilt_get_different_anchors():
60
59
  assert np.all(assign(phi, theta) != assign(phi, 180.0 - theta))
61
60
 
62
61
 
62
+ @pytest.mark.parametrize("num_views", [12, 50, 100, 200, 350, 500, 1500])
63
+ def test_lattice_has_num_views_anchors(num_views):
64
+ """Every requested anchor view exists, including the polar one (K = 1).
65
+
66
+ Up to release 2.2.2 the lattice accumulated K as a running sum, which for
67
+ about half of all view numbers (12, 50, 100, 200 and 500 among them)
68
+ drifted past 1.0 and dropped the last anchor (499 of 500, 199 of 200).
69
+ """
70
+ phi, theta = anchor_lattice(num_views)
71
+ assert len(phi) == num_views and theta[-1] == pytest.approx(0.0, abs=1e-4)
72
+ labels = janas_core.GetEulerClassGroup([float(v) for v in phi], [float(v) for v in theta], num_views)
73
+ assert [int(v) for v in labels] == list(range(num_views))
74
+
75
+
63
76
  def test_assignment_is_the_nearest_anchor_on_the_unit_sphere():
64
77
  rng = np.random.default_rng(11)
65
78
  phi = rng.uniform(-180.0, 180.0, 5000)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes