clipkit 2.11.4__tar.gz → 2.12.0__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 (77) hide show
  1. {clipkit-2.11.4 → clipkit-2.12.0}/PKG-INFO +2 -17
  2. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/args_processing.py +24 -1
  3. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/parser.py +10 -7
  4. clipkit-2.12.0/clipkit/version.py +1 -0
  5. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit.egg-info/PKG-INFO +2 -17
  6. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/test_args_parsing.py +31 -0
  7. clipkit-2.11.4/clipkit/version.py +0 -1
  8. {clipkit-2.11.4 → clipkit-2.12.0}/LICENSE.md +0 -0
  9. {clipkit-2.11.4 → clipkit-2.12.0}/README.md +0 -0
  10. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/__init__.py +0 -0
  11. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/__main__.py +0 -0
  12. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/api.py +0 -0
  13. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/clipkit.py +0 -0
  14. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/ecomp/__init__.py +0 -0
  15. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/ecomp/reader.py +0 -0
  16. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/ecomp/writer.py +0 -0
  17. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/exceptions.py +0 -0
  18. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/files.py +0 -0
  19. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/guide_tree.py +0 -0
  20. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/helpers.py +0 -0
  21. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/logger.py +0 -0
  22. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/modes.py +0 -0
  23. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/msa.py +0 -0
  24. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/plot_report.py +0 -0
  25. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/settings.py +0 -0
  26. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/site_classification.py +0 -0
  27. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/smart_gap_helper.py +0 -0
  28. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/stats.py +0 -0
  29. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/warnings.py +0 -0
  30. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit/write.py +0 -0
  31. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit.egg-info/SOURCES.txt +0 -0
  32. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit.egg-info/dependency_links.txt +0 -0
  33. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit.egg-info/entry_points.txt +0 -0
  34. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit.egg-info/requires.txt +0 -0
  35. {clipkit-2.11.4 → clipkit-2.12.0}/clipkit.egg-info/top_level.txt +0 -0
  36. {clipkit-2.11.4 → clipkit-2.12.0}/pyproject.toml +0 -0
  37. {clipkit-2.11.4 → clipkit-2.12.0}/setup.cfg +0 -0
  38. {clipkit-2.11.4 → clipkit-2.12.0}/setup.py +0 -0
  39. {clipkit-2.11.4 → clipkit-2.12.0}/tests/__init__.py +0 -0
  40. {clipkit-2.11.4 → clipkit-2.12.0}/tests/conftest.py +0 -0
  41. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/__init__.py +0 -0
  42. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_api.py +0 -0
  43. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_block_gappy_mode.py +0 -0
  44. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_c3.py +0 -0
  45. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_codon.py +0 -0
  46. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_complementary_output.py +0 -0
  47. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_composition_bias_mode.py +0 -0
  48. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_cst.py +0 -0
  49. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_ecomp_input.py +0 -0
  50. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_ends_only.py +0 -0
  51. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_gappy_mode.py +0 -0
  52. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_gappyout_mode.py +0 -0
  53. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_heterotachy_mode.py +0 -0
  54. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_kpi_gappy_mode.py +0 -0
  55. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_kpi_mode.py +0 -0
  56. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_kpi_smart_gap_mode.py +0 -0
  57. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_kpic_gappy_mode.py +0 -0
  58. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_kpic_mode.py +0 -0
  59. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_kpic_smart_gap_mode.py +0 -0
  60. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_smart_gap_mode.py +0 -0
  61. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_writing_to_different_output_file_formats.py +0 -0
  62. {clipkit-2.11.4 → clipkit-2.12.0}/tests/integration/test_writing_to_log_file.py +0 -0
  63. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/__init__.py +0 -0
  64. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/ecomp/__init__.py +0 -0
  65. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/ecomp/test_reader.py +0 -0
  66. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/test_entrypoint.py +0 -0
  67. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/test_execution_state.py +0 -0
  68. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/test_files.py +0 -0
  69. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/test_msa.py +0 -0
  70. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/test_parallel.py +0 -0
  71. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/test_parallel_simple.py +0 -0
  72. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/test_parallel_standalone.py +0 -0
  73. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/test_parser.py +0 -0
  74. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/test_plot_report.py +0 -0
  75. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/test_smart_gap_helper.py +0 -0
  76. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/test_thread_heuristics.py +0 -0
  77. {clipkit-2.11.4 → clipkit-2.12.0}/tests/unit/test_warnings.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.1
