phykit 2.1.28__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.
Files changed (109) hide show
  1. {phykit-2.1.28 → phykit-2.1.30}/PKG-INFO +1 -1
  2. {phykit-2.1.28 → phykit-2.1.30}/phykit/cli_registry.py +2 -0
  3. {phykit-2.1.28 → phykit-2.1.30}/phykit/phykit.py +139 -0
  4. {phykit-2.1.28 → phykit-2.1.30}/phykit/service_factories.py +1 -0
  5. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/__init__.py +1 -0
  6. phykit-2.1.30/phykit/services/tree/concordance_asr.py +855 -0
  7. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/fit_continuous.py +43 -26
  8. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/ouwie.py +52 -3
  9. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/phylogenetic_glm.py +62 -23
  10. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/phylogenetic_ordination.py +26 -28
  11. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/phylogenetic_regression.py +50 -28
  12. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/phylogenetic_signal.py +51 -25
  13. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/rate_heterogeneity.py +23 -2
  14. phykit-2.1.30/phykit/services/tree/vcv_utils.py +194 -0
  15. phykit-2.1.30/phykit/version.py +1 -0
  16. {phykit-2.1.28 → phykit-2.1.30}/phykit.egg-info/PKG-INFO +1 -1
  17. {phykit-2.1.28 → phykit-2.1.30}/phykit.egg-info/SOURCES.txt +3 -1
  18. {phykit-2.1.28 → phykit-2.1.30}/phykit.egg-info/entry_points.txt +3 -0
  19. {phykit-2.1.28 → phykit-2.1.30}/setup.py +3 -0
  20. phykit-2.1.28/phykit/version.py +0 -1
  21. {phykit-2.1.28 → phykit-2.1.30}/LICENSE.md +0 -0
  22. {phykit-2.1.28 → phykit-2.1.30}/README.md +0 -0
  23. {phykit-2.1.28 → phykit-2.1.30}/phykit/__init__.py +0 -0
  24. {phykit-2.1.28 → phykit-2.1.30}/phykit/__main__.py +0 -0
  25. {phykit-2.1.28 → phykit-2.1.30}/phykit/errors.py +0 -0
  26. {phykit-2.1.28 → phykit-2.1.30}/phykit/helpers/__init__.py +0 -0
  27. {phykit-2.1.28 → phykit-2.1.30}/phykit/helpers/boolean_argument_parsing.py +0 -0
  28. {phykit-2.1.28 → phykit-2.1.30}/phykit/helpers/caching.py +0 -0
  29. {phykit-2.1.28 → phykit-2.1.30}/phykit/helpers/files.py +0 -0
  30. {phykit-2.1.28 → phykit-2.1.30}/phykit/helpers/json_output.py +0 -0
  31. {phykit-2.1.28 → phykit-2.1.30}/phykit/helpers/parallel.py +0 -0
  32. {phykit-2.1.28 → phykit-2.1.30}/phykit/helpers/stats_summary.py +0 -0
  33. {phykit-2.1.28 → phykit-2.1.30}/phykit/helpers/streaming.py +0 -0
  34. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/__init__.py +0 -0
  35. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/__init__.py +0 -0
  36. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/alignment_entropy.py +0 -0
  37. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/alignment_length.py +0 -0
  38. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/alignment_length_no_gaps.py +0 -0
  39. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/alignment_outlier_taxa.py +0 -0
  40. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/alignment_recoding.py +0 -0
  41. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/base.py +0 -0
  42. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/column_score.py +0 -0
  43. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/composition_per_taxon.py +0 -0
  44. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/compositional_bias_per_site.py +0 -0
  45. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/create_concatenation_matrix.py +0 -0
  46. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/dna_threader.py +0 -0
  47. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/evolutionary_rate_per_site.py +0 -0
  48. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/faidx.py +0 -0
  49. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/gc_content.py +0 -0
  50. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/mask_alignment.py +0 -0
  51. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/occupancy_per_taxon.py +0 -0
  52. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/pairwise_identity.py +0 -0
  53. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/parsimony_informative_sites.py +0 -0
  54. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/plot_alignment_qc.py +0 -0
  55. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/rcv.py +0 -0
  56. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/rcvt.py +0 -0
  57. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/rename_fasta_entries.py +0 -0
  58. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/sum_of_pairs_score.py +0 -0
  59. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/alignment/variable_sites.py +0 -0
  60. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/base.py +0 -0
  61. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/ancestral_reconstruction.py +0 -0
  62. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/base.py +0 -0
  63. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/bipartition_support_stats.py +0 -0
  64. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/branch_length_multiplier.py +0 -0
  65. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/collapse_branches.py +0 -0
  66. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/consensus_network.py +0 -0
  67. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/consensus_tree.py +0 -0
  68. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/cont_map.py +0 -0
  69. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/cophylo.py +0 -0
  70. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/covarying_evolutionary_rates.py +0 -0
  71. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/density_map.py +0 -0
  72. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/dvmc.py +0 -0
  73. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/evolutionary_rate.py +0 -0
  74. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/hidden_paralogy_check.py +0 -0
  75. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/internal_branch_stats.py +0 -0
  76. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/internode_labeler.py +0 -0
  77. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/last_common_ancestor_subtree.py +0 -0
  78. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/lb_score.py +0 -0
  79. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/ltt.py +0 -0
  80. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/monophyly_check.py +0 -0
  81. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/nearest_neighbor_interchange.py +0 -0
  82. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/network_signal.py +0 -0
  83. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/ou_shift_detection.py +0 -0
  84. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/patristic_distances.py +0 -0
  85. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/phenogram.py +0 -0
  86. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/phylomorphospace.py +0 -0
  87. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/polytomy_test.py +0 -0
  88. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/print_tree.py +0 -0
  89. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/prune_tree.py +0 -0
  90. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/quartet_network.py +0 -0
  91. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/relative_rate_test.py +0 -0
  92. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/rename_tree_tips.py +0 -0
  93. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/rf_distance.py +0 -0
  94. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/root_tree.py +0 -0
  95. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/saturation.py +0 -0
  96. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/spurious_sequence.py +0 -0
  97. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/stochastic_character_map.py +0 -0
  98. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/terminal_branch_stats.py +0 -0
  99. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/threshold_model.py +0 -0
  100. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/tip_labels.py +0 -0
  101. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/tip_to_tip_distance.py +0 -0
  102. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/tip_to_tip_node_distance.py +0 -0
  103. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/total_tree_length.py +0 -0
  104. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/treeness.py +0 -0
  105. {phykit-2.1.28 → phykit-2.1.30}/phykit/services/tree/treeness_over_rcv.py +0 -0
  106. {phykit-2.1.28 → phykit-2.1.30}/phykit.egg-info/dependency_links.txt +0 -0
  107. {phykit-2.1.28 → phykit-2.1.30}/phykit.egg-info/requires.txt +0 -0
  108. {phykit-2.1.28 → phykit-2.1.30}/phykit.egg-info/top_level.txt +0 -0
  109. {phykit-2.1.28 → phykit-2.1.30}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: phykit
