TreeSAK 1.31.7__tar.gz → 1.47.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 (133) hide show
  1. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/MANIFEST.in +1 -0
  2. {TreeSAK-1.31.7/TreeSAK.egg-info → TreeSAK-1.47.0}/PKG-INFO +3 -2
  3. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/README.md +38 -15
  4. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/ALE.py +4 -0
  5. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/ALE1.py +76 -32
  6. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/ALE2.py +27 -26
  7. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/ALE3.py +15 -9
  8. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/ALE4.py +7 -7
  9. TreeSAK-1.47.0/TreeSAK/ALE6.py +401 -0
  10. TreeSAK-1.47.0/TreeSAK/ALE7.py +126 -0
  11. TreeSAK-1.47.0/TreeSAK/AssessPB.py +130 -0
  12. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/BMGE.py +2 -5
  13. TreeSAK-1.47.0/TreeSAK/FigTree.py +34 -0
  14. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/GTDB_tree.py +3 -16
  15. TreeSAK-1.47.0/TreeSAK/GeneTree.py +120 -0
  16. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/MarkerRef2Tree.py +121 -65
  17. TreeSAK-1.47.0/TreeSAK/MarkerSeq2Tree.py +290 -0
  18. TreeSAK-1.31.7/TreeSAK/MarkerSeq2Tree.py → TreeSAK-1.47.0/TreeSAK/MarkerSeq2Tree_backup.py +94 -34
  19. TreeSAK-1.47.0/TreeSAK/Newick_tree_plotter.py +79 -0
  20. TreeSAK-1.47.0/TreeSAK/OMA2.py +212 -0
  21. TreeSAK-1.47.0/TreeSAK/PB.py +155 -0
  22. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/PMSF.py +20 -16
  23. TreeSAK-1.47.0/TreeSAK/PlotMcmcNode.py +170 -0
  24. TreeSAK-1.31.7/TreeSAK/PlotMcmcNode.py → TreeSAK-1.47.0/TreeSAK/PlotMcmcNode_old.py +22 -12
  25. TreeSAK-1.47.0/TreeSAK/RootTree.py +101 -0
  26. TreeSAK-1.31.7/TreeSAK/gtdb_root.py → TreeSAK-1.47.0/TreeSAK/RootTreeGTDB214.py +14 -14
  27. TreeSAK-1.47.0/TreeSAK/RootTreeGTDB220.py +300 -0
  28. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/SplitScore1.py +24 -32
  29. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/SplitScore2.py +37 -51
  30. TreeSAK-1.47.0/TreeSAK/TaxonTree.py +47 -0
  31. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/VERSION +49 -1
  32. TreeSAK-1.47.0/TreeSAK/alignment_pruner.pl +1471 -0
  33. TreeSAK-1.47.0/TreeSAK/assessOG.py +45 -0
  34. TreeSAK-1.31.7/TreeSAK/test_1.py → TreeSAK-1.47.0/TreeSAK/catfasta2phy.py +0 -7
  35. TreeSAK-1.47.0/TreeSAK/cogTree.py +185 -0
  36. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/compare_trees.py +40 -26
  37. TreeSAK-1.47.0/TreeSAK/dating.py +264 -0
  38. TreeSAK-1.31.7/TreeSAK/Dating.py → TreeSAK-1.47.0/TreeSAK/dating_ss.py +5 -5
  39. TreeSAK-1.31.7/TreeSAK/parse_deltall_stdout.py → TreeSAK-1.47.0/TreeSAK/deltall.py +6 -6
  40. TreeSAK-1.47.0/TreeSAK/gap_stats.py +38 -0
  41. TreeSAK-1.47.0/TreeSAK/get_SCG_tree.py +742 -0
  42. TreeSAK-1.47.0/TreeSAK/gnm_leaves.py +43 -0
  43. TreeSAK-1.47.0/TreeSAK/iTOL.py +745 -0
  44. TreeSAK-1.47.0/TreeSAK/iTOL_gene_tree.py +80 -0
  45. TreeSAK-1.31.7/TreeSAK/tmp_3.py → TreeSAK-1.47.0/TreeSAK/keep_highest_rrtc.py +3 -5
  46. TreeSAK-1.47.0/TreeSAK/koTree.py +194 -0
  47. TreeSAK-1.47.0/TreeSAK/label_tree.R +75 -0
  48. TreeSAK-1.47.0/TreeSAK/label_tree.py +121 -0
  49. TreeSAK-1.47.0/TreeSAK/mad.py +708 -0
  50. TreeSAK-1.47.0/TreeSAK/mcmc2tree.py +58 -0
  51. TreeSAK-1.47.0/TreeSAK/mcmcTC copy.py +92 -0
  52. TreeSAK-1.47.0/TreeSAK/mcmcTC.py +104 -0
  53. TreeSAK-1.47.0/TreeSAK/phy2fa.py +37 -0
  54. TreeSAK-1.47.0/TreeSAK/pruneMSA.py +63 -0
  55. TreeSAK-1.47.0/TreeSAK/recode.py +73 -0
  56. TreeSAK-1.47.0/TreeSAK/remove_bias.R +112 -0
  57. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/rename_leaves.py +1 -1
  58. TreeSAK-1.47.0/TreeSAK/replace_clade.py +55 -0
  59. TreeSAK-1.47.0/TreeSAK/subset.py +69 -0
  60. TreeSAK-1.47.0/TreeSAK/supertree.py +330 -0
  61. {TreeSAK-1.31.7 → TreeSAK-1.47.0/TreeSAK.egg-info}/PKG-INFO +3 -2
  62. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK.egg-info/SOURCES.txt +40 -14
  63. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK.egg-info/requires.txt +1 -0
  64. TreeSAK-1.47.0/bin/TreeSAK +915 -0
  65. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/setup.py +1 -1
  66. TreeSAK-1.31.7/TreeSAK/ALE6.py +0 -128
  67. TreeSAK-1.31.7/TreeSAK/AlignmentPruner.py +0 -37
  68. TreeSAK-1.31.7/TreeSAK/MCMCtreeR.py +0 -2
  69. TreeSAK-1.31.7/TreeSAK/OMA2.py +0 -126
  70. TreeSAK-1.31.7/TreeSAK/RootTree.py +0 -44
  71. TreeSAK-1.31.7/TreeSAK/pb_mpi.py +0 -58
  72. TreeSAK-1.31.7/TreeSAK/replace_clades.py +0 -28
  73. TreeSAK-1.31.7/TreeSAK/subset_tree.py +0 -35
  74. TreeSAK-1.31.7/TreeSAK/tmp_2.py +0 -23
  75. TreeSAK-1.31.7/TreeSAK/tmp_4.py +0 -0
  76. TreeSAK-1.31.7/bin/TreeSAK +0 -644
  77. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/LICENSE +0 -0
  78. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/ALE2RTC.py +0 -0
  79. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/ALE5.py +0 -0
  80. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/ALE_backup.py +0 -0
  81. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/AssessCVG.py +0 -0
  82. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/AssessMarker.py +0 -0
  83. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/AssessMarkerDeltaLL.py +0 -0
  84. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/AssessMarkerPA.py +0 -0
  85. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/BMGE.jar +0 -0
  86. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/CompareMCMC.py +0 -0
  87. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/ConcateMSA.py +0 -0
  88. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/ConvertMSA.py +0 -0
  89. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/Dir.rb +0 -0
  90. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/ExtractMarkerSeq.py +0 -0
  91. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/FastRoot.py +0 -0
  92. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/FastRoot_backup.py +0 -0
  93. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/KEGG_Luo17.py +0 -0
  94. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/LcaToLeaves.py +0 -0
  95. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/MarkerRef2Tree_backup.py +0 -0
  96. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/ModifyTopo.py +0 -0
  97. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/OMA.py +0 -0
  98. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/OneLineAln.py +0 -0
  99. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/PhyloBiAssoc.R +0 -0
  100. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/PhyloBiAssoc.py +0 -0
  101. /TreeSAK-1.31.7/TreeSAK/test_2.py → /TreeSAK-1.47.0/TreeSAK/PlotMCMC.py +0 -0
  102. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/SequentialDating.py +0 -0
  103. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/SingleAleHGT.py +0 -0
  104. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/SingleLinePhy.py +0 -0
  105. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/SliceMSA.py +0 -0
  106. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/SplitScore.py +0 -0
  107. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/SplitScore1OMA.py +0 -0
  108. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/TaxaCountStats.R +0 -0
  109. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/TreeSAK_config.py +0 -0
  110. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/VisHPD95.R +0 -0
  111. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/VisHPD95.py +0 -0
  112. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/__init__.py +0 -0
  113. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/ale_parser.py +0 -0
  114. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/ale_splitter.py +0 -0
  115. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/compare_trees.R +0 -0
  116. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/do_rrtc.rb +0 -0
  117. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/fa2phy.py +0 -0
  118. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/format_leaf_name.py +0 -0
  119. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/get_arCOG_seq.py +0 -0
  120. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/global_functions.py +0 -0
  121. /TreeSAK-1.31.7/TreeSAK/tmp_1.py → /TreeSAK-1.47.0/TreeSAK/merge_pdf.py +0 -0
  122. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/pRTC.py +0 -0
  123. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/plot_distruibution_th.py +0 -0
  124. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/prep_mcmctree_ctl.py +0 -0
  125. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/print_leaves.py +0 -0
  126. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/root_with_out_group.py +0 -0
  127. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/run_TaxaCountStats_R_s1.py +0 -0
  128. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/subsample_drep_gnms.py +0 -0
  129. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/subset_tree_stupid_old_way.py +0 -0
  130. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK/weighted_rand.rb +0 -0
  131. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK.egg-info/dependency_links.txt +0 -0
  132. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/TreeSAK.egg-info/top_level.txt +0 -0
  133. {TreeSAK-1.31.7 → TreeSAK-1.47.0}/setup.cfg +0 -0
