phykit 2.1.87__tar.gz → 2.1.88__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.87 → phykit-2.1.88}/PKG-INFO +1 -1
- {phykit-2.1.87 → phykit-2.1.88}/phykit/cli_registry.py +3 -0
- phykit-2.1.88/phykit/helpers/geological_timescale.py +119 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/phykit.py +72 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/service_factories.py +1 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/__init__.py +1 -0
- phykit-2.1.88/phykit/services/tree/chronogram.py +661 -0
- phykit-2.1.88/phykit/version.py +1 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit.egg-info/PKG-INFO +1 -1
- {phykit-2.1.87 → phykit-2.1.88}/phykit.egg-info/SOURCES.txt +2 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit.egg-info/entry_points.txt +3 -0
- phykit-2.1.87/phykit/version.py +0 -1
- {phykit-2.1.87 → phykit-2.1.88}/LICENSE.md +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/README.md +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/__init__.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/__main__.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/errors.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/__init__.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/boolean_argument_parsing.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/caching.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/circular_layout.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/color_annotations.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/discrete_models.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/files.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/json_output.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/parallel.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/parsimony_utils.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/pgls_utils.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/plot_config.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/quartet_utils.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/stats_summary.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/streaming.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/helpers/trait_parsing.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/__init__.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/__init__.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/alignment_entropy.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/alignment_length.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/alignment_length_no_gaps.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/alignment_outlier_taxa.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/alignment_recoding.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/alignment_subsample.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/base.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/column_score.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/composition_per_taxon.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/compositional_bias_per_site.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/create_concatenation_matrix.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/dfoil.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/dna_threader.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/dstatistic.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/evolutionary_rate_per_site.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/faidx.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/gc_content.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/identity_matrix.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/mask_alignment.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/occupancy_filter.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/occupancy_per_taxon.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/pairwise_identity.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/parsimony_informative_sites.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/phylo_gwas.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/plot_alignment_qc.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/rcv.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/rcvt.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/rename_fasta_entries.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/sum_of_pairs_score.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/taxon_groups.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/alignment/variable_sites.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/base.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/ancestral_reconstruction.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/base.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/bipartition_support_stats.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/branch_length_multiplier.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/character_map.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/collapse_branches.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/concordance_asr.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/consensus_network.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/consensus_tree.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/cont_map.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/cophylo.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/covarying_evolutionary_rates.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/density_map.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/discordance_asymmetry.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/dvmc.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/evo_tempo_map.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/evolutionary_rate.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/fit_continuous.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/fit_discrete.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/hidden_paralogy_check.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/hybridization.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/independent_contrasts.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/internal_branch_stats.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/internode_labeler.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/kf_distance.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/last_common_ancestor_subtree.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/lb_score.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/ltt.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/monophyly_check.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/nearest_neighbor_interchange.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/neighbor_net.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/network_signal.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/ou_shift_detection.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/ouwie.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/parsimony_score.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/patristic_distances.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/phenogram.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/phylo_anova.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/phylo_heatmap.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/phylo_impute.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/phylo_logistic.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/phylo_path.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/phylogenetic_glm.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/phylogenetic_ordination.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/phylogenetic_regression.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/phylogenetic_signal.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/phylomorphospace.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/polytomy_test.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/print_tree.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/prune_tree.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/quartet_network.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/quartet_pie.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/rate_heterogeneity.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/relative_rate_test.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/rename_tree_tips.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/rf_distance.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/root_tree.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/saturation.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/simmap_summary.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/spectral_discordance.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/spr.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/spurious_sequence.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/stochastic_character_map.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/terminal_branch_stats.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/threshold_model.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/tip_labels.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/tip_to_tip_distance.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/tip_to_tip_node_distance.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/total_tree_length.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/trait_correlation.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/trait_rate_map.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/transfer_annotations.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/tree_space.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/treeness.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/treeness_over_rcv.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit/services/tree/vcv_utils.py +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit.egg-info/dependency_links.txt +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit.egg-info/requires.txt +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/phykit.egg-info/top_level.txt +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/setup.cfg +0 -0
- {phykit-2.1.87 → phykit-2.1.88}/setup.py +0 -0
|
@@ -70,6 +70,9 @@ ALIAS_TO_HANDLER: Dict[str, str] = {
|
|
|
70
70
|
"blm": "branch_length_multiplier",
|
|
71
71
|
"collapse": "collapse_branches",
|
|
72
72
|
"cb": "collapse_branches",
|
|
73
|
+
"chronogram": "chronogram",
|
|
74
|
+
"chrono": "chronogram",
|
|
75
|
+
"time_tree": "chronogram",
|
|
73
76
|
"cover": "covarying_evolutionary_rates",
|
|
74
77
|
"consnet": "consensus_network",
|
|
75
78
|
"splitnet": "consensus_network",
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Geological timescale data (ICS 2024).
|
|
3
|
+
|
|
4
|
+
Provides era, period, and epoch boundaries for plotting chronograms
|
|
5
|
+
with geological time bands.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
# Muted pastel color palette for geological epochs
|
|
9
|
+
# Inspired by ICS colors but softened for publication figures
|
|
10
|
+
EPOCH_COLORS = {
|
|
11
|
+
"Holocene": "#FEF2CC",
|
|
12
|
+
"Pleistocene": "#FFF2AE",
|
|
13
|
+
"Pliocene": "#FFFF99",
|
|
14
|
+
"Miocene": "#FFFF00",
|
|
15
|
+
"Oligocene": "#FDC07A",
|
|
16
|
+
"Eocene": "#FDB46C",
|
|
17
|
+
"Paleocene": "#FDA75F",
|
|
18
|
+
"Late Cretaceous": "#A6D84A",
|
|
19
|
+
"Early Cretaceous": "#8CCD57",
|
|
20
|
+
"Late Jurassic": "#B3E1EB",
|
|
21
|
+
"Middle Jurassic": "#80CFD8",
|
|
22
|
+
"Early Jurassic": "#42B2D0",
|
|
23
|
+
"Late Triassic": "#BD8CC2",
|
|
24
|
+
"Middle Triassic": "#B07FB7",
|
|
25
|
+
"Early Triassic": "#A372AB",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
PERIOD_COLORS = {
|
|
29
|
+
"Quaternary": "#F9F97F",
|
|
30
|
+
"Neogene": "#FFE619",
|
|
31
|
+
"Paleogene": "#FD9A52",
|
|
32
|
+
"Cretaceous": "#7FC64E",
|
|
33
|
+
"Jurassic": "#34B2C9",
|
|
34
|
+
"Triassic": "#812B92",
|
|
35
|
+
"Permian": "#F04028",
|
|
36
|
+
"Carboniferous": "#67A599",
|
|
37
|
+
"Devonian": "#CB8C37",
|
|
38
|
+
"Silurian": "#B3E1B6",
|
|
39
|
+
"Ordovician": "#009270",
|
|
40
|
+
"Cambrian": "#7FA056",
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
ERA_COLORS = {
|
|
44
|
+
"Cenozoic": "#F2F91D",
|
|
45
|
+
"Mesozoic": "#67C5CA",
|
|
46
|
+
"Paleozoic": "#99C08D",
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
EPOCHS = [
|
|
50
|
+
("Holocene", 0.0117, 0),
|
|
51
|
+
("Pleistocene", 2.58, 0.0117),
|
|
52
|
+
("Pliocene", 5.333, 2.58),
|
|
53
|
+
("Miocene", 23.03, 5.333),
|
|
54
|
+
("Oligocene", 33.9, 23.03),
|
|
55
|
+
("Eocene", 56.0, 33.9),
|
|
56
|
+
("Paleocene", 66.0, 56.0),
|
|
57
|
+
("Late Cretaceous", 100.5, 66.0),
|
|
58
|
+
("Early Cretaceous", 145.0, 100.5),
|
|
59
|
+
("Late Jurassic", 163.5, 145.0),
|
|
60
|
+
("Middle Jurassic", 174.7, 163.5),
|
|
61
|
+
("Early Jurassic", 201.4, 174.7),
|
|
62
|
+
("Late Triassic", 237.0, 201.4),
|
|
63
|
+
("Middle Triassic", 247.2, 237.0),
|
|
64
|
+
("Early Triassic", 251.902, 247.2),
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
PERIODS = [
|
|
68
|
+
("Quaternary", 2.58, 0),
|
|
69
|
+
("Neogene", 23.03, 2.58),
|
|
70
|
+
("Paleogene", 66.0, 23.03),
|
|
71
|
+
("Cretaceous", 145.0, 66.0),
|
|
72
|
+
("Jurassic", 201.4, 145.0),
|
|
73
|
+
("Triassic", 251.902, 201.4),
|
|
74
|
+
("Permian", 298.9, 251.902),
|
|
75
|
+
("Carboniferous", 358.9, 298.9),
|
|
76
|
+
("Devonian", 419.2, 358.9),
|
|
77
|
+
("Silurian", 443.8, 419.2),
|
|
78
|
+
("Ordovician", 485.4, 443.8),
|
|
79
|
+
("Cambrian", 538.8, 485.4),
|
|
80
|
+
]
|
|
81
|
+
|
|
82
|
+
ERAS = [
|
|
83
|
+
("Cenozoic", 66.0, 0),
|
|
84
|
+
("Mesozoic", 251.902, 66.0),
|
|
85
|
+
("Paleozoic", 538.8, 251.902),
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def get_timescale_for_range(root_age, level="auto"):
|
|
90
|
+
"""Return appropriate timescale intervals for a given root age.
|
|
91
|
+
|
|
92
|
+
Parameters
|
|
93
|
+
----------
|
|
94
|
+
root_age : float, Ma
|
|
95
|
+
level : "epoch", "period", "era", or "auto"
|
|
96
|
+
|
|
97
|
+
Returns
|
|
98
|
+
-------
|
|
99
|
+
list of (name, start_ma, end_ma), color_dict
|
|
100
|
+
"""
|
|
101
|
+
if level == "auto":
|
|
102
|
+
if root_age <= 66:
|
|
103
|
+
level = "epoch"
|
|
104
|
+
elif root_age <= 252:
|
|
105
|
+
level = "period"
|
|
106
|
+
else:
|
|
107
|
+
level = "era"
|
|
108
|
+
|
|
109
|
+
if level == "epoch":
|
|
110
|
+
intervals = [(n, s, e) for n, s, e in EPOCHS if s > 0 and e < root_age * 1.1]
|
|
111
|
+
# Include any epoch that overlaps the tree's range
|
|
112
|
+
intervals = [(n, s, e) for n, s, e in EPOCHS if e < root_age * 1.05]
|
|
113
|
+
return intervals, EPOCH_COLORS
|
|
114
|
+
elif level == "period":
|
|
115
|
+
intervals = [(n, s, e) for n, s, e in PERIODS if e < root_age * 1.05]
|
|
116
|
+
return intervals, PERIOD_COLORS
|
|
117
|
+
else:
|
|
118
|
+
intervals = [(n, s, e) for n, s, e in ERAS if e < root_age * 1.05]
|
|
119
|
+
return intervals, ERA_COLORS
|
|
@@ -192,6 +192,8 @@ class Phykit:
|
|
|
192
192
|
concordance_asr (alias: conc_asr; casr)
|
|
193
193
|
- concordance-aware ancestral state reconstruction
|
|
194
194
|
incorporating gene tree discordance
|
|
195
|
+
chronogram (alias: chrono; time_tree)
|
|
196
|
+
- plot a time-calibrated tree with geological timescale
|
|
195
197
|
bipartition_support_stats (alias: bss)
|
|
196
198
|
- calculates summary statistics for bipartition support
|
|
197
199
|
branch_length_multiplier (alias: blm)
|
|
@@ -2922,6 +2924,72 @@ class Phykit:
|
|
|
2922
2924
|
_add_json_argument(parser)
|
|
2923
2925
|
_run_service(parser, argv, ConcordanceAsr)
|
|
2924
2926
|
|
|
2927
|
+
@staticmethod
|
|
2928
|
+
def chronogram(argv):
|
|
2929
|
+
parser = _new_parser(
|
|
2930
|
+
description=textwrap.dedent(
|
|
2931
|
+
f"""\
|
|
2932
|
+
{help_header}
|
|
2933
|
+
|
|
2934
|
+
Plot a chronogram (time-calibrated phylogeny) with
|
|
2935
|
+
geological timescale bands. Requires an ultrametric
|
|
2936
|
+
tree and the root age in millions of years (Ma).
|
|
2937
|
+
|
|
2938
|
+
Geological epoch/period/era bands are drawn behind
|
|
2939
|
+
the tree as colored stripes, with labels along the
|
|
2940
|
+
top. The time axis runs from past (left) to present
|
|
2941
|
+
(right).
|
|
2942
|
+
|
|
2943
|
+
Aliases:
|
|
2944
|
+
chronogram, chrono, time_tree
|
|
2945
|
+
Command line interfaces:
|
|
2946
|
+
pk_chronogram, pk_chrono, pk_time_tree
|
|
2947
|
+
|
|
2948
|
+
Usage:
|
|
2949
|
+
phykit chronogram -t <tree> --root-age <float>
|
|
2950
|
+
--plot-output <file> [--timescale auto|epoch|period|era]
|
|
2951
|
+
[--node-ages] [--circular] [--ladderize]
|
|
2952
|
+
[--color-file <file>] [--json]
|
|
2953
|
+
|
|
2954
|
+
Options
|
|
2955
|
+
=====================================================
|
|
2956
|
+
-t/--tree ultrametric tree file
|
|
2957
|
+
(required)
|
|
2958
|
+
|
|
2959
|
+
--root-age age of the root in Ma
|
|
2960
|
+
(required)
|
|
2961
|
+
|
|
2962
|
+
--plot-output output figure path
|
|
2963
|
+
(required; .png, .pdf, .svg)
|
|
2964
|
+
|
|
2965
|
+
--timescale timescale level: auto
|
|
2966
|
+
(default), epoch, period,
|
|
2967
|
+
or era. Auto selects based
|
|
2968
|
+
on root age.
|
|
2969
|
+
|
|
2970
|
+
--node-ages label internal nodes with
|
|
2971
|
+
divergence times (Ma)
|
|
2972
|
+
|
|
2973
|
+
--circular draw circular chronogram
|
|
2974
|
+
|
|
2975
|
+
--ladderize ladderize the tree
|
|
2976
|
+
|
|
2977
|
+
--color-file color annotation file
|
|
2978
|
+
(iTOL-inspired TSV)
|
|
2979
|
+
|
|
2980
|
+
--json output node ages as JSON
|
|
2981
|
+
"""
|
|
2982
|
+
),
|
|
2983
|
+
)
|
|
2984
|
+
parser.add_argument("-t", "--tree", type=str, required=True, help=SUPPRESS, metavar="")
|
|
2985
|
+
parser.add_argument("--root-age", type=float, required=True, help=SUPPRESS, metavar="")
|
|
2986
|
+
parser.add_argument("--plot-output", type=str, required=True, help=SUPPRESS, metavar="")
|
|
2987
|
+
parser.add_argument("--timescale", type=str, default="auto", choices=["auto", "epoch", "period", "era"], help=SUPPRESS, metavar="")
|
|
2988
|
+
parser.add_argument("--node-ages", action="store_true", help=SUPPRESS)
|
|
2989
|
+
add_plot_arguments(parser)
|
|
2990
|
+
_add_json_argument(parser)
|
|
2991
|
+
_run_service(parser, argv, Chronogram)
|
|
2992
|
+
|
|
2925
2993
|
@staticmethod
|
|
2926
2994
|
def bipartition_support_stats(argv):
|
|
2927
2995
|
parser = _new_parser(
|
|
@@ -9069,6 +9137,10 @@ def concordance_asr(argv=None):
|
|
|
9069
9137
|
Phykit.concordance_asr(sys.argv[1:])
|
|
9070
9138
|
|
|
9071
9139
|
|
|
9140
|
+
def chronogram(argv=None):
|
|
9141
|
+
Phykit.chronogram(sys.argv[1:])
|
|
9142
|
+
|
|
9143
|
+
|
|
9072
9144
|
def bipartition_support_stats(argv=None):
|
|
9073
9145
|
Phykit.bipartition_support_stats(sys.argv[1:])
|
|
9074
9146
|
|
|
@@ -59,6 +59,7 @@ BipartitionSupportStats = _LazyServiceFactory("phykit.services.tree.bipartition_
|
|
|
59
59
|
BranchLengthMultiplier = _LazyServiceFactory("phykit.services.tree.branch_length_multiplier", "BranchLengthMultiplier")
|
|
60
60
|
CollapseBranches = _LazyServiceFactory("phykit.services.tree.collapse_branches", "CollapseBranches")
|
|
61
61
|
CovaryingEvolutionaryRates = _LazyServiceFactory("phykit.services.tree.covarying_evolutionary_rates", "CovaryingEvolutionaryRates")
|
|
62
|
+
Chronogram = _LazyServiceFactory("phykit.services.tree.chronogram", "Chronogram")
|
|
62
63
|
ConsensusNetwork = _LazyServiceFactory("phykit.services.tree.consensus_network", "ConsensusNetwork")
|
|
63
64
|
NeighborNet = _LazyServiceFactory("phykit.services.tree.neighbor_net", "NeighborNet")
|
|
64
65
|
ConsensusTree = _LazyServiceFactory("phykit.services.tree.consensus_tree", "ConsensusTree")
|
|
@@ -5,6 +5,7 @@ _EXPORTS = {
|
|
|
5
5
|
"BipartitionSupportStats": "bipartition_support_stats",
|
|
6
6
|
"BranchLengthMultiplier": "branch_length_multiplier",
|
|
7
7
|
"CollapseBranches": "collapse_branches",
|
|
8
|
+
"Chronogram": "chronogram",
|
|
8
9
|
"CovaryingEvolutionaryRates": "covarying_evolutionary_rates",
|
|
9
10
|
"ConsensusNetwork": "consensus_network",
|
|
10
11
|
"NeighborNet": "neighbor_net",
|