TreeSAK 1.57.7__tar.gz → 1.58.0__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 (145) hide show
  1. {treesak-1.57.7/treesak.egg-info → treesak-1.58.0}/PKG-INFO +2 -2
  2. {treesak-1.57.7 → treesak-1.58.0}/README.md +23 -13
  3. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/VERSION +3 -0
  4. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/replace_clade.py +13 -0
  5. treesak-1.58.0/TreeSAK/rm_leaf.py +83 -0
  6. {treesak-1.57.7 → treesak-1.58.0}/bin/TreeSAK +13 -1
  7. {treesak-1.57.7 → treesak-1.58.0/treesak.egg-info}/PKG-INFO +2 -2
  8. {treesak-1.57.7 → treesak-1.58.0}/treesak.egg-info/SOURCES.txt +1 -0
  9. {treesak-1.57.7 → treesak-1.58.0}/LICENSE +0 -0
  10. {treesak-1.57.7 → treesak-1.58.0}/MANIFEST.in +0 -0
  11. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE.py +0 -0
  12. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE1.py +0 -0
  13. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE2.py +0 -0
  14. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE2RTC.py +0 -0
  15. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE3.py +0 -0
  16. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE4.py +0 -0
  17. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE5.py +0 -0
  18. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE6.py +0 -0
  19. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE7.py +0 -0
  20. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE_backup.py +0 -0
  21. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/AssessCVG.py +0 -0
  22. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/AssessMarker.py +0 -0
  23. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/AssessMarkerDeltaLL.py +0 -0
  24. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/AssessMarkerPA.py +0 -0
  25. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/BMGE.jar +0 -0
  26. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/BMGE.py +0 -0
  27. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/C60SR4.nex +0 -0
  28. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/CompareMCMC.py +0 -0
  29. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ConcateMSA.py +0 -0
  30. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ConvertMSA.py +0 -0
  31. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/Dir.rb +0 -0
  32. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ExtractMarkerSeq.py +0 -0
  33. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/FastRoot.py +0 -0
  34. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/FastRoot_backup.py +0 -0
  35. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/FigTree.py +0 -0
  36. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/GTDB_tree.py +0 -0
  37. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/GeneTree.py +0 -0
  38. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/KEGG_Luo17.py +0 -0
  39. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/LcaToLeaves.py +0 -0
  40. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/MarkerRef2Tree.py +0 -0
  41. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/MarkerRef2Tree_backup.py +0 -0
  42. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/MarkerSeq2Tree.py +0 -0
  43. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/MarkerSeq2Tree_backup.py +0 -0
  44. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ModifyTopo.py +0 -0
  45. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/Newick_tree_plotter.py +0 -0
  46. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/OMA.py +0 -0
  47. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/OMA2.py +0 -0
  48. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/OneLineAln.py +0 -0
  49. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/PB.py +0 -0
  50. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/PMSF.py +0 -0
  51. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/PhyloBiAssoc.R +0 -0
  52. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/PhyloBiAssoc.py +0 -0
  53. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/PlotMCMC.py +0 -0
  54. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/PlotMcmcNode.py +0 -0
  55. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/PlotMcmcNode_old.py +0 -0
  56. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/RootTree.py +0 -0
  57. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/RootTreeGTDB.py +0 -0
  58. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/RootTreeGTDB214.py +0 -0
  59. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/RootTreeGTDB220.py +0 -0
  60. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SequentialDating.py +0 -0
  61. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SingleAleHGT.py +0 -0
  62. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SingleLinePhy.py +0 -0
  63. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SliceMSA.py +0 -0
  64. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SplitScore.py +0 -0
  65. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SplitScore1.py +0 -0
  66. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SplitScore1OMA.py +0 -0
  67. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SplitScore2.py +0 -0
  68. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/Tanglegram.py +0 -0
  69. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/TaxaCountStats.R +0 -0
  70. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/TaxonTree.py +0 -0
  71. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/TimeScale.py +0 -0
  72. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/TreeSAK_config.py +0 -0
  73. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/VisHPD95.R +0 -0
  74. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/VisHPD95.py +0 -0
  75. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/__init__.py +0 -0
  76. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ale_parser.py +0 -0
  77. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ale_splitter.py +0 -0
  78. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/alignment_pruner.pl +0 -0
  79. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/assessOG.py +0 -0
  80. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/assessPB.py +0 -0
  81. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/batch_itol.py +0 -0
  82. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/catfasta2phy.py +0 -0
  83. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/cogTree.py +0 -0
  84. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/compare_trees.R +0 -0
  85. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/compare_trees.py +0 -0
  86. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/cophyloplot.R +0 -0
  87. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/cophyloplot.py +0 -0
  88. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/dating.py +0 -0
  89. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/dating_ss.py +0 -0
  90. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/deltall.py +0 -0
  91. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/do_rrtc.rb +0 -0
  92. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/fa2phy.py +0 -0
  93. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/filter_rename_ar53.py +0 -0
  94. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/format_leaf_name.py +0 -0
  95. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/gap_stats.py +0 -0
  96. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/get_SCG_tree.py +0 -0
  97. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/get_arCOG_seq.py +0 -0
  98. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/get_lca_id.py +0 -0
  99. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/global_functions.py +0 -0
  100. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/gnm_leaves.py +0 -0
  101. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/guide_tree.py +0 -0
  102. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/iTOL.py +0 -0
  103. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/iTOL_gene_tree.py +0 -0
  104. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/itol_msa_stats.py +0 -0
  105. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/keep_highest_rrtc.py +0 -0
  106. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/koTree.py +0 -0
  107. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/label_gene_tree_by_gnm.py +0 -0
  108. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/label_tree.R +0 -0
  109. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/label_tree.py +0 -0
  110. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/mad.py +0 -0
  111. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/mcmc2tree.py +0 -0
  112. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/mcmcTC copy.py +0 -0
  113. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/mcmcTC.py +0 -0
  114. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/mcmctree_out.py +0 -0
  115. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/mcmctree_vs_reltime.R +0 -0
  116. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/mcmctree_vs_reltime.py +0 -0
  117. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/merge_pdf.py +0 -0
  118. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/pRTC.py +0 -0
  119. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/parse_mcmctree.py +0 -0
  120. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/parse_reltime.py +0 -0
  121. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/phy2fa.py +0 -0
  122. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/plot_distruibution_th.py +0 -0
  123. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/prep_mcmctree_ctl.py +0 -0
  124. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/print_leaves.py +0 -0
  125. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/pruneMSA.py +0 -0
  126. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/recode.py +0 -0
  127. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/remove_bias.R +0 -0
  128. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/rename_leaves.py +0 -0
  129. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/root_with_out_group.py +0 -0
  130. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/run_TaxaCountStats_R_s1.py +0 -0
  131. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/subsample_drep_gnms.py +0 -0
  132. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/subset.py +0 -0
  133. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/subset_tree_stupid_old_way.py +0 -0
  134. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/supertree.py +0 -0
  135. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/tmp_1.py +0 -0
  136. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/tmp_2.py +0 -0
  137. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/tmp_3.py +0 -0
  138. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/tmp_4.py +0 -0
  139. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/tree_fmt.py +0 -0
  140. {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/weighted_rand.rb +0 -0
  141. {treesak-1.57.7 → treesak-1.58.0}/setup.cfg +0 -0
  142. {treesak-1.57.7 → treesak-1.58.0}/setup.py +0 -0
  143. {treesak-1.57.7 → treesak-1.58.0}/treesak.egg-info/dependency_links.txt +0 -0
  144. {treesak-1.57.7 → treesak-1.58.0}/treesak.egg-info/requires.txt +0 -0
  145. {treesak-1.57.7 → treesak-1.58.0}/treesak.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: treesak
3
- Version: 1.57.7
3
+ Version: 1.58.0
4
4
  Summary: BioSAK
5
5
  Home-page: https://github.com/songweizhi/TreeSAK
6
6
  Author: Weizhi Song
@@ -24,4 +24,4 @@ Requires-Dist: kaleido
24
24
  Requires-Dist: PyPDF3
25
25
  Requires-Dist: dendropy
26
26
 
27
- TreeSAK v1.57.7
27
+ TreeSAK v1.58.0
@@ -30,8 +30,9 @@ Installation
30
30
  TreeSAK modules
31
31
  ---
32
32
 
33
- ...::: TreeSAK v1.45.5 :::...
33
+ ...::: TreeSAK v1.58.0 :::...
34
34
 
35
+
35
36
  Marker-related
36
37
  ExtractMarkerSeq -> Extract marker by blastn
37
38
  deltall -> Parse stdout of deltaLL.rb
@@ -41,12 +42,14 @@ TreeSAK modules
41
42
  AssessMarkerDeltaLL -> Assess Markers by DeltaLL
42
43
  OMA -> Prepare input files for running OMA
43
44
  OMA2 -> Filter OMA predicted OGs
44
-
45
+ filter_rename_ar53 -> Filter rename GTDB markers
46
+
45
47
  Multiple Sequence Alignment
46
48
  BMGE -> Run BMGE
47
49
  pruneMSA -> Prune MSA with alignment_pruner.pl
48
- recodeAA -> Recode amino acids to Dayoff 4, Dayoff 6 or SR4 categories
50
+ recode -> Recode amino acids to Dayoff 4, Dayoff 6 or SR4 categories
49
51
  fa2phy -> Convert MSA format (fasta to phylip)
52
+ phy2fa -> Convert MSA format (phylip to fasta)
50
53
  SliceMSA -> Slice MSA by column
51
54
  ConcateMSA -> Concatenate MSAs
52
55
  ConvertMSA -> Convert MSA format
@@ -57,10 +60,12 @@ TreeSAK modules
57
60
 
58
61
  Tree-related
59
62
  iTOL -> Prepare iTOL files
63
+ batch_itol -> Batch access iTOL
60
64
  iTOL_gene_tree -> Genome metadata to gene metadata
65
+ iTOL_msa_stats -> iTOL_msa_stats
61
66
  PB -> Infer tree with PhyloBayes-MPI
62
- supertree -> Infer species tree from gene trees
63
- AssessPB -> Compare PhyloBayes chains
67
+ assessPB -> Compare PhyloBayes chains
68
+ supertree -> Infer species tree from multiple gene trees
64
69
  MarkerSeq2Tree -> Marker sequence to tree
65
70
  MarkerRef2Tree -> Marker (reference sequence) to Tree
66
71
  GTDB_tree -> Get GTDB tree
@@ -73,12 +78,17 @@ TreeSAK modules
73
78
  ModifyTopo -> Modify tree topology
74
79
  GeneRax -> (to be added) Run GeneRax
75
80
  ALE -> Modules for running ALE
76
- FunTree -> Infer tree for individual COG/KEGG function
81
+ cogTree -> Infer tree for individual COG function
82
+ koTree -> Infer tree for individual KEGG function
77
83
  RootTree -> Root tree with outgroup leaves
78
- RootTreeGTDB214 -> Root tree by GTDB taxonomy (r214)
79
- RootTreeGTDB220 -> Root tree by GTDB taxonomy (r220)
84
+ RootTreeGTDB -> Root tree by GTDB taxonomy
80
85
  LcaToLeaves -> Get two leaves that define an internal node
81
86
  replace_clade -> Replace tree clade
87
+ GeneTree -> Infer gene tree
88
+ guide_tree -> Prepare guide tree for iqtree
89
+ get_lca_id -> Get LCA id
90
+ tree_fmt -> Change tree format
91
+ rm_leaf -> Remove leaf/leaves from tree
82
92
 
83
93
  Model-related
84
94
  PMSF -> run iqtree with PMSF
@@ -86,13 +96,13 @@ TreeSAK modules
86
96
 
87
97
  Dating-related
88
98
  dating -> Perform molecular dating
89
- AssessCVG -> Assess dating convergence
90
99
  CompareMCMC -> Compare MCMCTree outputs
91
- PlotMcmcNode -> distribution of node's age estimation
100
+ PlotMcmcNode -> Distribution of node's age estimation
92
101
  VisHPD95 -> HPD95 of estimated node age
93
102
  pRTC -> Perform probabilistic RTC dating
94
- mcmcTC -> adding time constraints to mcmctree tree
95
- mcmc2tree -> get the tree with internal node id from mcmctree output
96
-
103
+ mcmcTC -> Adding time constraints to mcmctree tree
104
+ mcmc2tree -> Get the tree with internal node from mcmctree output
105
+ mcmctree_out -> Parse MCMCTree produced .out file
106
+
97
107
  Phylo-related stats
98
108
  PhyloBiAssoc -> A wrapper for binaryPGLMM test
@@ -1,3 +1,6 @@
1
+ 1.58.0
2
+ - new module added: rm_leaf
3
+
1
4
  1.57.7
2
5
  - fixed bugs
3
6
 
@@ -10,6 +10,19 @@ TreeSAK replace_clade -m main.tree -s sub.tree -o out.tree -l leaves.txt
10
10
  TreeSAK replace_clade -m main.tree -s sub.tree -o out.tree -l leaf1
11
11
  TreeSAK replace_clade -m main.tree -s sub.tree -o out.tree -l leaf1,leaf2
12
12
 
13
+ # https://etetoolkit.org/docs/latest/tutorial/tutorial_trees.html
14
+ 0 flexible with support values
15
+ 1 flexible with internal node names
16
+ 2 all branches + leaf names + internal supports
17
+ 3 all branches + all names
18
+ 4 leaf branches + leaf names
19
+ 5 internal and leaf branches + leaf names
20
+ 6 internal branches + leaf names
21
+ 7 leaf branches + all names
22
+ 8 all names
23
+ 9 leaf names
24
+ 100 topology only
25
+
13
26
  ============================================================================
14
27
  '''
15
28
 
@@ -0,0 +1,83 @@
1
+ import os
2
+ import argparse
3
+ from ete3 import Tree
4
+
5
+
6
+ rm_leaf_usage = '''
7
+ =============== rm_leaf example commands ===============
8
+
9
+ TreeSAK rm_leaf -i in.tree -o out.tree -l leaves.txt
10
+ TreeSAK rm_leaf -i in.tree -o out.tree -l leaf1
11
+ TreeSAK rm_leaf -i in.tree -o out.tree -l leaf1,leaf2
12
+
13
+ # Tree formats
14
+ 0 flexible with support values
15
+ 1 flexible with internal node names
16
+ 2 all branches + leaf names + internal supports
17
+ 3 all branches + all names
18
+ 4 leaf branches + leaf names
19
+ 5 internal and leaf branches + leaf names
20
+ 6 internal branches + leaf names
21
+ 7 leaf branches + all names
22
+ 8 all names
23
+ 9 leaf names
24
+ 100 topology only
25
+
26
+ ========================================================
27
+ '''
28
+
29
+
30
+ def rm_leaf(args):
31
+
32
+ input_tree_file = args['i']
33
+ input_tree_fmt = args['if']
34
+ output_tree_file = args['o']
35
+ output_tree_fmt = args['of']
36
+ leaf_txt = args['l']
37
+
38
+ if os.path.isfile(input_tree_file) is False:
39
+ print('%s does not exist, program exited!' % input_tree_file)
40
+ exit()
41
+
42
+ # read in leaves to remove
43
+ leaves_to_remove_list = []
44
+ if os.path.isfile(leaf_txt) is True:
45
+ for each_leaf in open(leaf_txt):
46
+ leaves_to_remove_list.append(each_leaf.strip())
47
+ else:
48
+ leaves_to_remove_list = leaf_txt.split(',')
49
+
50
+ if len(leaves_to_remove_list) == 0:
51
+ print('Please provide at least one leaf to remove, program exited!')
52
+ exit()
53
+
54
+ # read in tree and remobe leaf/leaves
55
+ main_tre = Tree(input_tree_file, quoted_node_names=True, format=input_tree_fmt)
56
+ main_tre_leaves = [i.name for i in main_tre.get_leaves()]
57
+
58
+ # get leaves to keep
59
+ leaves_to_keep = []
60
+ for each_leaf in main_tre_leaves:
61
+ if each_leaf not in leaves_to_remove_list:
62
+ leaves_to_keep.append(each_leaf)
63
+
64
+ if len(main_tre_leaves) == len(leaves_to_keep):
65
+ print('No leaves to remove, program exited!')
66
+ exit()
67
+
68
+ main_tre.prune(leaves_to_keep)
69
+
70
+ # write out updated tree
71
+ main_tre.write(outfile=output_tree_file, format=output_tree_fmt)
72
+
73
+
74
+ if __name__ == '__main__':
75
+
76
+ rm_leaf_parser = argparse.ArgumentParser()
77
+ rm_leaf_parser.add_argument('-i', required=True, help='input tree file')
78
+ rm_leaf_parser.add_argument('-if', required=False, default=0, type=int, help='input tree format, default is 0')
79
+ rm_leaf_parser.add_argument('-l', required=True, help='leaf/leaves to remove')
80
+ rm_leaf_parser.add_argument('-o', required=True, help='output tree file')
81
+ rm_leaf_parser.add_argument('-of', required=False, default=0, type=int, help='output tree format, default is 0')
82
+ args = vars(rm_leaf_parser.parse_args())
83
+ rm_leaf(args)
@@ -86,7 +86,8 @@ def print_main_help():
86
86
  GeneTree -> Infer gene tree
87
87
  guide_tree -> Prepare guide tree for iqtree
88
88
  get_lca_id -> Get LCA id
89
- tree_fmt -> Update tree format
89
+ tree_fmt -> Change tree format
90
+ rm_leaf -> Remove leaf/leaves from tree
90
91
 
91
92
  Model-related
92
93
  PMSF -> run iqtree with PMSF
@@ -1002,6 +1003,17 @@ if __name__ == '__main__':
1002
1003
  args = vars(parser.parse_args())
1003
1004
  tree_fmt.tree_fmt(args)
1004
1005
 
1006
+ elif sys.argv[1] == 'rm_leaf':
1007
+ from TreeSAK import rm_leaf
1008
+ rm_leaf_parser = subparsers.add_parser('rm_leaf', usage=rm_leaf.rm_leaf_usage)
1009
+ rm_leaf_parser.add_argument('-i', required=True, help='input tree file')
1010
+ rm_leaf_parser.add_argument('-if', required=False, default=0, type=int, help='input tree format, default is 0')
1011
+ rm_leaf_parser.add_argument('-l', required=True, help='leaf/leaves to remove')
1012
+ rm_leaf_parser.add_argument('-o', required=True, help='output tree file')
1013
+ rm_leaf_parser.add_argument('-of', required=False, default=0, type=int, help='output tree format, default is 0')
1014
+ args = vars(parser.parse_args())
1015
+ rm_leaf.rm_leaf(args)
1016
+
1005
1017
  else:
1006
1018
  print('Unrecognized module: %s, program exited!' % sys.argv[1])
1007
1019
  exit()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: treesak
3
- Version: 1.57.7
3
+ Version: 1.58.0
4
4
  Summary: BioSAK
5
5
  Home-page: https://github.com/songweizhi/TreeSAK
6
6
  Author: Weizhi Song
@@ -24,4 +24,4 @@ Requires-Dist: kaleido
24
24
  Requires-Dist: PyPDF3
25
25
  Requires-Dist: dendropy
26
26
 
27
- TreeSAK v1.57.7
27
+ TreeSAK v1.58.0
@@ -122,6 +122,7 @@ TreeSAK/recode.py
122
122
  TreeSAK/remove_bias.R
123
123
  TreeSAK/rename_leaves.py
124
124
  TreeSAK/replace_clade.py
125
+ TreeSAK/rm_leaf.py
125
126
  TreeSAK/root_with_out_group.py
126
127
  TreeSAK/run_TaxaCountStats_R_s1.py
127
128
  TreeSAK/subsample_drep_gnms.py
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes