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.
- {phykit-2.1.2 → phykit-2.1.5}/PKG-INFO +1 -1
- phykit-2.1.5/phykit/helpers/json_output.py +26 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/phykit.py +541 -114
- phykit-2.1.5/phykit/services/alignment/__init__.py +38 -0
- phykit-2.1.5/phykit/services/alignment/alignment_entropy.py +78 -0
- phykit-2.1.5/phykit/services/alignment/alignment_length.py +25 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/alignment_length_no_gaps.py +17 -2
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/alignment_recoding.py +19 -3
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/base.py +36 -21
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/column_score.py +16 -3
- phykit-2.1.5/phykit/services/alignment/composition_per_taxon.py +78 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/compositional_bias_per_site.py +26 -2
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/create_concatenation_matrix.py +64 -24
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/dna_threader.py +17 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/evolutionary_rate_per_site.py +21 -2
- phykit-2.1.5/phykit/services/alignment/faidx.py +42 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/gc_content.py +52 -19
- phykit-2.1.5/phykit/services/alignment/mask_alignment.py +101 -0
- phykit-2.1.5/phykit/services/alignment/occupancy_per_taxon.py +53 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/pairwise_identity.py +49 -4
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/parsimony_informative_sites.py +18 -2
- phykit-2.1.5/phykit/services/alignment/rcv.py +24 -0
- phykit-2.1.5/phykit/services/alignment/rcvt.py +88 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/rename_fasta_entries.py +29 -4
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/sum_of_pairs_score.py +16 -3
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/alignment/variable_sites.py +18 -2
- phykit-2.1.5/phykit/services/tree/__init__.py +46 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/base.py +1 -1
- phykit-2.1.5/phykit/services/tree/bipartition_support_stats.py +152 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/branch_length_multiplier.py +24 -4
- phykit-2.1.5/phykit/services/tree/collapse_branches.py +47 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/covarying_evolutionary_rates.py +59 -7
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/dvmc.py +8 -2
- phykit-2.1.5/phykit/services/tree/evolutionary_rate.py +24 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/hidden_paralogy_check.py +22 -1
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/internal_branch_stats.py +26 -2
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/internode_labeler.py +22 -3
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/last_common_ancestor_subtree.py +20 -1
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/lb_score.py +27 -2
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/monophyly_check.py +19 -1
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/nearest_neighbor_interchange.py +18 -2
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/patristic_distances.py +30 -2
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/polytomy_test.py +51 -11
- phykit-2.1.5/phykit/services/tree/print_tree.py +47 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/prune_tree.py +23 -1
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/rename_tree_tips.py +24 -4
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/rf_distance.py +17 -1
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/root_tree.py +19 -1
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/saturation.py +60 -14
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/spurious_sequence.py +25 -7
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/terminal_branch_stats.py +26 -2
- phykit-2.1.5/phykit/services/tree/tip_labels.py +26 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/tip_to_tip_distance.py +20 -2
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/tip_to_tip_node_distance.py +20 -2
- phykit-2.1.5/phykit/services/tree/total_tree_length.py +32 -0
- phykit-2.1.5/phykit/services/tree/treeness.py +23 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/tree/treeness_over_rcv.py +18 -1
- phykit-2.1.5/phykit/version.py +1 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit.egg-info/PKG-INFO +1 -1
- {phykit-2.1.2 → phykit-2.1.5}/phykit.egg-info/SOURCES.txt +5 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit.egg-info/entry_points.txt +12 -0
- {phykit-2.1.2 → phykit-2.1.5}/setup.py +12 -0
- phykit-2.1.2/phykit/services/alignment/__init__.py +0 -17
- phykit-2.1.2/phykit/services/alignment/alignment_length.py +0 -16
- phykit-2.1.2/phykit/services/alignment/faidx.py +0 -21
- phykit-2.1.2/phykit/services/alignment/rcv.py +0 -14
- phykit-2.1.2/phykit/services/alignment/rcvt.py +0 -47
- phykit-2.1.2/phykit/services/tree/__init__.py +0 -29
- phykit-2.1.2/phykit/services/tree/bipartition_support_stats.py +0 -48
- phykit-2.1.2/phykit/services/tree/collapse_branches.py +0 -27
- phykit-2.1.2/phykit/services/tree/evolutionary_rate.py +0 -17
- phykit-2.1.2/phykit/services/tree/print_tree.py +0 -28
- phykit-2.1.2/phykit/services/tree/tip_labels.py +0 -18
- phykit-2.1.2/phykit/services/tree/total_tree_length.py +0 -25
- phykit-2.1.2/phykit/services/tree/treeness.py +0 -16
- phykit-2.1.2/phykit/version.py +0 -1
- {phykit-2.1.2 → phykit-2.1.5}/LICENSE.md +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/README.md +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/__init__.py +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/__main__.py +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/helpers/__init__.py +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/helpers/boolean_argument_parsing.py +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/helpers/caching.py +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/helpers/files.py +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/helpers/parallel.py +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/helpers/stats_summary.py +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/helpers/streaming.py +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/__init__.py +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit/services/base.py +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit.egg-info/dependency_links.txt +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit.egg-info/requires.txt +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/phykit.egg-info/top_level.txt +0 -0
- {phykit-2.1.2 → phykit-2.1.5}/setup.cfg +0 -0
|
@@ -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
|