3
- Version: 2.1.28
3
+ Version: 2.1.30
4
4
  Home-page: https://github.com/jlsteenwyk/phykit
5
5
  Author: Jacob L. Steenwyk
6
6
  Author-email: jlsteenwyk@gmail.com
@@ -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",
@@ -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)
@@ -1544,6 +1547,98 @@ class Phykit:
1544
1547
  _add_json_argument(parser)
1545
1548
  _run_service(parser, argv, AncestralReconstruction)
1546
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
+
1547
1642
  @staticmethod
1548
1643
  def bipartition_support_stats(argv):
1549
1644
  parser = _new_parser(
@@ -2294,6 +2389,10 @@ class Phykit:
2294
2389
  -p/--permutations number of permutations for
2295
2390
  blombergs_k (default: 1000)
2296
2391
 
2392
+ -g/--gene-trees optional multi-Newick file of
2393
+ gene trees for discordance-aware
2394
+ VCV computation
2395
+
2297
2396
  --json optional argument to output
2298
2397
  results as JSON
2299
2398
  """
@@ -2324,6 +2423,10 @@ class Phykit:
2324
2423
  help=SUPPRESS,
2325
2424
  metavar="",
2326
2425
  )
2426
+ parser.add_argument(
2427
+ "-g", "--gene-trees", type=str, required=False, default=None,
2428
+ help=SUPPRESS, metavar=""
2429
+ )
2327
2430
  _add_json_argument(parser)
2328
2431
  _run_service(parser, argv, PhylogeneticSignal)
2329
2432
 
@@ -2408,6 +2511,10 @@ class Phykit:
2408
2511
  --plot-output output path for plot
2409
2512
  (default: phylo_ordination_plot.png)
2410
2513
 
2514
+ -g/--gene-trees optional multi-Newick file of
2515
+ gene trees for discordance-aware
2516
+ VCV computation
2517
+
2411
2518
  --json optional argument to output
2412
2519
  results as JSON
2413
2520
  """
@@ -2512,6 +2619,10 @@ class Phykit:
2512
2619
  required=False,
2513
2620
  help=SUPPRESS,
2514
2621
  )
