phykit 2.1.2__tar.gz → 2.1.5__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 (93) hide show
  1. {phykit-2.1.2 → phykit-2.1.5}/PKG-INFO +1 -1
  2. phykit-2.1.5/phykit/helpers/json_output.py +26 -0
  3. {phykit-2.1.2 → phykit-2.1.5}/phykit/phykit.py +541 -114
  4. phykit-2.1.5/phykit/services/alignment/__init__.py +38 -0
  5. phykit-2.1.5/phykit/services/alignment/alignment_entropy.py +78 -0
  6. phykit-2.1.5/phykit/services/alignment/alignment_length.py +25 -0
  7. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/alignment_length_no_gaps.py +17 -2
  8. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/alignment_recoding.py +19 -3
  9. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/base.py +36 -21
  10. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/column_score.py +16 -3
  11. phykit-2.1.5/phykit/services/alignment/composition_per_taxon.py +78 -0
  12. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/compositional_bias_per_site.py +26 -2
  13. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/create_concatenation_matrix.py +64 -24
  14. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/dna_threader.py +17 -0
  15. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/evolutionary_rate_per_site.py +21 -2
  16. phykit-2.1.5/phykit/services/alignment/faidx.py +42 -0
  17. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/gc_content.py +52 -19
  18. phykit-2.1.5/phykit/services/alignment/mask_alignment.py +101 -0
  19. phykit-2.1.5/phykit/services/alignment/occupancy_per_taxon.py +53 -0
  20. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/pairwise_identity.py +49 -4
  21. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/parsimony_informative_sites.py +18 -2
  22. phykit-2.1.5/phykit/services/alignment/rcv.py +24 -0
  23. phykit-2.1.5/phykit/services/alignment/rcvt.py +88 -0
  24. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/rename_fasta_entries.py +29 -4
  25. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/sum_of_pairs_score.py +16 -3
  26. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/variable_sites.py +18 -2
  27. phykit-2.1.5/phykit/services/tree/__init__.py +46 -0
  28. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/base.py +1 -1
  29. phykit-2.1.5/phykit/services/tree/bipartition_support_stats.py +152 -0
  30. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/branch_length_multiplier.py +24 -4
  31. phykit-2.1.5/phykit/services/tree/collapse_branches.py +47 -0
  32. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/covarying_evolutionary_rates.py +59 -7
  33. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/dvmc.py +8 -2
  34. phykit-2.1.5/phykit/services/tree/evolutionary_rate.py +24 -0
  35. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/hidden_paralogy_check.py +22 -1
  36. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/internal_branch_stats.py +26 -2
  37. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/internode_labeler.py +22 -3
  38. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/last_common_ancestor_subtree.py +20 -1
  39. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/lb_score.py +27 -2
  40. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/monophyly_check.py +19 -1
  41. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/nearest_neighbor_interchange.py +18 -2
  42. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/patristic_distances.py +30 -2
  43. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/polytomy_test.py +51 -11
  44. phykit-2.1.5/phykit/services/tree/print_tree.py +47 -0
  45. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/prune_tree.py +23 -1
  46. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/rename_tree_tips.py +24 -4
  47. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/rf_distance.py +17 -1
  48. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/root_tree.py +19 -1
  49. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/saturation.py +60 -14
  50. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/spurious_sequence.py +25 -7
  51. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/terminal_branch_stats.py +26 -2
  52. phykit-2.1.5/phykit/services/tree/tip_labels.py +26 -0
  53. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/tip_to_tip_distance.py +20 -2
  54. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/tip_to_tip_node_distance.py +20 -2
  55. phykit-2.1.5/phykit/services/tree/total_tree_length.py +32 -0
  56. phykit-2.1.5/phykit/services/tree/treeness.py +23 -0
  57. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/treeness_over_rcv.py +18 -1
  58. phykit-2.1.5/phykit/version.py +1 -0
  59. {phykit-2.1.2 → phykit-2.1.5}/phykit.egg-info/PKG-INFO +1 -1
  60. {phykit-2.1.2 → phykit-2.1.5}/phykit.egg-info/SOURCES.txt +5 -0
  61. {phykit-2.1.2 → phykit-2.1.5}/phykit.egg-info/entry_points.txt +12 -0
  62. {phykit-2.1.2 → phykit-2.1.5}/setup.py +12 -0
  63. phykit-2.1.2/phykit/services/alignment/__init__.py +0 -17
  64. phykit-2.1.2/phykit/services/alignment/alignment_length.py +0 -16
  65. phykit-2.1.2/phykit/services/alignment/faidx.py +0 -21
  66. phykit-2.1.2/phykit/services/alignment/rcv.py +0 -14
  67. phykit-2.1.2/phykit/services/alignment/rcvt.py +0 -47
  68. phykit-2.1.2/phykit/services/tree/__init__.py +0 -29
  69. phykit-2.1.2/phykit/services/tree/bipartition_support_stats.py +0 -48
  70. phykit-2.1.2/phykit/services/tree/collapse_branches.py +0 -27
  71. phykit-2.1.2/phykit/services/tree/evolutionary_rate.py +0 -17
  72. phykit-2.1.2/phykit/services/tree/print_tree.py +0 -28
  73. phykit-2.1.2/phykit/services/tree/tip_labels.py +0 -18
  74. phykit-2.1.2/phykit/services/tree/total_tree_length.py +0 -25
  75. phykit-2.1.2/phykit/services/tree/treeness.py +0 -16
  76. phykit-2.1.2/phykit/version.py +0 -1
  77. {phykit-2.1.2 → phykit-2.1.5}/LICENSE.md +0 -0
  78. {phykit-2.1.2 → phykit-2.1.5}/README.md +0 -0
  79. {phykit-2.1.2 → phykit-2.1.5}/phykit/__init__.py +0 -0
  80. {phykit-2.1.2 → phykit-2.1.5}/phykit/__main__.py +0 -0
  81. {phykit-2.1.2 → phykit-2.1.5}/phykit/helpers/__init__.py +0 -0
  82. {phykit-2.1.2 → phykit-2.1.5}/phykit/helpers/boolean_argument_parsing.py +0 -0
  83. {phykit-2.1.2 → phykit-2.1.5}/phykit/helpers/caching.py +0 -0
  84. {phykit-2.1.2 → phykit-2.1.5}/phykit/helpers/files.py +0 -0
  85. {phykit-2.1.2 → phykit-2.1.5}/phykit/helpers/parallel.py +0 -0
  86. {phykit-2.1.2 → phykit-2.1.5}/phykit/helpers/stats_summary.py +0 -0
  87. {phykit-2.1.2 → phykit-2.1.5}/phykit/helpers/streaming.py +0 -0
  88. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/__init__.py +0 -0
  89. {phykit-2.1.2 → phykit-2.1.5}/phykit/services/base.py +0 -0
  90. {phykit-2.1.2 → phykit-2.1.5}/phykit.egg-info/dependency_links.txt +0 -0
  91. {phykit-2.1.2 → phykit-2.1.5}/phykit.egg-info/requires.txt +0 -0
  92. {phykit-2.1.2 → phykit-2.1.5}/phykit.egg-info/top_level.txt +0 -0
  93. {phykit-2.1.2 → phykit-2.1.5}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: phykit
