phykit 2.1.27__tar.gz → 2.1.30__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.27 → phykit-2.1.30}/PKG-INFO +1 -1
- {phykit-2.1.27 → phykit-2.1.30}/phykit/cli_registry.py +6 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/phykit.py +240 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/service_factories.py +2 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/__init__.py +2 -0
- phykit-2.1.30/phykit/services/tree/concordance_asr.py +855 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/fit_continuous.py +43 -26
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/ouwie.py +52 -3
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/phylogenetic_glm.py +62 -23
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/phylogenetic_ordination.py +26 -28
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/phylogenetic_regression.py +50 -28
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/phylogenetic_signal.py +51 -25
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/rate_heterogeneity.py +23 -2
- phykit-2.1.30/phykit/services/tree/threshold_model.py +876 -0
- phykit-2.1.30/phykit/services/tree/vcv_utils.py +194 -0
- phykit-2.1.30/phykit/version.py +1 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit.egg-info/PKG-INFO +1 -1
- {phykit-2.1.27 → phykit-2.1.30}/phykit.egg-info/SOURCES.txt +4 -1
- {phykit-2.1.27 → phykit-2.1.30}/phykit.egg-info/entry_points.txt +8 -0
- {phykit-2.1.27 → phykit-2.1.30}/setup.py +8 -0
- phykit-2.1.27/phykit/version.py +0 -1
- {phykit-2.1.27 → phykit-2.1.30}/LICENSE.md +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/README.md +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/__init__.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/__main__.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/errors.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/helpers/__init__.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/helpers/boolean_argument_parsing.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/helpers/caching.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/helpers/files.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/helpers/json_output.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/helpers/parallel.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/helpers/stats_summary.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/helpers/streaming.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/__init__.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/__init__.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/alignment_entropy.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/alignment_length.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/alignment_length_no_gaps.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/alignment_outlier_taxa.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/alignment_recoding.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/base.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/column_score.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/composition_per_taxon.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/compositional_bias_per_site.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/create_concatenation_matrix.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/dna_threader.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/evolutionary_rate_per_site.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/faidx.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/gc_content.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/mask_alignment.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/occupancy_per_taxon.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/pairwise_identity.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/parsimony_informative_sites.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/plot_alignment_qc.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/rcv.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/rcvt.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/rename_fasta_entries.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/sum_of_pairs_score.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/alignment/variable_sites.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/base.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/ancestral_reconstruction.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/base.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/bipartition_support_stats.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/branch_length_multiplier.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/collapse_branches.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/consensus_network.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/consensus_tree.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/cont_map.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/cophylo.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/covarying_evolutionary_rates.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/density_map.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/dvmc.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/evolutionary_rate.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/hidden_paralogy_check.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/internal_branch_stats.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/internode_labeler.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/last_common_ancestor_subtree.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/lb_score.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/ltt.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/monophyly_check.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/nearest_neighbor_interchange.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/network_signal.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/ou_shift_detection.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/patristic_distances.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/phenogram.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/phylomorphospace.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/polytomy_test.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/print_tree.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/prune_tree.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/quartet_network.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/relative_rate_test.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/rename_tree_tips.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/rf_distance.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/root_tree.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/saturation.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/spurious_sequence.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/stochastic_character_map.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/terminal_branch_stats.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/tip_labels.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/tip_to_tip_distance.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/tip_to_tip_node_distance.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/total_tree_length.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/treeness.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit/services/tree/treeness_over_rcv.py +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit.egg-info/dependency_links.txt +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit.egg-info/requires.txt +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/phykit.egg-info/top_level.txt +0 -0
- {phykit-2.1.27 → phykit-2.1.30}/setup.cfg +0 -0
|
@@ -88,6 +88,8 @@ ALIAS_TO_HANDLER: Dict[str, str] = {
|
|
|
88
88
|
"pglm": "phylogenetic_glm",
|
|
89
89
|
"asr": "ancestral_state_reconstruction",
|
|
90
90
|
"anc_recon": "ancestral_state_reconstruction",
|
|
91
|
+
"conc_asr": "concordance_asr",
|
|
92
|
+
"casr": "concordance_asr",
|
|
91
93
|
"simmap": "stochastic_character_map",
|
|
92
94
|
"scm": "stochastic_character_map",
|
|
93
95
|
"contmap": "cont_map",
|
|
@@ -146,6 +148,10 @@ ALIAS_TO_HANDLER: Dict[str, str] = {
|
|
|
146
148
|
"tness": "treeness",
|
|
147
149
|
# Alignment- and tree-based aliases
|
|
148
150
|
"sat": "saturation",
|
|
151
|
+
"threshold": "threshold_model",
|
|
152
|
+
"thresh": "threshold_model",
|
|
153
|
+
"threshbayes": "threshold_model",
|
|
154
|
+
"thresh_bayes": "threshold_model",
|
|
149
155
|
"toverr": "treeness_over_rcv",
|
|
150
156
|
"tor": "treeness_over_rcv",
|
|
151
157
|
# Helper aliases
|
|
@@ -163,6 +163,9 @@ class Phykit:
|
|
|
163
163
|
ancestral_state_reconstruction (alias: asr; anc_recon)
|
|
164
164
|
- estimate ancestral states for continuous traits using
|
|
165
165
|
ML (fast or VCV-based) with optional contMap plot
|
|
166
|
+
concordance_asr (alias: conc_asr; casr)
|
|
167
|
+
- concordance-aware ancestral state reconstruction
|
|
168
|
+
incorporating gene tree discordance
|
|
166
169
|
bipartition_support_stats (alias: bss)
|
|
167
170
|
- calculates summary statistics for bipartition support
|
|
168
171
|
branch_length_multiplier (alias: blm)
|
|
@@ -240,6 +243,9 @@ class Phykit:
|
|
|
240
243
|
gamma statistic for diversification rate testing
|
|
241
244
|
network_signal (alias: netsig; net_signal)
|
|
242
245
|
- phylogenetic signal on a network
|
|
246
|
+
threshold_model (alias: threshold; thresh; threshbayes)
|
|
247
|
+
- Felsenstein (2012) threshold model for
|
|
248
|
+
trait correlation via MCMC
|
|
243
249
|
polytomy_test (alias: polyt_test; polyt; ptt)
|
|
244
250
|
- conducts a polytomy test using gene
|
|
245
251
|
support frequencies
|
|
@@ -1541,6 +1547,98 @@ class Phykit:
|
|
|
1541
1547
|
_add_json_argument(parser)
|
|
1542
1548
|
_run_service(parser, argv, AncestralReconstruction)
|
|
1543
1549
|
|
|
1550
|
+
@staticmethod
|
|
1551
|
+
def concordance_asr(argv):
|
|
1552
|
+
parser = _new_parser(
|
|
1553
|
+
description=textwrap.dedent(
|
|
1554
|
+
f"""\
|
|
1555
|
+
{help_header}
|
|
1556
|
+
|
|
1557
|
+
Concordance-aware ancestral state reconstruction (ASR)
|
|
1558
|
+
that incorporates gene tree discordance into ancestral
|
|
1559
|
+
estimates. Standard ASR operates on a single species tree
|
|
1560
|
+
and ignores gene tree conflict. This command propagates
|
|
1561
|
+
topological uncertainty from gene tree discordance into
|
|
1562
|
+
ancestral state estimates using gene concordance factors.
|
|
1563
|
+
|
|
1564
|
+
Two methods are available:
|
|
1565
|
+
- weighted (default): concordance-weighted ASR on the
|
|
1566
|
+
species tree with NNI alternatives, using law of total
|
|
1567
|
+
variance to separate topological vs parameter uncertainty
|
|
1568
|
+
- distribution: reconstruct on each gene tree independently,
|
|
1569
|
+
map nodes by descendant-set identity, report concordance-
|
|
1570
|
+
weighted means and percentile CIs
|
|
1571
|
+
|
|
1572
|
+
Aliases:
|
|
1573
|
+
concordance_asr, conc_asr, casr
|
|
1574
|
+
Command line interfaces:
|
|
1575
|
+
pk_concordance_asr, pk_conc_asr, pk_casr
|
|
1576
|
+
|
|
1577
|
+
Usage:
|
|
1578
|
+
phykit concordance_asr -t <species_tree> -g <gene_trees> -d <trait_data>
|
|
1579
|
+
[-c <trait>] [-m weighted|distribution] [--ci]
|
|
1580
|
+
[--plot <output>] [--missing-taxa error|shared] [--json]
|
|
1581
|
+
|
|
1582
|
+
Options
|
|
1583
|
+
=====================================================
|
|
1584
|
+
-t/--tree species tree file
|
|
1585
|
+
|
|
1586
|
+
-g/--gene-trees file with gene trees (multi-
|
|
1587
|
+
Newick, one per line)
|
|
1588
|
+
|
|
1589
|
+
-d/--trait_data trait data file (2-column or
|
|
1590
|
+
multi-trait with header)
|
|
1591
|
+
|
|
1592
|
+
-c/--trait trait column name (required
|
|
1593
|
+
for multi-trait files)
|
|
1594
|
+
|
|
1595
|
+
-m/--method method: weighted or distribution
|
|
1596
|
+
(default: weighted)
|
|
1597
|
+
|
|
1598
|
+
--ci include 95%% confidence
|
|
1599
|
+
intervals
|
|
1600
|
+
|
|
1601
|
+
--plot output path for concordance
|
|
1602
|
+
ASR plot
|
|
1603
|
+
|
|
1604
|
+
--missing-taxa how to handle taxa mismatches:
|
|
1605
|
+
shared (default) or error
|
|
1606
|
+
|
|
1607
|
+
--json output results as JSON
|
|
1608
|
+
"""
|
|
1609
|
+
),
|
|
1610
|
+
)
|
|
1611
|
+
parser.add_argument(
|
|
1612
|
+
"-t", "--tree", type=str, required=True, help=SUPPRESS, metavar=""
|
|
1613
|
+
)
|
|
1614
|
+
parser.add_argument(
|
|
1615
|
+
"-g", "--gene-trees", type=str, required=True, help=SUPPRESS, metavar=""
|
|
1616
|
+
)
|
|
1617
|
+
parser.add_argument(
|
|
1618
|
+
"-d", "--trait_data", type=str, required=True, help=SUPPRESS, metavar=""
|
|
1619
|
+
)
|
|
1620
|
+
parser.add_argument(
|
|
1621
|
+
"-c", "--trait", type=str, required=False, default=None,
|
|
1622
|
+
help=SUPPRESS, metavar=""
|
|
1623
|
+
)
|
|
1624
|
+
parser.add_argument(
|
|
1625
|
+
"-m", "--method", type=str, required=False, default="weighted",
|
|
1626
|
+
choices=["weighted", "distribution"], help=SUPPRESS, metavar=""
|
|
1627
|
+
)
|
|
1628
|
+
parser.add_argument(
|
|
1629
|
+
"--ci", action="store_true", required=False, help=SUPPRESS
|
|
1630
|
+
)
|
|
1631
|
+
parser.add_argument(
|
|
1632
|
+
"--plot", type=str, required=False, default=None,
|
|
1633
|
+
help=SUPPRESS, metavar=""
|
|
1634
|
+
)
|
|
1635
|
+
parser.add_argument(
|
|
1636
|
+
"--missing-taxa", type=str, required=False, default="shared",
|
|
1637
|
+
choices=["error", "shared"], help=SUPPRESS, metavar=""
|
|
1638
|
+
)
|
|
1639
|
+
_add_json_argument(parser)
|
|
1640
|
+
_run_service(parser, argv, ConcordanceAsr)
|
|
1641
|
+
|
|
1544
1642
|
@staticmethod
|
|
1545
1643
|
def bipartition_support_stats(argv):
|
|
1546
1644
|
parser = _new_parser(
|
|
@@ -2291,6 +2389,10 @@ class Phykit:
|
|
|
2291
2389
|
-p/--permutations number of permutations for
|
|
2292
2390
|
blombergs_k (default: 1000)
|
|
2293
2391
|
|
|
2392
|
+
-g/--gene-trees optional multi-Newick file of
|
|
2393
|
+
gene trees for discordance-aware
|
|
2394
|
+
VCV computation
|
|
2395
|
+
|
|
2294
2396
|
--json optional argument to output
|
|
2295
2397
|
results as JSON
|
|
2296
2398
|
"""
|
|
@@ -2321,6 +2423,10 @@ class Phykit:
|
|
|
2321
2423
|
help=SUPPRESS,
|
|
2322
2424
|
metavar="",
|
|
2323
2425
|
)
|
|
2426
|
+
parser.add_argument(
|
|
2427
|
+
"-g", "--gene-trees", type=str, required=False, default=None,
|
|
2428
|
+
help=SUPPRESS, metavar=""
|
|
2429
|
+
)
|
|
2324
2430
|
_add_json_argument(parser)
|
|
2325
2431
|
_run_service(parser, argv, PhylogeneticSignal)
|
|
2326
2432
|
|
|
@@ -2405,6 +2511,10 @@ class Phykit:
|
|
|
2405
2511
|
--plot-output output path for plot
|
|
2406
2512
|
(default: phylo_ordination_plot.png)
|
|
2407
2513
|
|
|
2514
|
+
-g/--gene-trees optional multi-Newick file of
|
|
2515
|
+
gene trees for discordance-aware
|
|
2516
|
+
VCV computation
|
|
2517
|
+
|
|
2408
2518
|
--json optional argument to output
|
|
2409
2519
|
results as JSON
|
|
2410
2520
|
"""
|
|
@@ -2509,6 +2619,10 @@ class Phykit:
|
|
|
2509
2619
|
required=False,
|
|
2510
2620
|
help=SUPPRESS,
|
|
2511
2621
|
)
|
|
2622
|
+
parser.add_argument(
|
|
2623
|
+
"-g", "--gene-trees", type=str, required=False, default=None,
|
|
2624
|
+
help=SUPPRESS, metavar=""
|
|
2625
|
+
)
|
|
2512
2626
|
_add_json_argument(parser)
|
|
2513
2627
|
_run_service(parser, argv, PhylogeneticOrdination)
|
|
2514
2628
|
|
|
@@ -2662,6 +2776,10 @@ class Phykit:
|
|
|
2662
2776
|
-m/--method method to use: BM or lambda
|
|
2663
2777
|
(default: BM)
|
|
2664
2778
|
|
|
2779
|
+
-g/--gene-trees optional multi-Newick file of
|
|
2780
|
+
gene trees for discordance-aware
|
|
2781
|
+
VCV computation
|
|
2782
|
+
|
|
2665
2783
|
--json optional argument to output
|
|
2666
2784
|
results as JSON
|
|
2667
2785
|
"""
|
|
@@ -2695,6 +2813,10 @@ class Phykit:
|
|
|
2695
2813
|
help=SUPPRESS,
|
|
2696
2814
|
metavar="",
|
|
2697
2815
|
)
|
|
2816
|
+
parser.add_argument(
|
|
2817
|
+
"-g", "--gene-trees", type=str, required=False, default=None,
|
|
2818
|
+
help=SUPPRESS, metavar=""
|
|
2819
|
+
)
|
|
2698
2820
|
_add_json_argument(parser)
|
|
2699
2821
|
_run_service(parser, argv, PhylogeneticRegression)
|
|
2700
2822
|
|
|
@@ -2758,6 +2880,10 @@ class Phykit:
|
|
|
2758
2880
|
--log-alpha-bound bound on log(alpha*Tmax) for
|
|
2759
2881
|
logistic model (default: 4)
|
|
2760
2882
|
|
|
2883
|
+
-g/--gene-trees optional multi-Newick file of
|
|
2884
|
+
gene trees for discordance-aware
|
|
2885
|
+
VCV computation
|
|
2886
|
+
|
|
2761
2887
|
--json optional argument to output
|
|
2762
2888
|
results as JSON
|
|
2763
2889
|
"""
|
|
@@ -2815,6 +2941,10 @@ class Phykit:
|
|
|
2815
2941
|
help=SUPPRESS,
|
|
2816
2942
|
metavar="",
|
|
2817
2943
|
)
|
|
2944
|
+
parser.add_argument(
|
|
2945
|
+
"-g", "--gene-trees", type=str, required=False, default=None,
|
|
2946
|
+
help=SUPPRESS, metavar=""
|
|
2947
|
+
)
|
|
2818
2948
|
_add_json_argument(parser)
|
|
2819
2949
|
_run_service(parser, argv, PhylogeneticGLM)
|
|
2820
2950
|
|
|
@@ -3258,6 +3388,10 @@ class Phykit:
|
|
|
3258
3388
|
--models comma-separated list of models
|
|
3259
3389
|
to fit (default: all 7)
|
|
3260
3390
|
|
|
3391
|
+
-g/--gene-trees optional multi-Newick file of
|
|
3392
|
+
gene trees for discordance-aware
|
|
3393
|
+
VCV computation
|
|
3394
|
+
|
|
3261
3395
|
--json optional argument to output
|
|
3262
3396
|
results as JSON
|
|
3263
3397
|
"""
|
|
@@ -3273,6 +3407,10 @@ class Phykit:
|
|
|
3273
3407
|
"--models", type=str, required=False, default=None,
|
|
3274
3408
|
help=SUPPRESS, metavar=""
|
|
3275
3409
|
)
|
|
3410
|
+
parser.add_argument(
|
|
3411
|
+
"-g", "--gene-trees", type=str, required=False, default=None,
|
|
3412
|
+
help=SUPPRESS, metavar=""
|
|
3413
|
+
)
|
|
3276
3414
|
_add_json_argument(parser)
|
|
3277
3415
|
_run_service(parser, argv, FitContinuous)
|
|
3278
3416
|
|
|
@@ -4019,6 +4157,100 @@ class Phykit:
|
|
|
4019
4157
|
_add_json_argument(parser)
|
|
4020
4158
|
_run_service(parser, argv, RelativeRateTest)
|
|
4021
4159
|
|
|
4160
|
+
@staticmethod
|
|
4161
|
+
def threshold_model(argv):
|
|
4162
|
+
parser = _new_parser(
|
|
4163
|
+
description=textwrap.dedent(
|
|
4164
|
+
f"""\
|
|
4165
|
+
{help_header}
|
|
4166
|
+
|
|
4167
|
+
Felsenstein (2012) threshold model.
|
|
4168
|
+
|
|
4169
|
+
Estimates the correlation between two traits (binary
|
|
4170
|
+
discrete and/or continuous) using a latent-liability
|
|
4171
|
+
Brownian motion model and MCMC sampling. Binary
|
|
4172
|
+
discrete characters are modelled as arising from
|
|
4173
|
+
continuous liabilities that cross a threshold at 0.
|
|
4174
|
+
|
|
4175
|
+
This is the equivalent of phytools::threshBayes in R.
|
|
4176
|
+
|
|
4177
|
+
Aliases:
|
|
4178
|
+
threshold_model, threshold, thresh, threshbayes,
|
|
4179
|
+
thresh_bayes
|
|
4180
|
+
Command line interfaces:
|
|
4181
|
+
pk_threshold_model, pk_threshold, pk_thresh,
|
|
4182
|
+
pk_threshbayes, pk_thresh_bayes
|
|
4183
|
+
|
|
4184
|
+
Usage:
|
|
4185
|
+
phykit threshold_model -t <tree> -d <trait_data>
|
|
4186
|
+
--traits <trait1,trait2> --types <type1,type2>
|
|
4187
|
+
[--ngen 100000] [--sample 100] [--burnin 0.2]
|
|
4188
|
+
[--seed <int>] [--plot <file>] [--json]
|
|
4189
|
+
|
|
4190
|
+
Options
|
|
4191
|
+
=====================================================
|
|
4192
|
+
-t/--tree a rooted phylogeny file
|
|
4193
|
+
with branch lengths
|
|
4194
|
+
(required)
|
|
4195
|
+
|
|
4196
|
+
-d/--trait-data tab-delimited trait file
|
|
4197
|
+
with header row (required)
|
|
4198
|
+
|
|
4199
|
+
--traits comma-separated pair of
|
|
4200
|
+
trait column names
|
|
4201
|
+
|
|
4202
|
+
--types comma-separated pair of
|
|
4203
|
+
trait types (discrete or
|
|
4204
|
+
continuous)
|
|
4205
|
+
|
|
4206
|
+
--ngen number of MCMC generations
|
|
4207
|
+
(default: 100000)
|
|
4208
|
+
|
|
4209
|
+
--sample sample frequency
|
|
4210
|
+
(default: 100)
|
|
4211
|
+
|
|
4212
|
+
--burnin burn-in fraction
|
|
4213
|
+
(default: 0.2)
|
|
4214
|
+
|
|
4215
|
+
--seed random seed for
|
|
4216
|
+
reproducibility
|
|
4217
|
+
|
|
4218
|
+
--plot output filename for
|
|
4219
|
+
trace plots (optional)
|
|
4220
|
+
|
|
4221
|
+
--json optional argument to output
|
|
4222
|
+
results as JSON
|
|
4223
|
+
"""
|
|
4224
|
+
),
|
|
4225
|
+
)
|
|
4226
|
+
parser.add_argument("-t", "--tree", type=str, required=True, help=SUPPRESS)
|
|
4227
|
+
parser.add_argument(
|
|
4228
|
+
"-d", "--trait-data", dest="trait_data", type=str, required=True, help=SUPPRESS
|
|
4229
|
+
)
|
|
4230
|
+
parser.add_argument(
|
|
4231
|
+
"--traits", type=str, required=True, help=SUPPRESS
|
|
4232
|
+
)
|
|
4233
|
+
parser.add_argument(
|
|
4234
|
+
"--types", type=str, required=True, help=SUPPRESS
|
|
4235
|
+
)
|
|
4236
|
+
parser.add_argument(
|
|
4237
|
+
"--ngen", type=int, default=100000, required=False, help=SUPPRESS
|
|
4238
|
+
)
|
|
4239
|
+
parser.add_argument(
|
|
4240
|
+
"--sample", type=int, default=100, required=False, help=SUPPRESS
|
|
4241
|
+
)
|
|
4242
|
+
parser.add_argument(
|
|
4243
|
+
"--burnin", type=float, default=0.2, required=False, help=SUPPRESS
|
|
4244
|
+
)
|
|
4245
|
+
parser.add_argument(
|
|
4246
|
+
"--seed", type=int, default=None, required=False, help=SUPPRESS
|
|
4247
|
+
)
|
|
4248
|
+
parser.add_argument(
|
|
4249
|
+
"--plot", dest="plot_output", type=str, default=None, required=False, help=SUPPRESS
|
|
4250
|
+
)
|
|
4251
|
+
_add_json_argument(parser)
|
|
4252
|
+
_run_service(parser, argv, ThresholdModel)
|
|
4253
|
+
|
|
4022
4254
|
@staticmethod
|
|
4023
4255
|
def rename_tree_tips(argv):
|
|
4024
4256
|
parser = _new_parser(
|
|
@@ -4852,6 +5084,10 @@ def ancestral_state_reconstruction(argv=None):
|
|
|
4852
5084
|
Phykit.ancestral_state_reconstruction(sys.argv[1:])
|
|
4853
5085
|
|
|
4854
5086
|
|
|
5087
|
+
def concordance_asr(argv=None):
|
|
5088
|
+
Phykit.concordance_asr(sys.argv[1:])
|
|
5089
|
+
|
|
5090
|
+
|
|
4855
5091
|
def bipartition_support_stats(argv=None):
|
|
4856
5092
|
Phykit.bipartition_support_stats(sys.argv[1:])
|
|
4857
5093
|
|
|
@@ -5008,6 +5244,10 @@ def relative_rate_test(argv=None):
|
|
|
5008
5244
|
Phykit.relative_rate_test(sys.argv[1:])
|
|
5009
5245
|
|
|
5010
5246
|
|
|
5247
|
+
def threshold_model(argv=None):
|
|
5248
|
+
Phykit.threshold_model(sys.argv[1:])
|
|
5249
|
+
|
|
5250
|
+
|
|
5011
5251
|
def rename_tree_tips(argv=None):
|
|
5012
5252
|
Phykit.rename_tree_tips(sys.argv[1:])
|
|
5013
5253
|
|
|
@@ -43,6 +43,7 @@ SumOfPairsScore = _LazyServiceFactory("phykit.services.alignment.sum_of_pairs_sc
|
|
|
43
43
|
VariableSites = _LazyServiceFactory("phykit.services.alignment.variable_sites", "VariableSites")
|
|
44
44
|
|
|
45
45
|
AncestralReconstruction = _LazyServiceFactory("phykit.services.tree.ancestral_reconstruction", "AncestralReconstruction")
|
|
46
|
+
ConcordanceAsr = _LazyServiceFactory("phykit.services.tree.concordance_asr", "ConcordanceAsr")
|
|
46
47
|
|
|
47
48
|
# Tree service loaders
|
|
48
49
|
BipartitionSupportStats = _LazyServiceFactory("phykit.services.tree.bipartition_support_stats", "BipartitionSupportStats")
|
|
@@ -79,6 +80,7 @@ QuartetNetwork = _LazyServiceFactory("phykit.services.tree.quartet_network", "Qu
|
|
|
79
80
|
NetworkSignal = _LazyServiceFactory("phykit.services.tree.network_signal", "NetworkSignal")
|
|
80
81
|
LTT = _LazyServiceFactory("phykit.services.tree.ltt", "LTT")
|
|
81
82
|
RelativeRateTest = _LazyServiceFactory("phykit.services.tree.relative_rate_test", "RelativeRateTest")
|
|
83
|
+
ThresholdModel = _LazyServiceFactory("phykit.services.tree.threshold_model", "ThresholdModel")
|
|
82
84
|
PolytomyTest = _LazyServiceFactory("phykit.services.tree.polytomy_test", "PolytomyTest")
|
|
83
85
|
PrintTree = _LazyServiceFactory("phykit.services.tree.print_tree", "PrintTree")
|
|
84
86
|
PruneTree = _LazyServiceFactory("phykit.services.tree.prune_tree", "PruneTree")
|
|
@@ -36,7 +36,9 @@ _EXPORTS = {
|
|
|
36
36
|
"TipToTipNodeDistance": "tip_to_tip_node_distance",
|
|
37
37
|
"TotalTreeLength": "total_tree_length",
|
|
38
38
|
"Treeness": "treeness",
|
|
39
|
+
"ThresholdModel": "threshold_model",
|
|
39
40
|
"TreenessOverRCV": "treeness_over_rcv",
|
|
41
|
+
"ConcordanceAsr": "concordance_asr",
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
__all__ = list(_EXPORTS.keys())
|