2622
+ parser.add_argument(
2623
+ "-g", "--gene-trees", type=str, required=False, default=None,
2624
+ help=SUPPRESS, metavar=""
2625
+ )
2515
2626
  _add_json_argument(parser)
2516
2627
  _run_service(parser, argv, PhylogeneticOrdination)
2517
2628
 
@@ -2665,6 +2776,10 @@ class Phykit:
2665
2776
  -m/--method method to use: BM or lambda
2666
2777
  (default: BM)
2667
2778
 
2779
+ -g/--gene-trees optional multi-Newick file of
2780
+ gene trees for discordance-aware
2781
+ VCV computation
2782
+
2668
2783
  --json optional argument to output
2669
2784
  results as JSON
2670
2785
  """
@@ -2698,6 +2813,10 @@ class Phykit:
2698
2813
  help=SUPPRESS,
2699
2814
  metavar="",
2700
2815
  )
2816
+ parser.add_argument(
2817
+ "-g", "--gene-trees", type=str, required=False, default=None,
2818
+ help=SUPPRESS, metavar=""
2819
+ )
2701
2820
  _add_json_argument(parser)
2702
2821
  _run_service(parser, argv, PhylogeneticRegression)
2703
2822
 
@@ -2761,6 +2880,10 @@ class Phykit:
2761
2880
  --log-alpha-bound bound on log(alpha*Tmax) for
2762
2881
  logistic model (default: 4)
2763
2882
 
2883
+ -g/--gene-trees optional multi-Newick file of
2884
+ gene trees for discordance-aware
2885
+ VCV computation
2886
+
2764
2887
  --json optional argument to output
2765
2888
  results as JSON
2766
2889
  """
@@ -2818,6 +2941,10 @@ class Phykit:
2818
2941
  help=SUPPRESS,
2819
2942
  metavar="",
2820
2943
  )
2944
+ parser.add_argument(
2945
+ "-g", "--gene-trees", type=str, required=False, default=None,
2946
+ help=SUPPRESS, metavar=""
2947
+ )
2821
2948
  _add_json_argument(parser)
2822
2949
  _run_service(parser, argv, PhylogeneticGLM)
2823
2950
 
@@ -3261,6 +3388,10 @@ class Phykit:
3261
3388
  --models comma-separated list of models
3262
3389
  to fit (default: all 7)
3263
3390
 
3391
+ -g/--gene-trees optional multi-Newick file of
3392
+ gene trees for discordance-aware
3393
+ VCV computation
3394
+
3264
3395
  --json optional argument to output
3265
3396
  results as JSON
3266
3397
  """
@@ -3276,6 +3407,10 @@ class Phykit:
3276
3407
  "--models", type=str, required=False, default=None,
3277
3408
  help=SUPPRESS, metavar=""
3278
3409
  )
3410
+ parser.add_argument(
3411
+ "-g", "--gene-trees", type=str, required=False, default=None,
3412
+ help=SUPPRESS, metavar=""
3413
+ )
3279
3414
  _add_json_argument(parser)
3280
3415
  _run_service(parser, argv, FitContinuous)
3281
3416
 
@@ -4949,6 +5084,10 @@ def ancestral_state_reconstruction(argv=None):
4949
5084
  Phykit.ancestral_state_reconstruction(sys.argv[1:])
4950
5085
 
4951
5086
 
5087
+ def concordance_asr(argv=None):
5088
+ Phykit.concordance_asr(sys.argv[1:])
5089
+
5090
+
4952
5091
  def bipartition_support_stats(argv=None):
4953
5092
  Phykit.bipartition_support_stats(sys.argv[1:])
4954
5093
 
@@ -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")
@@ -38,6 +38,7 @@ _EXPORTS = {
38
38
  "Treeness": "treeness",
39
39
  "ThresholdModel": "threshold_model",
40
40
  "TreenessOverRCV": "treeness_over_rcv",
41
+ "ConcordanceAsr": "concordance_asr",
41
42
  }
42
43
 
43
44
  __all__ = list(_EXPORTS.keys())