TreeSAK 1.35.3__tar.gz → 1.36.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 (100) hide show
  1. {TreeSAK-1.35.3/TreeSAK.egg-info → TreeSAK-1.36.0}/PKG-INFO +2 -2
  2. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/MarkerRef2Tree.py +19 -0
  3. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/MarkerSeq2Tree.py +19 -0
  4. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/SplitScore2.py +1 -1
  5. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/VERSION +3 -0
  6. TreeSAK-1.36.0/TreeSAK/gap_stats.py +38 -0
  7. {TreeSAK-1.35.3 → TreeSAK-1.36.0/TreeSAK.egg-info}/PKG-INFO +2 -2
  8. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK.egg-info/SOURCES.txt +1 -0
  9. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/bin/TreeSAK +9 -1
  10. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/LICENSE +0 -0
  11. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/MANIFEST.in +0 -0
  12. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/README.md +0 -0
  13. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/ALE.py +0 -0
  14. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/ALE1.py +0 -0
  15. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/ALE2.py +0 -0
  16. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/ALE2RTC.py +0 -0
  17. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/ALE3.py +0 -0
  18. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/ALE4.py +0 -0
  19. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/ALE5.py +0 -0
  20. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/ALE6.py +0 -0
  21. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/ALE_backup.py +0 -0
  22. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/AlignmentPruner.py +0 -0
  23. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/AssessCVG.py +0 -0
  24. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/AssessMarker.py +0 -0
  25. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/AssessMarkerDeltaLL.py +0 -0
  26. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/AssessMarkerPA.py +0 -0
  27. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/AssessPB.py +0 -0
  28. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/BMGE.jar +0 -0
  29. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/BMGE.py +0 -0
  30. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/CompareMCMC.py +0 -0
  31. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/ConcateMSA.py +0 -0
  32. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/ConvertMSA.py +0 -0
  33. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/Dir.rb +0 -0
  34. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/ExtractMarkerSeq.py +0 -0
  35. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/FastRoot.py +0 -0
  36. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/FastRoot_backup.py +0 -0
  37. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/GTDB_tree.py +0 -0
  38. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/KEGG_Luo17.py +0 -0
  39. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/LcaToLeaves.py +0 -0
  40. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/MCMCtreeR.py +0 -0
  41. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/MarkerRef2Tree_backup.py +0 -0
  42. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/ModifyTopo.py +0 -0
  43. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/OMA.py +0 -0
  44. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/OMA2.py +0 -0
  45. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/OneLineAln.py +0 -0
  46. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/PB.py +0 -0
  47. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/PMSF.py +0 -0
  48. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/PhyloBiAssoc.R +0 -0
  49. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/PhyloBiAssoc.py +0 -0
  50. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/PlotMcmcNode.py +0 -0
  51. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/RootTree.py +0 -0
  52. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/RootTreeGTDB214.py +0 -0
  53. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/RootTreeGTDB220.py +0 -0
  54. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/SequentialDating.py +0 -0
  55. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/SingleAleHGT.py +0 -0
  56. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/SingleLinePhy.py +0 -0
  57. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/SliceMSA.py +0 -0
  58. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/SplitScore.py +0 -0
  59. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/SplitScore1.py +0 -0
  60. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/SplitScore1OMA.py +0 -0
  61. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/TaxaCountStats.R +0 -0
  62. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/TreeSAK_config.py +0 -0
  63. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/VisHPD95.R +0 -0
  64. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/VisHPD95.py +0 -0
  65. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/__init__.py +0 -0
  66. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/ale_parser.py +0 -0
  67. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/ale_splitter.py +0 -0
  68. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/compare_trees.R +0 -0
  69. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/compare_trees.py +0 -0
  70. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/dating.py +0 -0
  71. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/dating_ss.py +0 -0
  72. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/do_rrtc.rb +0 -0
  73. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/fa2phy.py +0 -0
  74. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/format_leaf_name.py +0 -0
  75. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/get_arCOG_seq.py +0 -0
  76. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/global_functions.py +0 -0
  77. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/merge_pdf.py +0 -0
  78. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/pRTC.py +0 -0
  79. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/parse_deltall_stdout.py +0 -0
  80. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/plot_distruibution_th.py +0 -0
  81. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/prep_mcmctree_ctl.py +0 -0
  82. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/print_leaves.py +0 -0
  83. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/rename_leaves.py +0 -0
  84. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/replace_clade.py +0 -0
  85. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/root_with_out_group.py +0 -0
  86. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/run_TaxaCountStats_R_s1.py +0 -0
  87. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/subsample_drep_gnms.py +0 -0
  88. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/subset.py +0 -0
  89. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/subset_tree_stupid_old_way.py +0 -0
  90. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/test_1.py +0 -0
  91. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/test_2.py +0 -0
  92. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/tmp_2.py +0 -0
  93. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/tmp_3.py +0 -0
  94. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/tmp_4.py +0 -0
  95. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK/weighted_rand.rb +0 -0
  96. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK.egg-info/dependency_links.txt +0 -0
  97. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK.egg-info/requires.txt +0 -0
  98. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/TreeSAK.egg-info/top_level.txt +0 -0
  99. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/setup.cfg +0 -0
  100. {TreeSAK-1.35.3 → TreeSAK-1.36.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TreeSAK
3
- Version: 1.35.3
3
+ Version: 1.36.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.35.3
27
+ TreeSAK v1.36.0
@@ -290,6 +290,25 @@ def AssessMarkerPA(trimmed_aln_dir, gnm_set, group_to_gnm_dict, present_pct_cuto
290
290
  print('Assessment results exported to:\n%s\n%s' % (assess_summary_1_txt, assess_summary_2_txt))
291
291
 
292
292
 
293
+ def get_gap_stats(msa_in_fa, stats_txt):
294
+
295
+ gap_pct_dict = dict()
296
+ for each_seq in SeqIO.parse(msa_in_fa, 'fasta'):
297
+ seq_id = each_seq.id
298
+ seq_str = str(each_seq.seq)
299
+ gap_pct = seq_str.count('-')*100/len(seq_str)
300
+ gap_pct = float("{0:.2f}".format(gap_pct))
301
+ gap_pct_dict[seq_id] = gap_pct
302
+
303
+ gap_pct_sorted = sorted(gap_pct_dict.items(), key=lambda x:x[1])
304
+
305
+ stats_txt_handle = open(stats_txt, 'w')
306
+ stats_txt_handle.write('Sequence\tGap\n')
307
+ for each_seq in gap_pct_sorted:
308
+ stats_txt_handle.write('%s\t%s\n' % (each_seq[0], each_seq[1]))
309
+ stats_txt_handle.close()
310
+
311
+
293
312
  def MarkerRef2Tree(args):
294
313
 
295
314
  faa_file_dir = args['i']
@@ -94,6 +94,25 @@ def catfasta2phy(msa_dir, msa_ext, concatenated_msa_phy, partition_file):
94
94
  AlignIO.convert(concatenated_msa_fasta, 'fasta', concatenated_msa_phy, 'phylip-relaxed')
95
95
 
96
96
 
97
+ def get_gap_stats(msa_in_fa, stats_txt):
98
+
99
+ gap_pct_dict = dict()
100
+ for each_seq in SeqIO.parse(msa_in_fa, 'fasta'):
101
+ seq_id = each_seq.id
102
+ seq_str = str(each_seq.seq)
103
+ gap_pct = seq_str.count('-')*100/len(seq_str)
104
+ gap_pct = float("{0:.2f}".format(gap_pct))
105
+ gap_pct_dict[seq_id] = gap_pct
106
+
107
+ gap_pct_sorted = sorted(gap_pct_dict.items(), key=lambda x:x[1])
108
+
109
+ stats_txt_handle = open(stats_txt, 'w')
110
+ stats_txt_handle.write('Sequence\tGap\n')
111
+ for each_seq in gap_pct_sorted:
112
+ stats_txt_handle.write('%s\t%s\n' % (each_seq[0], each_seq[1]))
113
+ stats_txt_handle.close()
114
+
115
+
97
116
  def MarkerSeq2Tree(args):
98
117
 
99
118
  marker_seq_dir = args['i']
@@ -586,7 +586,7 @@ def SplitScore2(args):
586
586
  exit()
587
587
  os.mkdir(step_2_op_dir)
588
588
 
589
- print('Counting sister taxa')
589
+ print('Counting sister taxa with %s cores' % num_of_threads)
590
590
  run_count_sister_taxa(gtdb_classification_txt, contree_ufboot_shared_sorted, qualified_og_seq_dir, qualified_og_seq_dir, gnm_group_txt, target_label, num_of_threads, count_sister_taxa_op_dir, force_overwrite)
591
591
 
592
592
  print('Summarising sister taxa')
@@ -1,3 +1,6 @@
1
+ 1.36.0
2
+ - new module added: gap_stats
3
+
1
4
  1.35.3
2
5
  - fixed bugs
3
6
 
@@ -0,0 +1,38 @@
1
+ import argparse
2
+ from Bio import SeqIO
3
+
4
+
5
+ gap_stats_usage = '''
6
+ ======= gap_stats example commands =======
7
+
8
+ TreeSAK gap_stats -i msa.fasta
9
+
10
+ ==========================================
11
+ '''
12
+
13
+
14
+ def gap_stats(args):
15
+
16
+ msa_in_fa = args['i']
17
+
18
+ gap_pct_dict = dict()
19
+ for each_seq in SeqIO.parse(msa_in_fa, 'fasta'):
20
+ seq_id = each_seq.id
21
+ seq_str = str(each_seq.seq)
22
+ gap_pct = seq_str.count('-')*100/len(seq_str)
23
+ gap_pct = float("{0:.2f}".format(gap_pct))
24
+ gap_pct_dict[seq_id] = gap_pct
25
+
26
+ gap_pct_sorted = sorted(gap_pct_dict.items(), key=lambda x: x[1])
27
+
28
+ print('Sequence\tGap')
29
+ for each_seq in gap_pct_sorted:
30
+ print('%s\t%s' % (each_seq[0], each_seq[1]))
31
+
32
+
33
+ if __name__ == '__main__':
34
+
35
+ gap_stats_parser = argparse.ArgumentParser()
36
+ gap_stats_parser.add_argument('-i', required=True, help='MSA in fasta format')
37
+ args = vars(gap_stats_parser.parse_args())
38
+ gap_stats(args)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TreeSAK
3
- Version: 1.35.3
3
+ Version: 1.36.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.35.3
27
+ TreeSAK v1.36.0
@@ -68,6 +68,7 @@ TreeSAK/dating_ss.py
68
68
  TreeSAK/do_rrtc.rb
69
69
  TreeSAK/fa2phy.py
70
70
  TreeSAK/format_leaf_name.py
71
+ TreeSAK/gap_stats.py
71
72
  TreeSAK/get_arCOG_seq.py
72
73
  TreeSAK/global_functions.py
73
74
  TreeSAK/merge_pdf.py
@@ -52,6 +52,7 @@ def print_main_help():
52
52
  SingleLinePhy -> Put sequences in single line in phylip format
53
53
  AlignmentPruner -> Remove heterogenous sites from MSA
54
54
  CS_trim -> (to be added) perform chi-squared trimming to reduce compositional heterogeneity
55
+ gap_stats -> The percentage of gap in each sequence of a MSA
55
56
 
56
57
  Tree-related
57
58
  PB -> Infer tree with PhyloBayes-MPI
@@ -88,7 +89,7 @@ def print_main_help():
88
89
  Phylo-related stats
89
90
  PhyloBiAssoc -> A wrapper for binaryPGLMM test
90
91
 
91
- # Upgrade with "pip3 install --upgrade TreeSAK"
92
+ # Upgrade with: pip3 install --upgrade TreeSAK
92
93
  ''' % version(config_dict)
93
94
 
94
95
  print(help_message)
@@ -706,6 +707,13 @@ if __name__ == '__main__':
706
707
  args = vars(parser.parse_args())
707
708
  AssessPB.AssessPB(args)
708
709
 
710
+ elif sys.argv[1] == 'gap_stats':
711
+ from TreeSAK import gap_stats
712
+ gap_stats_parser = subparsers.add_parser('gap_stats', usage=gap_stats.gap_stats_usage)
713
+ gap_stats_parser.add_argument('-i', required=True, help='MSA in fasta format')
714
+ args = vars(parser.parse_args())
715
+ gap_stats.gap_stats(args)
716
+
709
717
  else:
710
718
  print('Unrecognized command: %s, program exited' % sys.argv[1])
711
719
  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