2
2
  Name: clipkit
3
- Version: 2.11.4
3
+ Version: 2.12.0
4
4
  Summary: Alignment trimming software for phylogenetics.
5
5
  Home-page: https://github.com/jlsteenwyk/clipkit
6
6
  Author: Jacob L. Steenwyk
@@ -16,21 +16,6 @@ Classifier: Topic :: Scientific/Engineering
16
16
  Requires-Python: >=3.10
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE.md
19
- Requires-Dist: biopython>=1.82; python_version < "3.13"
20
- Requires-Dist: biopython>=1.84; python_version >= "3.13"
21
- Requires-Dist: numpy<2.0,>=1.24.0; python_version < "3.12"
22
- Requires-Dist: numpy<2.1,>=1.26.0; python_version == "3.12"
23
- Requires-Dist: numpy<2.2,>=2.0.0; python_version >= "3.13"
24
- Dynamic: author
25
- Dynamic: author-email
26
- Dynamic: classifier
27
- Dynamic: description
28
- Dynamic: description-content-type
29
- Dynamic: home-page
30
- Dynamic: license-file
31
- Dynamic: requires-dist
32
- Dynamic: requires-python
33
- Dynamic: summary
34
19
 
35
20
  <p align="center">
36
21
  <a href="https://github.com/jlsteenwyk/clipkit">
@@ -27,7 +27,30 @@ def process_args(args) -> dict:
27
27
  # assign optional arguments
28
28
  complement = args.complementary or False
29
29
  codon = args.codon or False
30
- mode = TrimmingMode(args.mode) if args.mode else TrimmingMode.smart_gap
30
+
31
+ # Modes that dynamically compute their own gap threshold and ignore -g
32
+ _GAP_OVERRIDE_MODES = {
33
+ TrimmingMode.smart_gap,
34
+ TrimmingMode.kpi_smart_gap,
35
+ TrimmingMode.kpic_smart_gap,
36
+ TrimmingMode.gappyout,
37
+ }
38
+
39
+ if args.mode:
40
+ mode = TrimmingMode(args.mode)
41
+ elif args.gaps is not None:
42
+ # User explicitly provided a gap threshold but no mode — default to
43
+ # gappy so the threshold is actually honoured (smart-gap would ignore it).
44
+ mode = TrimmingMode.gappy
45
+ else:
46
+ mode = TrimmingMode.smart_gap
47
+
48
+ if args.gaps is not None and args.mode and mode in _GAP_OVERRIDE_MODES:
49
+ logger.warning(
50
+ f"The gap threshold (-g {args.gaps}) will be ignored because "
51
+ f"{mode.value} mode dynamically determines its own threshold."
52
+ )
53
+
31
54
  if args.gaps is not None:
32
55
  gaps = float(args.gaps)