@@ -5,6 +5,7 @@ include TreeSAK/do_rrtc.rb
5
5
  include TreeSAK/weighted_rand.rb
6
6
  include TreeSAK/cdd2cog.pl
7
7
  include TreeSAK/select_contig.pl
8
+ include TreeSAK/alignment_pruner.pl
8
9
  include TreeSAK/get_fasta_stats.pl
9
10
  include TreeSAK/get_sankey_plot.R
10
11
  include TreeSAK/label_tree.R
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TreeSAK
3
- Version: 1.31.7
3
+ Version: 1.47.0
4
4
  Summary: BioSAK
5
5
  Home-page: https://github.com/songweizhi/TreeSAK
6
6
  Author: Weizhi Song
@@ -22,5 +22,6 @@ Requires-Dist: arviz
22
22
  Requires-Dist: plotly
23
23
  Requires-Dist: kaleido
24
24
  Requires-Dist: PyPDF3
25
+ Requires-Dist: dendropy
25
26
 
26
- TreeSAK v1.31.7
27
+ TreeSAK v1.47.0
@@ -4,10 +4,11 @@
4
4
  [![pypi licence ](https://img.shields.io/pypi/l/TreeSAK.svg)](https://opensource.org/licenses/gpl-3.0.html)
5
5
  [![pypi version ](https://img.shields.io/pypi/v/TreeSAK.svg)](https://pypi.python.org/pypi/TreeSAK)
6
6
 
7
+
7
8
  Contact
8
9
  ---
9
10
 
10
- + Dr Weizhi Song
11
+ + Dr. Weizhi Song
11
12
  + Department of Ocean Science, Hong Kong University of Science and Technology, Hong Kong
12
13
  + E-mail: songwz03@gmail.com
13
14
 
@@ -29,11 +30,11 @@ Installation
29
30
  TreeSAK modules
30
31
  ---
31
32
 
32
- ...::: TreeSAK v1.28.0 :::...
33
+ ...::: TreeSAK v1.45.5 :::...
33
34
 
34
35
  Marker-related
35
36
  ExtractMarkerSeq -> Extract marker by blastn
36
- parse_deltall_stdout -> Parse stdout of deltaLL.rb
37
+ deltall -> Parse stdout of deltaLL.rb
37
38
  get_arCOG_seq -> Retrieve arCOG sequences
38
39
  AssessMarkerPA -> Assess Markers by P/A among groups
39
40
  SplitScore -> Assess markers by split score
@@ -42,34 +43,56 @@ TreeSAK modules
42
43
  OMA2 -> Filter OMA predicted OGs
43
44
 
44
45
  Multiple Sequence Alignment
45
- ConvertMSA -> Convert MSA format
46
+ BMGE -> Run BMGE
47
+ pruneMSA -> Prune MSA with alignment_pruner.pl
48
+ recodeAA -> Recode amino acids to Dayoff 4, Dayoff 6 or SR4 categories
46
49
  fa2phy -> Convert MSA format (fasta to phylip)
47
- SingleLinePhy -> Put sequences in single line in phylip format
50
+ SliceMSA -> Slice MSA by column
51
+ ConcateMSA -> Concatenate MSAs
52
+ ConvertMSA -> Convert MSA format
48
53
  OneLineAln -> One-line fasta format alignments
49
- SliceMSA -> Slice MSA by column
50
- AlignmentPruner -> Remove heterogenous sites from MSA
51
- BMGE -> Run BMGE
52
- ConcateMSA -> Concatenate MSA
53
-
54
+ SingleLinePhy -> Put sequences in single line in phylip format
55
+ CS_trim -> (to be added) perform chi-squared trimming to reduce compositional heterogeneity
56
+ gap_stats -> The percentage of gap in each sequence of a MSA
57
+
54
58
  Tree-related
59
+ iTOL -> Prepare iTOL files
60
+ iTOL_gene_tree -> Genome metadata to gene metadata
61
+ PB -> Infer tree with PhyloBayes-MPI
62
+ supertree -> Infer species tree from gene trees
63
+ AssessPB -> Compare PhyloBayes chains
55
64
  MarkerSeq2Tree -> Marker sequence to tree
56
65
  MarkerRef2Tree -> Marker (reference sequence) to Tree
57
- GTDB_tree -> get GTDB tree
58
- PMSF -> run iqtree with PMSF
59
- subset_tree -> Subset tree
66
+ GTDB_tree -> Get GTDB tree
67
+ subset -> Subset tree
68
+ TaxonTree -> Subset GTDB tree by taxon
60
69
  compare_trees -> Compare trees with Mantel test
61
70
  rename_leaves -> Rename tree leaves
62
71
  print_leaves -> print out tree leaves
63
72
  FLN -> Format leaf names (e.g. remove spaces in names)
64
73
  ModifyTopo -> Modify tree topology
74
+ GeneRax -> (to be added) Run GeneRax
65
75
  ALE -> Modules for running ALE
66
- GeneRax -> Run GeneRax (to be added)
76
+ FunTree -> Infer tree for individual COG/KEGG function
67
77
  RootTree -> Root tree with outgroup leaves
78
+ RootTreeGTDB214 -> Root tree by GTDB taxonomy (r214)
79
+ RootTreeGTDB220 -> Root tree by GTDB taxonomy (r220)
80
+ LcaToLeaves -> Get two leaves that define an internal node
81
+ replace_clade -> Replace tree clade
82
+
83
+ Model-related
84
+ PMSF -> run iqtree with PMSF
85
+ PPA -> (to be added) Perform Posterior Predictive Analysis (across-site)
68
86
 
69
87
  Dating-related
70
- Dating -> Perform molecular dating
88
+ dating -> Perform molecular dating
71
89
  AssessCVG -> Assess dating convergence
72
90
  CompareMCMC -> Compare MCMCTree outputs
73
91
  PlotMcmcNode -> distribution of node's age estimation
74
92
  VisHPD95 -> HPD95 of estimated node age
75
93
  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
+
97
+ Phylo-related stats
98
+ PhyloBiAssoc -> A wrapper for binaryPGLMM test
@@ -10,6 +10,7 @@ TreeSAK ALE4 -> Filter ALE identified HGTs
10
10
  TreeSAK ALE5 -> Get RTC file based on ALE detected HGTs
11
11
  TreeSAK SingleAleHGT -> Perform HGT analysis using ALE for single protein family
12
12
  TreeSAK ALE6 -> faa ancestral genomes
13
+ TreeSAK ALE7 -> get function P/A in ancestral genomes
13
14
 
14
15
  # Example commands
15
16
  TreeSAK ALE1 -i OrthologousGroups.txt -s combined_d__Archaea_o_rs.faa -p oma -m 50 -t 12 -jst 3 -f -o ALE1_op_dir
@@ -18,6 +19,9 @@ TreeSAK ALE3 -i ALE2_op_dir -o ALE3_op_dir_c0.75 -f -c 0.75
18
19
  TreeSAK ALE4 -i1 ALE1_op_dir -i2 ALE2_op_dir -c genome_taxon.txt -color phylum_color.txt -o ALE4_op_dir_0.3 -fc 0.3 -f -api your_own_itol_api
19
20
  TreeSAK ALE4 -i1 ALE1_op_dir -i2 ALE2_op_dir -c genome_taxon.txt -color phylum_color.txt -o ALE4_op_dir_0.5 -fc 0.5 -f -api your_own_itol_api
20
21
  TreeSAK ALE4 -i1 ALE1_op_dir -i2 ALE2_op_dir -c genome_taxon.txt -color phylum_color.txt -o ALE4_op_dir_0.8 -fc 0.8 -f -api your_own_itol_api
22
+ TreeSAK ALE7 -6 ALE6_op_dir -fun ko.txt -node internal_node.txt -o Fun_PA.txt
23
+ TreeSAK ALE7 -6 ALE6_op_dir -fun K01995,K01995 -node 359,466,470 -o Fun_PA.txt
24
+ TreeSAK ALE7 -6 ALE6_op_dir -fun arCOG07811,K01995 -node 359,466,470 -o Fun_PA.txt
21
25
  TreeSAK SingleAleHGT -i OMA00001.aln -s genome.treefile -fc 0.3 -c genome_taxon.txt -color phylum_color.txt -api S1kZZuDHc0d5M7J5vLnUNQ -t 9 -f -o OMA00001_ALE_HGT_wd
22
26
 
23
27
  Note:
@@ -7,23 +7,33 @@ from distutils.spawn import find_executable
7
7
 
8
8
 
9
9
  ALE1_usage = '''
10
- ===================================== ALE1 example commands =====================================
10
+ ====================================== ALE1 example commands ======================================
11
11
 
12
- TreeSAK ALE1 -i OrthologousGroups.txt -s combined.faa -p oma -m 50 -jst 3 -f -o ALE1_op_dir
13
- TreeSAK ALE1 -ms s03_marker_seq -msx fa -p marker_set_1 -m 50 -jst 3 -f -o ALE1_op_dir
12
+ TreeSAK ALE1 -i OrthologousGroups.txt -s combined.faa -p oma -m 50 -jst 3 -f -o ALE1_op_dir -bmge
13
+ TreeSAK ALE1 -ms s03_marker_seq -msx fa -p marker_set_1 -m 50 -jst 3 -f -o ALE1_op_dir -bmge
14
14
 
15
- =================================================================================================
15
+ ===================================================================================================
16
16
  '''
17
17
 
18
18
 
19
+ def check_dependencies(program_list):
20
+
21
+ not_detected_programs = []
22
+ for needed_program in program_list:
23
+ if find_executable(needed_program) is None:
24
+ not_detected_programs.append(needed_program)
25
+
26
+ if not_detected_programs != []:
27
+ print('%s not found, program exited!' % ','.join(not_detected_programs))
28
+ exit()
29
+
30
+
19
31
  def sep_path_basename_ext(file_in):
20
32
 
21
- # separate path and file name
22
33
  f_path, file_name = os.path.split(file_in)
23
34
  if f_path == '':
24
35
  f_path = '.'
25
36
 
26
- # separate file basename and extension
27
37
  f_base, f_ext = os.path.splitext(file_name)
28
38
 
29
39
  return f_path, f_base, f_ext
@@ -65,17 +75,27 @@ def get_ortho_to_gene_dict(ortho_groups_txt, og_program):
65
75
 
66
76
  def ALE1(args):
67
77
 
68
- orthogroups_op_txt = args['i']
69
- combined_faa = args['s']
70
- og_program = args['p']
71
- marker_seq_dir = args['ms']
72
- marker_seq_ext = args['msx']
73
- min_og_genome_num = args['m']
74
- js_num_threads = args['jst']
75
- force_create_op_dir = args['f']
76
- op_dir = args['o']
77
- designate_ogs = []
78
- to_ignore_ogs_list = []
78
+ orthogroups_op_txt = args['i']
79
+ combined_faa = args['s']
80
+ og_program = args['p']
81
+ marker_seq_dir = args['ms']
82
+ marker_seq_ext = args['msx']
83
+ min_og_genome_num = args['m']
84
+ js_num_threads = args['jst']
85
+ force_create_op_dir = args['f']
86
+ op_dir = args['o']
87
+ trim_with_bmge = args['bmge']
88
+ bmge_trim_model = args['bmge_m']
89
+ bmge_entropy_score_cutoff = args['bmge_esc']
90
+ designate_ogs = []
91
+ to_ignore_ogs_list = []
92
+
93
+ # check dependencies
94
+ check_dependencies(['java', 'blastp', 'mafft-einsi'])
95
+
96
+ # specify path to BMGE.jar
97
+ current_file_path = '/'.join(os.path.realpath(__file__).split('/')[:-1])
98
+ pwd_bmge_jar = '%s/BMGE.jar' % current_file_path
79
99
 
80
100
  # define output file name
81
101
  get_gene_tree_cmds_txt = '%s_cmds.txt' % op_dir
@@ -140,10 +160,20 @@ def ALE1(args):
140
160
  qualified_og_gene_set = ortho_to_gene_dict[qualified_og]
141
161
  qualified_og_gene_faa = '%s/%s.faa' % (op_dir, qualified_og)
142
162
 
163
+ og_aln = '%s.aln' % qualified_og
164
+ og_aln_trimmed = '%s_trimmed.aln' % qualified_og
165
+
143
166
  # write out commands
144
- mafft_cmd = 'mafft-einsi --thread %s --quiet %s.faa > %s.aln' % (js_num_threads, qualified_og, qualified_og)
145
- iqtree_cmd = '%s -m LG+G+I -bb 1000 --wbtl -nt %s -s %s.aln -pre %s' % (iqtree_exe, js_num_threads, qualified_og, qualified_og)
146
- get_gene_tree_cmds_txt_handle.write('%s; %s\n' % (mafft_cmd, iqtree_cmd))
167
+ mafft_cmd = 'mafft-einsi --thread %s --quiet %s.faa > %s' % (js_num_threads, qualified_og, og_aln)
168
+ trim_cmd = 'java -jar %s -i %s -m %s -t AA -h %s -of %s' % (pwd_bmge_jar, og_aln, bmge_trim_model, bmge_entropy_score_cutoff, og_aln_trimmed)
169
+ iqtree_cmd = '%s -m LG+G+I -bb 1000 --wbtl -nt %s -s %s -pre %s' % (iqtree_exe, js_num_threads, og_aln, qualified_og)
170
+ if trim_with_bmge is True:
171
+ iqtree_cmd = '%s -m LG+G+I -bb 1000 --wbtl -nt %s -s %s -pre %s' % (iqtree_exe, js_num_threads, og_aln_trimmed, qualified_og)
172
+
173
+ if trim_with_bmge is True:
174
+ get_gene_tree_cmds_txt_handle.write('%s; %s; %s\n' % (mafft_cmd, trim_cmd, iqtree_cmd))
175
+ else:
176
+ get_gene_tree_cmds_txt_handle.write('%s; %s\n' % (mafft_cmd, iqtree_cmd))
147
177
 
148
178
  # write out sequences
149
179
  qualified_og_gene_faa_handle = open(qualified_og_gene_faa, 'w')
@@ -197,10 +227,21 @@ def ALE1(args):
197
227
  # copy sequence file into output directory
198
228
  os.system('cp %s/%s.%s %s/' % (marker_seq_dir, qualified_og, marker_seq_ext, op_dir))
199
229
 
230
+ qualified_og_aln = '%s.aln' % qualified_og
231
+ qualified_og_aln_trimmed = '%s_trimmed.aln' % qualified_og
232
+
200
233
  # write out commands
201
- mafft_cmd = 'mafft-einsi --thread %s --quiet %s.%s > %s.aln' % (js_num_threads, qualified_og, marker_seq_ext, qualified_og)
202
- iqtree_cmd = '%s -m LG+G+I -bb 1000 --wbtl -nt %s -s %s.aln -pre %s' % (iqtree_exe, js_num_threads, qualified_og, qualified_og)
203
- get_gene_tree_cmds_txt_handle.write('%s; %s\n' % (mafft_cmd, iqtree_cmd))
234
+ mafft_cmd = 'mafft-einsi --thread %s --quiet %s.%s > %s' % (js_num_threads, qualified_og, marker_seq_ext, qualified_og_aln)
235
+ trim_cmd = 'java -jar %s -i %s -m %s -t AA -h %s -of %s' % (pwd_bmge_jar, qualified_og_aln, bmge_trim_model, bmge_entropy_score_cutoff, qualified_og_aln_trimmed)
236
+ iqtree_cmd = '%s -m LG+G+I -bb 1000 --wbtl -nt %s -s %s -pre %s' % (iqtree_exe, js_num_threads, qualified_og_aln, qualified_og)
237
+ if trim_with_bmge is True:
238
+ iqtree_cmd = '%s -m LG+G+I -bb 1000 --wbtl -nt %s -s %s -pre %s' % (iqtree_exe, js_num_threads, qualified_og_aln_trimmed, qualified_og)
239
+
240
+ if trim_with_bmge is False:
241
+ get_gene_tree_cmds_txt_handle.write('%s; %s\n' % (mafft_cmd, iqtree_cmd))
242
+ else:
243
+ get_gene_tree_cmds_txt_handle.write('%s; %s; %s\n' % (mafft_cmd, trim_cmd, iqtree_cmd))
244
+
204
245
  get_gene_tree_cmds_txt_handle.close()
205
246
 
206
247
  print('Sequece files exported to %s.' % op_dir)
@@ -211,14 +252,17 @@ def ALE1(args):
211
252
  if __name__ == '__main__':
212
253
 
213
254
  ALE1_parser = argparse.ArgumentParser()
214
- ALE1_parser.add_argument('-i', required=False, default=None, help='orthologous groups, either from orthofinder or oma')
215
- ALE1_parser.add_argument('-s', required=False, default=None, help='sequence file, e.g., combined.faa')
216
- ALE1_parser.add_argument('-ms', required=False, default=None, help='input is a folder holds the sequence of each marker')
217
- ALE1_parser.add_argument('-msx', required=False, default='fa', help='file extension of marker sequence file, default: fa')
218
- ALE1_parser.add_argument('-p', required=True, help='orthologous identification program, orthofinder or oma')
219
- ALE1_parser.add_argument('-m', required=False, type=int, default=50, help='min_og_genome_num, default: 50')
220
- ALE1_parser.add_argument('-o', required=True, help='output dir, i.e., OMA working directory')
221
- ALE1_parser.add_argument('-jst', required=False, type=int, default=3, help='number of threads specified in job script, default: 3')
222
- ALE1_parser.add_argument('-f', required=False, action="store_true", help='force overwrite')
255
+ ALE1_parser.add_argument('-i', required=False, default=None, help='orthologous groups, either from orthofinder or oma')
256
+ ALE1_parser.add_argument('-s', required=False, default=None, help='sequence file, e.g., combined.faa')
257
+ ALE1_parser.add_argument('-ms', required=False, default=None, help='input is a folder holds the sequence of each marker')
258
+ ALE1_parser.add_argument('-msx', required=False, default='fa', help='file extension of marker sequence file, default: fa')
259
+ ALE1_parser.add_argument('-p', required=True, help='orthologous identification program, orthofinder or oma')
260
+ ALE1_parser.add_argument('-m', required=False, type=int, default=50, help='min_og_genome_num, default: 50')
261
+ ALE1_parser.add_argument('-bmge', required=False, action="store_true", help='trim MSA with BMGE, default no trimming')
262
+ ALE1_parser.add_argument('-bmge_m', required=False, default='BLOSUM30', help='BMGE trim model, default: BLOSUM30')
263
+ ALE1_parser.add_argument('-bmge_esc', required=False, default='0.55', help='BMGE entropy score cutoff, default: 0.55')
264
+ ALE1_parser.add_argument('-o', required=True, help='output dir, i.e., OMA working directory')
265
+ ALE1_parser.add_argument('-jst', required=False, type=int, default=3, help='number of threads specified in job script, default: 3')
266
+ ALE1_parser.add_argument('-f', required=False, action="store_true", help='force overwrite')
223
267
  args = vars(ALE1_parser.parse_args())
224
268
  ALE1(args)
@@ -6,9 +6,9 @@ import multiprocessing as mp
6
6
 
7
7
 
8
8
  ALE2_usage = '''
9
- ========================= ALE2 example commands =========================
9
+ ============================================ ALE2 example commands ===========================================
10
10
 
11
- TreeSAK ALE2 -i ALE1_op_dir -s genome.treefile -t 10 -f -runALE -docker gregmich/alesuite_new -o ALE2_op_dir
11
+ TreeSAK ALE2 -1 ALE1_op_dir -s genome.treefile -t 10 -f -runALE -docker gregmich/alesuite_new -o ALE2_op_dir
12
12
 
13
13
  Note:
14
14
  Genome names should NOT contain "_", the program will tackle this automatically.
@@ -16,7 +16,9 @@ Genome names should NOT contain "_", the program will tackle this automatically.
16
16
  # You can try to add this while building the docker images
17
17
  --platform linux/arm64/v8
18
18
 
19
- =========================================================================
19
+ # Only the ufboot files in ALE1_op_dir will be needed in this step.
20
+
21
+ ===============================================================================================================
20
22
  '''
21
23
 
22
24
 
@@ -67,16 +69,16 @@ def prepare_ale_ip_worker(arg_list):
67
69
 
68
70
  def ALE2(args):
69
71
 
70
- gene_tree_dir = args['i']
72
+ ale1_op_dir = args['1']
71
73
  genome_tree_file_rooted = args['s']
72
74
  force_create_ale_wd = args['f']
73
75
  num_threads = args['t']
74
- ale_wd = args['o']
76
+ ale2_op_dir = args['o']
75
77
  run_ale = args['runALE']
76
78
  docker_image = args['docker']
77
- run_ale_cmds_txt = '%s_cmds.txt' % ale_wd
79
+ run_ale_cmds_txt = '%s_cmds.txt' % ale2_op_dir
78
80
 
79
- ufboot_file_re = '%s/*.ufboot' % gene_tree_dir
81
+ ufboot_file_re = '%s/*.ufboot' % ale1_op_dir
80
82
  ufboot_file_list = glob.glob(ufboot_file_re)
81
83
  og_to_process_list = []
82
84
  for each_ufboot in ufboot_file_list:
@@ -84,15 +86,15 @@ def ALE2(args):
84
86
  og_to_process_list.append(ufboot_base)
85
87
 
86
88
  # define file name
87
- gnm_tree_no_underscore = 'genome_tree.newick'
88
- gnm_tree_leaf_rename_txt = 'genome_tree_leaf_rename.txt'
89
- gnm_tree_no_underscore_in_wd = '%s/%s' % (ale_wd, gnm_tree_no_underscore)
89
+ gnm_tree_no_underscore = 'genome_tree.newick'
90
+ gnm_tree_leaf_rename_txt = 'genome_tree_leaf_rename.txt'
91
+ gnm_tree_no_underscore_in_wd = '%s/%s' % (ale2_op_dir, gnm_tree_no_underscore)
90
92
 
91
- # create ale_wd
93
+ # create ale2_op_dir
92
94
  if force_create_ale_wd is True:
93
- if os.path.isdir(ale_wd) is True:
94
- os.system('rm -r %s' % ale_wd)
95
- os.system('mkdir %s' % ale_wd)
95
+ if os.path.isdir(ale2_op_dir) is True:
96
+ os.system('rm -r %s' % ale2_op_dir)
97
+ os.system('mkdir %s' % ale2_op_dir)
96
98
 
97
99
  # prepare genome tree for running ALE
98
100
  gnm_tree_leaf_rename_txt_handle = open(gnm_tree_leaf_rename_txt, 'w')
@@ -113,20 +115,19 @@ def ALE2(args):
113
115
  prepare_ale_ip_worker_arg_lol = []
114
116
  ale_cmd_list = []
115
117
  for qualified_og in og_to_process_list:
116
- pwd_gene_tree_ufboot = '%s/%s.ufboot' % (gene_tree_dir, qualified_og)
118
+ pwd_gene_tree_ufboot = '%s/%s.ufboot' % (ale1_op_dir, qualified_og)
117
119
  if os.path.isfile(pwd_gene_tree_ufboot) is False:
118
120
  print('%s not found, please build gene tree first!' % pwd_gene_tree_ufboot)
119
121
  else:
120
- gene_tree_ufboot = '%s.ufboot' % qualified_og
121
- ALEobserve_stdout = '%s.ALEobserve.log' % qualified_og
122
- ALEml_undated_stdout = '%s.ALEml_undated.log' % qualified_og
123
- pwd_gene_tree_ufboot_in = '%s/%s' % (gene_tree_dir, gene_tree_ufboot)
124
- pwd_gene_tree_ufboot_out = '%s/%s' % (ale_wd, gene_tree_ufboot)
125
- obtain_ale_file_cmd = 'ALEobserve %s > %s' % (gene_tree_ufboot, ALEobserve_stdout)
126
- reconciliation_cmd = 'ALEml_undated %s %s.ufboot.ale > %s' % (gnm_tree_no_underscore, qualified_og, ALEml_undated_stdout)
122
+ pwd_gene_tree_ufboot_in = '%s/%s.ufboot' % (ale1_op_dir, qualified_og)
123
+ pwd_gene_tree_ufboot_out = '%s/%s.ufboot' % (ale2_op_dir, qualified_og)
124
+
125
+ # get commands for ALEobserve and ALEml_undated
126
+ obtain_ale_file_cmd = 'ALEobserve %s.ufboot > %s.ALEobserve.log' % (qualified_og, qualified_og)
127
+ reconciliation_cmd = 'ALEml_undated %s %s.ufboot.ale > %s.ALEml_undated.log' % (gnm_tree_no_underscore, qualified_og, qualified_og)
127
128
  if docker_image is not None:
128
- obtain_ale_file_cmd = 'docker run -v $PWD:$PWD -w $PWD %s %s' % (docker_image, obtain_ale_file_cmd)
129
- reconciliation_cmd = 'docker run -v $PWD:$PWD -w $PWD %s %s' % (docker_image, reconciliation_cmd)
129
+ obtain_ale_file_cmd = 'docker run -v $PWD:$PWD -w $PWD %s %s' % (docker_image, obtain_ale_file_cmd)
130
+ reconciliation_cmd = 'docker run -v $PWD:$PWD -w $PWD %s %s' % (docker_image, reconciliation_cmd)
130
131
 
131
132
  current_arg_list = [pwd_gene_tree_ufboot_in, pwd_gene_tree_ufboot_out]
132
133
  run_ale_cmds_txt_handle.write('%s; %s\n' % (obtain_ale_file_cmd, reconciliation_cmd))
@@ -144,7 +145,7 @@ def ALE2(args):
144
145
  # run ALE
145
146
  if run_ale is True:
146
147
  print('running ALE with %s cores for %s OGs' % (num_threads, len(prepare_ale_ip_worker_arg_lol)))
147
- os.chdir(ale_wd)
148
+ os.chdir(ale2_op_dir)
148
149
  pool = mp.Pool(processes=num_threads)
149
150
  pool.map(os.system, ale_cmd_list)
150
151
  pool.close()
@@ -156,7 +157,7 @@ def ALE2(args):
156
157
  if __name__ == '__main__':
157
158
 
158
159
  ALE2_parser = argparse.ArgumentParser()
159
- ALE2_parser.add_argument('-i', required=True, help='ALE1 output directory')
160
+ ALE2_parser.add_argument('-1', required=True, help='ALE1 output directory')
160
161
  ALE2_parser.add_argument('-s', required=True, help='rooted species tree')
161
162
  ALE2_parser.add_argument('-o', required=True, help='output dir, i.e., OMA working directory')
162
163
  ALE2_parser.add_argument('-runALE', required=False, action="store_true", help='run ALE')
@@ -6,7 +6,10 @@ import pandas as pd
6
6
  ALE3_usage = '''
7
7
  ================= ALE3 example commands =================
8
8
 
9
- TreeSAK ALE3 -i ALE2_op_dir -o ALE3_op_dir -f -c 0.75
9
+ TreeSAK ALE3 -2 ALE2_op_dir -o ALE3_op_dir_30 -f -c 30
10
+ TreeSAK ALE3 -2 ALE2_op_dir -o ALE3_op_dir_75 -f -c 75
11
+
12
+ # Needs the uml_rec files
10
13
 
11
14
  =========================================================
12
15
  '''
@@ -96,11 +99,11 @@ def get_verticality_and_transfer_propensity(TableEvents_tsv, verticality_txt, tr
96
99
 
97
100
  def ALE3(args):
98
101
 
99
- uml_rec_dir = args['i']
100
- gene_presence_cutoff = args['c']
101
- fun_des_txt = args['a']
102
- op_dir = args['o']
103
- force_create_op_dir = args['f']
102
+ uml_rec_dir = args['2']
103
+ gene_presence_cutoff = args['c']
104
+ fun_des_txt = args['a']
105
+ op_dir = args['o']
106
+ force_create_op_dir = args['f']
104
107
 
105
108
  # read in fun_des_txt
106
109
  fun_des_dict = dict()
@@ -131,9 +134,12 @@ def ALE3(args):
131
134
  os.system('mkdir %s' % op_dir)
132
135
  os.system('mkdir %s' % gene_content_dir)
133
136
 
137
+ # parsing ALE2 outputs
138
+ print('Parsing ALE2 outputs')
134
139
  ale_parser(uml_rec_dir, SpeciesTreeRef_newick, TableInfo_tsv, TableEvents_tsv, GeneTrees_nwk)
135
140
 
136
141
  # get_verticality_and_transfer_propensity
142
+ print('Getting verticality and transfer propensity')
137
143
  get_verticality_and_transfer_propensity(TableEvents_tsv, verticality_txt, transfer_propensity_txt, fun_des_dict)
138
144
 
139
145
  # get genome content
@@ -150,7 +156,7 @@ def ALE3(args):
150
156
  gene_family = gene_family.replace('.ufboot', '')
151
157
  gene_branch = each_line_split[col_index['Branch']]
152
158
  gene_presence = float(each_line_split[col_index['presence']])
153
- if gene_presence >= gene_presence_cutoff:
159
+ if gene_presence >= (gene_presence_cutoff/100):
154
160
  og_set.add(gene_family)
155
161
  if gene_branch not in branch_to_og_dict:
156
162
  branch_to_og_dict[gene_branch] = set()
@@ -190,8 +196,8 @@ def ALE3(args):
190
196
  if __name__ == '__main__':
191
197
 
192
198
  ALE3_parser = argparse.ArgumentParser()
193
- ALE3_parser.add_argument('-i', required=True, help='Folder with uml_rec files')
194
- ALE3_parser.add_argument('-c', required=False, type=float, default=0.8, help='gene family presence cutoff, default: 0.8')
199
+ ALE3_parser.add_argument('-2', required=True, help='Folder with the uml_rec files')
200
+ ALE3_parser.add_argument('-c', required=False, type=float, default=75, help='gene family presence cutoff in percentage, default: 75')
195
201
  ALE3_parser.add_argument('-a', required=False, default=None, help='OG functional description')
196
202
  ALE3_parser.add_argument('-o', required=True, help='output dir')
197
203
  ALE3_parser.add_argument('-f', required=False, action="store_true", help='force overwrite')
@@ -13,9 +13,9 @@ from PyPDF3 import PdfFileWriter, PdfFileReader
13
13
  ALE4_usage = '''
14
14
  ========================= ALE4 example commands =========================
15
15
 
16
- TreeSAK ALE4 -i1 ALE1_op_dir -i2 ALE2_op_dir -c genome_taxon.txt -color phylum_color.txt -f -api your_own_itol_api -fc 0.3 -o ALE4_op_dir_0.3
17
- TreeSAK ALE4 -i1 ALE1_op_dir -i2 ALE2_op_dir -c genome_taxon.txt -color phylum_color.txt -f -api your_own_itol_api -fc 0.5 -o ALE4_op_dir_0.5
18
- TreeSAK ALE4 -i1 ALE1_op_dir -i2 ALE2_op_dir -c genome_taxon.txt -color phylum_color.txt -f -api your_own_itol_api -fc 0.8 -o ALE4_op_dir_0.8
16
+ TreeSAK ALE4 -1 ALE1_op_dir -2 ALE2_op_dir -c genome_taxon.txt -color phylum_color.txt -f -api your_own_itol_api -fc 0.3 -o ALE4_op_dir_0.3
17
+ TreeSAK ALE4 -1 ALE1_op_dir -2 ALE2_op_dir -c genome_taxon.txt -color phylum_color.txt -f -api your_own_itol_api -fc 0.5 -o ALE4_op_dir_0.5
18
+ TreeSAK ALE4 -1 ALE1_op_dir -2 ALE2_op_dir -c genome_taxon.txt -color phylum_color.txt -f -api your_own_itol_api -fc 0.8 -o ALE4_op_dir_0.8
19
19
 
20
20
  # To do:
21
21
  # add protein family to the top of the pdf file
@@ -504,8 +504,8 @@ def parse_ale_op_worker(arg_list):
504
504
 
505
505
  def ALE4(args):
506
506
 
507
- ale1_op_dir = args['i1']
508
- ale2_op_dir = args['i2']
507
+ ale1_op_dir = args['1']
508
+ ale2_op_dir = args['2']
509
509
  genome_taxon_txt = args['c']
510
510
  ar_phylum_color_code_txt = args['color']
511
511
  op_dir = args['o']
@@ -621,8 +621,8 @@ def ALE4(args):
621
621
  if __name__ == '__main__':
622
622
 
623
623
  ALE4_parser = argparse.ArgumentParser()
624
- ALE4_parser.add_argument('-i1', required=True, help='ALE1 output directory')
625
- ALE4_parser.add_argument('-i2', required=True, help='ALE2 output directory')
624
+ ALE4_parser.add_argument('-1', required=True, help='ALE1 output directory')
625
+ ALE4_parser.add_argument('-2', required=True, help='ALE2 output directory')
626
626
  ALE4_parser.add_argument('-c', required=True, help='genome_taxon, GTDB format')
627
627
  ALE4_parser.add_argument('-color', required=True, help='phylum color code')
628
628
  ALE4_parser.add_argument('-o', required=True, help='output dir, i.e., ALE4_op_dir')