3
- Version: 2.1.2
3
+ Version: 2.1.5
4
4
  Home-page: https://github.com/jlsteenwyk/phykit
5
5
  Author: Jacob L. Steenwyk
6
6
  Author-email: jlsteenwyk@gmail.com
@@ -0,0 +1,26 @@
1
+ import json
2
+
3
+ import numpy as np
4
+
5
+
6
+ def to_builtin_json_types(value):
7
+ if isinstance(value, dict):
8
+ return {key: to_builtin_json_types(sub_value) for key, sub_value in value.items()}
9
+ if isinstance(value, list):
10
+ return [to_builtin_json_types(sub_value) for sub_value in value]
11
+ if isinstance(value, tuple):
12
+ return [to_builtin_json_types(sub_value) for sub_value in value]
13
+ if isinstance(value, np.integer):
14
+ return int(value)
15
+ if isinstance(value, np.floating):
16
+ return float(value)
17
+ if isinstance(value, np.ndarray):
18
+ return [to_builtin_json_types(sub_value) for sub_value in value.tolist()]
19
+ return value
20
+
21
+
22
+ def print_json(payload, sort_keys=True):
23
+ try:
24
+ print(json.dumps(to_builtin_json_types(payload), sort_keys=sort_keys))
25
+ except BrokenPipeError:
26
+ pass