33
56
  elif mode in {
@@ -126,13 +126,16 @@ Modes
126
126
  c3: remove every third codon position
127
127
 
128
128
  Gaps
129
- Positions with gappyness greater than threshold will be trimmed.
130
- Must be between 0 and 1. (Default: 0.9). This argument is ignored
131
- when using the kpi and kpic modes of trimming as well as an
132
- iteration of trimming that uses smart-gap or gappyout. For entropy mode,
133
- this threshold is interpreted as normalized Shannon entropy (default: 0.8).
134
- For composition-bias mode, this threshold is interpreted as a normalized
135
- per-site composition-bias score (default: 0.8).
129
+ Positions with gappyness greater than threshold will be trimmed.
130
+ Must be between 0 and 1. (Default: 0.9). When -g is provided without
131
+ -m, the trimming mode automatically switches from smart-gap to gappy
132
+ so that the threshold is honoured. If -m is explicitly set to a mode
133
+ that dynamically determines its own threshold (smart-gap, kpi-smart-gap,
134
+ kpic-smart-gap, or gappyout), the -g value is ignored and a warning is
135
+ printed. This argument is also ignored when using the kpi and kpic modes.
136
+ For entropy mode, this threshold is interpreted as normalized Shannon
137
+ entropy (default: 0.8). For composition-bias mode, this threshold is
138
+ interpreted as a normalized per-site composition-bias score (default: 0.8).
136
139
  For heterotachy mode, this threshold is interpreted as a normalized
137
140
  clade-entropy variation score based on a parsimony guide tree (default: 0.8).
138
141
 
@@ -0,0 +1 @@
1
+ __version__ = "2.12.0"
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.1
2
2
  Name: clipkit
3
- Version: 2.11.4
3
+ Version: 2.12.0
4
4
  Summary: Alignment trimming software for phylogenetics.
5
5
  Home-page: https://github.com/jlsteenwyk/clipkit
6
6
  Author: Jacob L. Steenwyk
@@ -16,21 +16,6 @@ Classifier: Topic :: Scientific/Engineering
16
16
  Requires-Python: >=3.10
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE.md
19
- Requires-Dist: biopython>=1.82; python_version < "3.13"
20
- Requires-Dist: biopython>=1.84; python_version >= "3.13"
21
- Requires-Dist: numpy<2.0,>=1.24.0; python_version < "3.12"
22
- Requires-Dist: numpy<2.1,>=1.26.0; python_version == "3.12"
23
- Requires-Dist: numpy<2.2,>=2.0.0; python_version >= "3.13"
24
- Dynamic: author
25
- Dynamic: author-email
26
- Dynamic: classifier
27
- Dynamic: description
28
- Dynamic: description-content-type
29
- Dynamic: home-page
30
- Dynamic: license-file
31
- Dynamic: requires-dist
32
- Dynamic: requires-python
33
- Dynamic: summary
34
19
 
35
20
  <p align="center">
36
21
  <a href="https://github.com/jlsteenwyk/clipkit">
@@ -48,6 +48,37 @@ class TestArgsProcessing(object):
48
48
  res = process_args(args)
49
49
  assert res["mode"] == TrimmingMode.smart_gap
50
50
 
51
+ def test_process_args_gaps_without_mode_defaults_to_gappy(self, args):
52
+ args.gaps = 0.2
53
+ args.mode = None
54
+ res = process_args(args)
55
+ assert res["mode"] == TrimmingMode.gappy
56
+ assert res["gaps"] == 0.2
57
+
58
+ def test_process_args_explicit_mode_preserved_with_gaps(self, args):
59
+ args.gaps = 0.5
60
+ args.mode = TrimmingMode.smart_gap
61
+ res = process_args(args)
62
+ assert res["mode"] == TrimmingMode.smart_gap
63
+
64
+ def test_process_args_warns_gaps_with_smart_gap(self, args, caplog):
65
+ args.gaps = 0.2
66
+ args.mode = TrimmingMode.smart_gap
67
+ process_args(args)
68
+ assert "will be ignored" in caplog.text
69
+
70
+ def test_process_args_warns_gaps_with_gappyout(self, args, caplog):
71
+ args.gaps = 0.2
72
+ args.mode = TrimmingMode.gappyout
73
+ process_args(args)
74
+ assert "will be ignored" in caplog.text
75
+
76
+ def test_process_args_no_warn_gaps_with_gappy(self, args, caplog):
77
+ args.gaps = 0.2
78
+ args.mode = TrimmingMode.gappy
79
+ process_args(args)
80
+ assert "will be ignored" not in caplog.text
81
+
51
82
  def test_process_args_default_complementary(self, args):
52
83
  args.complementary = None
53
84
  res = process_args(args)
@@ -1 +0,0 @@
1
- __version__ = "2.11.4"
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