TreeSAK 1.40.6__tar.gz → 1.41.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 (111) hide show
  1. {TreeSAK-1.40.6/TreeSAK.egg-info → TreeSAK-1.41.0}/PKG-INFO +2 -2
  2. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/MarkerRef2Tree.py +4 -4
  3. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/VERSION +3 -0
  4. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/replace_clade.py +2 -0
  5. TreeSAK-1.41.0/TreeSAK/tc.py +92 -0
  6. {TreeSAK-1.40.6 → TreeSAK-1.41.0/TreeSAK.egg-info}/PKG-INFO +2 -2
  7. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK.egg-info/SOURCES.txt +1 -0
  8. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/bin/TreeSAK +10 -0
  9. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/LICENSE +0 -0
  10. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/MANIFEST.in +0 -0
  11. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/README.md +0 -0
  12. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/ALE.py +0 -0
  13. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/ALE1.py +0 -0
  14. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/ALE2.py +0 -0
  15. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/ALE2RTC.py +0 -0
  16. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/ALE3.py +0 -0
  17. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/ALE4.py +0 -0
  18. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/ALE5.py +0 -0
  19. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/ALE6.py +0 -0
  20. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/ALE_backup.py +0 -0
  21. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/AssessCVG.py +0 -0
  22. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/AssessMarker.py +0 -0
  23. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/AssessMarkerDeltaLL.py +0 -0
  24. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/AssessMarkerPA.py +0 -0
  25. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/AssessPB.py +0 -0
  26. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/BMGE.jar +0 -0
  27. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/BMGE.py +0 -0
  28. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/CompareMCMC.py +0 -0
  29. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/ConcateMSA.py +0 -0
  30. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/ConvertMSA.py +0 -0
  31. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/Dir.rb +0 -0
  32. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/ExtractMarkerSeq.py +0 -0
  33. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/FastRoot.py +0 -0
  34. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/FastRoot_backup.py +0 -0
  35. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/GTDB_tree.py +0 -0
  36. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/KEGG_Luo17.py +0 -0
  37. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/LcaToLeaves.py +0 -0
  38. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/MCMCtreeR.py +0 -0
  39. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/MarkerRef2Tree_backup.py +0 -0
  40. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/MarkerSeq2Tree.py +0 -0
  41. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/ModifyTopo.py +0 -0
  42. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/Newick_tree_plotter.py +0 -0
  43. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/OMA.py +0 -0
  44. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/OMA2.py +0 -0
  45. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/OneLineAln.py +0 -0
  46. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/PB.py +0 -0
  47. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/PMSF.py +0 -0
  48. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/PhyloBiAssoc.R +0 -0
  49. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/PhyloBiAssoc.py +0 -0
  50. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/PlotMCMC.py +0 -0
  51. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/PlotMcmcNode.py +0 -0
  52. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/RootTree.py +0 -0
  53. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/RootTreeGTDB214.py +0 -0
  54. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/RootTreeGTDB220.py +0 -0
  55. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/SequentialDating.py +0 -0
  56. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/SingleAleHGT.py +0 -0
  57. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/SingleLinePhy.py +0 -0
  58. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/SliceMSA.py +0 -0
  59. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/SplitScore.py +0 -0
  60. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/SplitScore1.py +0 -0
  61. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/SplitScore1OMA.py +0 -0
  62. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/SplitScore2.py +0 -0
  63. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/TaxaCountStats.R +0 -0
  64. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/TaxonTree.py +0 -0
  65. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/TreeSAK_config.py +0 -0
  66. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/VisHPD95.R +0 -0
  67. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/VisHPD95.py +0 -0
  68. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/__init__.py +0 -0
  69. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/ale_parser.py +0 -0
  70. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/ale_splitter.py +0 -0
  71. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/alignment_pruner.pl +0 -0
  72. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/aster.py +0 -0
  73. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/catfasta2phy.py +0 -0
  74. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/compare_trees.R +0 -0
  75. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/compare_trees.py +0 -0
  76. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/dating.py +0 -0
  77. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/dating_ss.py +0 -0
  78. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/deltall.py +0 -0
  79. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/do_rrtc.rb +0 -0
  80. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/fa2phy.py +0 -0
  81. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/format_leaf_name.py +0 -0
  82. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/gap_stats.py +0 -0
  83. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/get_SCG_tree.py +0 -0
  84. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/get_arCOG_seq.py +0 -0
  85. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/global_functions.py +0 -0
  86. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/iTOL.py +0 -0
  87. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/keep_highest_rrtc.py +0 -0
  88. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/label_tree.R +0 -0
  89. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/label_tree.py +0 -0
  90. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/mad.py +0 -0
  91. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/mcmctree.py +0 -0
  92. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/merge_pdf.py +0 -0
  93. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/pRTC.py +0 -0
  94. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/plot_distruibution_th.py +0 -0
  95. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/prep_mcmctree_ctl.py +0 -0
  96. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/print_leaves.py +0 -0
  97. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/pruneMSA.py +0 -0
  98. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/recode.py +0 -0
  99. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/rename_leaves.py +0 -0
  100. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/root_with_out_group.py +0 -0
  101. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/run_TaxaCountStats_R_s1.py +0 -0
  102. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/subsample_drep_gnms.py +0 -0
  103. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/subset.py +0 -0
  104. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/subset_tree_stupid_old_way.py +0 -0
  105. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/tmp_1.py +0 -0
  106. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK/weighted_rand.rb +0 -0
  107. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK.egg-info/dependency_links.txt +0 -0
  108. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK.egg-info/requires.txt +0 -0
  109. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/TreeSAK.egg-info/top_level.txt +0 -0
  110. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/setup.cfg +0 -0
  111. {TreeSAK-1.40.6 → TreeSAK-1.41.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TreeSAK
3
- Version: 1.40.6
3
+ Version: 1.41.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.40.6
27
+ TreeSAK v1.41.0
@@ -13,8 +13,8 @@ MarkerRef2Tree_usage = '''
13
13
  Dependencies: java, blastp, mafft-einsi, trimal, iqtree2
14
14
 
15
15
  # example commands
16
- TreeSAK MarkerRef2Tree -i faa_files -x faa -m marker_seq -mx fa -o output_dir -e 10 -t 6 -c 85
17
- TreeSAK MarkerRef2Tree -i faa_files -x faa -m marker_seq -mx fa -o output_dir -e 10 -t 6 -c 75,100
16
+ TreeSAK MarkerRef2Tree -i faa_files -x faa -m marker_seq -mx fa -o output_dir -bmge -e 10 -t 6 -c 85
17
+ TreeSAK MarkerRef2Tree -i faa_files -x faa -m marker_seq -mx fa -o output_dir -bmge -e 10 -t 6 -c 75,100
18
18
 
19
19
  # file extension need to be faa
20
20
 
@@ -349,8 +349,8 @@ def MarkerRef2Tree(args):
349
349
  check_dependencies(['java', 'psiblast', 'blastp', 'mafft-einsi', 'trimal', 'iqtree'])
350
350
 
351
351
  # specify path to BMGE.jar
352
- current_file_path = '/'.join(os.path.realpath(__file__).split('/')[:-1])
353
- pwd_bmge_jar = '%s/BMGE.jar' % current_file_path
352
+ current_file_path = '/'.join(os.path.realpath(__file__).split('/')[:-1])
353
+ pwd_bmge_jar = '%s/BMGE.jar' % current_file_path
354
354
 
355
355
  # get marker id set
356
356
  marker_seq_re = '%s/*.%s' % (marker_seq_dir, marker_seq_ext)
@@ -1,3 +1,6 @@
1
+ 1.41.0
2
+ - new module added: tc
3
+
1
4
  1.40.6
2
5
  - fixed bugs
3
6
 
@@ -41,6 +41,8 @@ def replace_clade(args):
41
41
  main_tre.write(outfile=tree_out, format=tree_out_fmt)
42
42
 
43
43
 
44
+
45
+
44
46
  if __name__ == '__main__':
45
47
 
46
48
  replace_clade_parser = argparse.ArgumentParser()
@@ -0,0 +1,92 @@
1
+ import argparse
2
+ from ete3 import Tree
3
+
4
+
5
+ tc_usage = '''
6
+ ======================= tc example commands =======================
7
+
8
+ TreeSAK tc -i in.tree -o out.tree -tc time_constraints.txt
9
+
10
+ # Format of constraint file (use tab to separate nodes and ages)
11
+ GCA226486700_1,GCF900696045_1 3.46-4.38
12
+ GCA000802205_2,GCF000299365_1 0.75-1.49
13
+ GCF000376445_1,GCF000172995_2 -1.579
14
+ GCF000152265_2,GCF000195915_1 2.32-
15
+
16
+ ===================================================================
17
+ '''
18
+
19
+
20
+ def tc(args):
21
+
22
+ tree_file_in = args['i']
23
+ time_constraint_txt = args['tc']
24
+ tree_file_out = args['o']
25
+
26
+ constraint_set = set()
27
+ constraint_dict = dict()
28
+ not_recognizable_time_constraint_set = set()
29
+ for each_constraint in open(time_constraint_txt):
30
+ each_constraint_split = each_constraint.strip().split('\t')
31
+ leaf_ids = each_constraint_split[0]
32
+ provided_age = each_constraint_split[1]
33
+
34
+ str_to_add = ''
35
+ if provided_age.startswith('-'):
36
+ str_to_add = '<%s' % provided_age[1:]
37
+ elif provided_age.endswith('-'):
38
+ str_to_add = '>%s' % provided_age[:-1]
39
+ elif '-' in provided_age:
40
+ provided_age_split = provided_age.split('-')
41
+ str_to_add = '>%s<%s' % (provided_age_split[0], provided_age_split[1])
42
+ else:
43
+ not_recognizable_time_constraint_set.add(provided_age)
44
+
45
+ constraint_dict[leaf_ids] = str_to_add
46
+ constraint_set.add(str_to_add)
47
+
48
+ if len(not_recognizable_time_constraint_set) > 0:
49
+ print('Format of the following time constraints are not recognizable, program exited')
50
+ print(','.join(not_recognizable_time_constraint_set))
51
+ exit()
52
+
53
+ # read in tree
54
+ tree_in = Tree(tree_file_in, quoted_node_names=True, format=1)
55
+
56
+ # add time constraints as node name
57
+ for each_node in constraint_dict:
58
+ node_age = constraint_dict[each_node]
59
+ node_split = each_node.split(',')
60
+ current_lca = tree_in.get_common_ancestor(node_split)
61
+ current_lca.add_features(custom_label=node_age)
62
+ current_lca.name = node_age
63
+
64
+ tree_out_str = tree_in.write(format=1)
65
+
66
+ # remove branch length of 1
67
+ tree_out_str = tree_out_str.replace(':1', '')
68
+
69
+ # quote constraint strings
70
+ for each_constraint in constraint_set:
71
+ tree_out_str = tree_out_str.replace(each_constraint, ("'%s'" % each_constraint))
72
+
73
+ # write tree to file
74
+ with open(tree_file_out, 'w') as tree_file_out_handle:
75
+ tree_file_out_handle.write(tree_out_str)
76
+
77
+
78
+ if __name__ == '__main__':
79
+
80
+ tc_parser = argparse.ArgumentParser()
81
+ tc_parser.add_argument('-i', required=True, help='input tree')
82
+ tc_parser.add_argument('-o', required=True, help='output tree')
83
+ tc_parser.add_argument('-tc', required=True, help='time constraint file')
84
+ args = vars(tc_parser.parse_args())
85
+ tc(args)
86
+
87
+
88
+ '''
89
+
90
+ python3 /Users/songweizhi/PycharmProjects/TreeSAK/TreeSAK/tc.py -i in.tree -o out.tree -tc /Users/songweizhi/Desktop/time_constraints.txt
91
+
92
+ '''
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TreeSAK
3
- Version: 1.40.6
3
+ Version: 1.41.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.40.6
27
+ TreeSAK v1.41.0
@@ -98,6 +98,7 @@ TreeSAK/run_TaxaCountStats_R_s1.py
98
98
  TreeSAK/subsample_drep_gnms.py
99
99
  TreeSAK/subset.py
100
100
  TreeSAK/subset_tree_stupid_old_way.py
101
+ TreeSAK/tc.py
101
102
  TreeSAK/tmp_1.py
102
103
  TreeSAK/weighted_rand.rb
103
104
  TreeSAK.egg-info/PKG-INFO
@@ -89,6 +89,7 @@ def print_main_help():
89
89
  PlotMcmcNode -> distribution of node's age estimation
90
90
  VisHPD95 -> HPD95 of estimated node age
91
91
  pRTC -> Perform probabilistic RTC dating
92
+ tc -> adding time constraints to mcmctree tree
92
93
 
93
94
  Phylo-related stats
94
95
  PhyloBiAssoc -> A wrapper for binaryPGLMM test
@@ -789,6 +790,15 @@ if __name__ == '__main__':
789
790
  args = vars(parser.parse_args())
790
791
  TaxonTree.TaxonTree(args)
791
792
 
793
+ elif sys.argv[1] == 'tc':
794
+ from TreeSAK import tc
795
+ tc_parser = subparsers.add_parser('tc', usage=tc.tc_usage)
796
+ tc_parser.add_argument('-i', required=True, help='input tree')
797
+ tc_parser.add_argument('-o', required=True, help='output tree')
798
+ tc_parser.add_argument('-tc', required=True, help='time constraint file')
799
+ args = vars(parser.parse_args())
800
+ tc.tc(args)
801
+
792
802
  else:
793
803
  print('Unrecognized module: %s, program exited' % sys.argv[1])
794
804
  exit()
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