TreeSAK 1.34.4__tar.gz → 1.34.6__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 (99) hide show
  1. {TreeSAK-1.34.4/TreeSAK.egg-info → TreeSAK-1.34.6}/PKG-INFO +2 -2
  2. TreeSAK-1.34.6/TreeSAK/PB.py +137 -0
  3. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/VERSION +1 -1
  4. {TreeSAK-1.34.4 → TreeSAK-1.34.6/TreeSAK.egg-info}/PKG-INFO +2 -2
  5. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/bin/TreeSAK +7 -4
  6. TreeSAK-1.34.4/TreeSAK/PB.py +0 -87
  7. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/LICENSE +0 -0
  8. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/MANIFEST.in +0 -0
  9. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/README.md +0 -0
  10. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/ALE.py +0 -0
  11. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/ALE1.py +0 -0
  12. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/ALE2.py +0 -0
  13. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/ALE2RTC.py +0 -0
  14. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/ALE3.py +0 -0
  15. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/ALE4.py +0 -0
  16. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/ALE5.py +0 -0
  17. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/ALE6.py +0 -0
  18. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/ALE_backup.py +0 -0
  19. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/AlignmentPruner.py +0 -0
  20. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/AssessCVG.py +0 -0
  21. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/AssessMarker.py +0 -0
  22. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/AssessMarkerDeltaLL.py +0 -0
  23. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/AssessMarkerPA.py +0 -0
  24. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/BMGE.jar +0 -0
  25. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/BMGE.py +0 -0
  26. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/CompareMCMC.py +0 -0
  27. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/ConcateMSA.py +0 -0
  28. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/ConvertMSA.py +0 -0
  29. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/Dir.rb +0 -0
  30. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/ExtractMarkerSeq.py +0 -0
  31. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/FastRoot.py +0 -0
  32. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/FastRoot_backup.py +0 -0
  33. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/GTDB_tree.py +0 -0
  34. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/KEGG_Luo17.py +0 -0
  35. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/LcaToLeaves.py +0 -0
  36. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/MCMCtreeR.py +0 -0
  37. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/MarkerRef2Tree.py +0 -0
  38. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/MarkerRef2Tree_backup.py +0 -0
  39. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/MarkerSeq2Tree.py +0 -0
  40. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/ModifyTopo.py +0 -0
  41. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/OMA.py +0 -0
  42. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/OMA2.py +0 -0
  43. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/OneLineAln.py +0 -0
  44. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/PMSF.py +0 -0
  45. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/PhyloBiAssoc.R +0 -0
  46. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/PhyloBiAssoc.py +0 -0
  47. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/PlotMcmcNode.py +0 -0
  48. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/RootTree.py +0 -0
  49. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/RootTreeGTDB214.py +0 -0
  50. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/RootTreeGTDB220.py +0 -0
  51. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/SequentialDating.py +0 -0
  52. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/SingleAleHGT.py +0 -0
  53. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/SingleLinePhy.py +0 -0
  54. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/SliceMSA.py +0 -0
  55. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/SplitScore.py +0 -0
  56. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/SplitScore1.py +0 -0
  57. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/SplitScore1OMA.py +0 -0
  58. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/SplitScore2.py +0 -0
  59. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/TaxaCountStats.R +0 -0
  60. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/TreeSAK_config.py +0 -0
  61. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/VisHPD95.R +0 -0
  62. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/VisHPD95.py +0 -0
  63. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/__init__.py +0 -0
  64. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/ale_parser.py +0 -0
  65. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/ale_splitter.py +0 -0
  66. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/compare_trees.R +0 -0
  67. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/compare_trees.py +0 -0
  68. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/dating.py +0 -0
  69. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/dating_ss.py +0 -0
  70. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/do_rrtc.rb +0 -0
  71. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/fa2phy.py +0 -0
  72. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/format_leaf_name.py +0 -0
  73. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/get_arCOG_seq.py +0 -0
  74. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/global_functions.py +0 -0
  75. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/merge_pdf.py +0 -0
  76. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/pRTC.py +0 -0
  77. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/parse_deltall_stdout.py +0 -0
  78. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/plot_distruibution_th.py +0 -0
  79. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/prep_mcmctree_ctl.py +0 -0
  80. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/print_leaves.py +0 -0
  81. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/rename_leaves.py +0 -0
  82. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/replace_clade.py +0 -0
  83. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/root_with_out_group.py +0 -0
  84. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/run_TaxaCountStats_R_s1.py +0 -0
  85. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/subsample_drep_gnms.py +0 -0
  86. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/subset.py +0 -0
  87. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/subset_tree_stupid_old_way.py +0 -0
  88. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/test_1.py +0 -0
  89. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/test_2.py +0 -0
  90. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/tmp_2.py +0 -0
  91. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/tmp_3.py +0 -0
  92. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/tmp_4.py +0 -0
  93. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK/weighted_rand.rb +0 -0
  94. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK.egg-info/SOURCES.txt +0 -0
  95. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK.egg-info/dependency_links.txt +0 -0
  96. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK.egg-info/requires.txt +0 -0
  97. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/TreeSAK.egg-info/top_level.txt +0 -0
  98. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/setup.cfg +0 -0
  99. {TreeSAK-1.34.4 → TreeSAK-1.34.6}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TreeSAK
3
- Version: 1.34.4
3
+ Version: 1.34.6
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.34.4
27
+ TreeSAK v1.34.6
@@ -0,0 +1,137 @@
1
+ import os
2
+ import argparse
3
+ from Bio import AlignIO
4
+ import multiprocessing as mp
5
+
6
+
7
+ PB_usage = '''
8
+ ========================================== PB example commands ==========================================
9
+
10
+ # Dependency: mpirun, pb_mpi and readpb_mpi (from PhyloBayes-MPI)
11
+
12
+ export OMPI_MCA_btl=^openib
13
+ TreeSAK PB -i in.phylip -p chain_name -t 12
14
+
15
+ # Notes:
16
+ 1. This is a wrapper for: mpirun -np 12 pb_mpi -d in.phylip -cat -gtr -x 10 -1 -dgam 4 -s chain_name
17
+
18
+ 2. Input MSA need to be in phylip format.
19
+
20
+ 3. Settings used by Nina Dombrowski: -cat -gtr -x 10 -1 -dgam 4
21
+ For each marker protein family, four parallel chains were run until convergence was reached, unless stated
22
+ otherwise (maxdiff < 0.3; settings: bpcomp -x 25_burnin chain1 chain2 chain3 chain4). Additionally, we
23
+ checked for the minimum effective size using tracecomp (minimum effective size > 50; settings: -x 25_burnin
24
+ chain1 chain2 chain3 chain4).
25
+
26
+ 4. Settings used by Fan Lu:
27
+ Four chains were run for each consensus tree, and for each chain over 15,000 cycles (5,000 burn-in)
28
+ were conducted, until a maxdiff value lower than 0.3 was reached. Otherwise, non-converged chains were
29
+ continually run to over 20,000 cycles. Posterior predictive tests were conducted using PhyloBayes MPI
30
+ with the ‘readpb_mpi -x 5000 50 -allppred’ command.
31
+
32
+ =========================================================================================================
33
+ '''
34
+
35
+
36
+ def fa2phy(fasta_in, phy_out):
37
+
38
+ alignment = AlignIO.read(fasta_in, 'fasta')
39
+
40
+ max_seq_id_len = 0
41
+ for each_seq in alignment:
42
+ seq_id_len = len(each_seq.id)
43
+ if seq_id_len > max_seq_id_len:
44
+ max_seq_id_len = seq_id_len
45
+
46
+ with open(phy_out, 'w') as msa_out_handle:
47
+ msa_out_handle.write('%s %s\n' % (len(alignment), alignment.get_alignment_length()))
48
+ for each_seq in alignment:
49
+ seq_id = each_seq.id
50
+ seq_id_with_space = '%s%s' % (seq_id, ' ' * (max_seq_id_len + 2 - len(seq_id)))
51
+ msa_out_handle.write('%s%s\n' % (seq_id_with_space, str(each_seq.seq)))
52
+
53
+
54
+ def PB(args):
55
+
56
+ msa_in = args['i']
57
+ op_dir = args['o']
58
+ op_prefix = args['p']
59
+ fa_to_plp = args['fa2plp']
60
+ num_of_threads = args['t']
61
+ num_of_chains = args['chain']
62
+ force_overwrite = args['f']
63
+
64
+ ####################################################################################################################
65
+
66
+ settings_dombrowski = '-cat -gtr -x 10 -1 -dgam 4'
67
+ setting_to_use = settings_dombrowski
68
+ msa_in_plp = '%s/%s.phylip' % (op_dir, msa_in)
69
+
70
+ ####################################################################################################################
71
+
72
+ # create output dir
73
+ if os.path.isdir(op_dir) is True:
74
+ if force_overwrite is True:
75
+ os.system('rm -r %s' % op_dir)
76
+ else:
77
+ print('output folder already exist, program exited!')
78
+ exit()
79
+ os.system('mkdir %s' % op_dir)
80
+
81
+ # fa_to_phylip
82
+ msa_to_use = msa_in
83
+ if fa_to_plp is True:
84
+ fa2phy(msa_in, msa_in_plp)
85
+ msa_to_use = msa_in_plp
86
+
87
+ pb_mpi_cmd_list = []
88
+ jobs_to_run_in_parallel = 0
89
+ if num_of_chains == 1:
90
+ jobs_to_run_in_parallel = 1
91
+ pb_mpi_cmd = 'mpirun -np %s pb_mpi -d %s %s -s %s/%s' % (num_of_threads, msa_to_use, setting_to_use, op_dir, op_prefix)
92
+ pb_mpi_cmd_list.append(pb_mpi_cmd)
93
+
94
+ elif num_of_threads <= num_of_chains:
95
+ jobs_to_run_in_parallel = num_of_threads
96
+ for chain_index in range(1, (num_of_chains + 1)):
97
+ current_wd = '%s/%s_chain%s' % (op_dir, op_prefix, chain_index)
98
+ os.mkdir(current_wd)
99
+ pb_mpi_cmd = 'mpirun -np %s pb_mpi -d %s %s -s %s/%s_chain%s' % (1, msa_to_use, setting_to_use, current_wd, op_prefix, chain_index)
100
+ pb_mpi_cmd_list.append(pb_mpi_cmd)
101
+
102
+ else:
103
+ jobs_to_run_in_parallel = num_of_chains
104
+ cores_per_run = num_of_threads // num_of_chains
105
+ for chain_index in range(1, (num_of_chains + 1)):
106
+ current_wd = '%s/%s_chain%s' % (op_dir, op_prefix, chain_index)
107
+ os.mkdir(current_wd)
108
+ pb_mpi_cmd = 'mpirun -np %s pb_mpi -d %s %s -s %s/%s_chain%s' % (cores_per_run, msa_to_use, setting_to_use, current_wd, op_prefix, chain_index)
109
+ pb_mpi_cmd_list.append(pb_mpi_cmd)
110
+
111
+ # run chains with mp
112
+ print('Running pb_mpi with multiprocessing')
113
+ for cmd in pb_mpi_cmd_list:
114
+ print(cmd)
115
+ pool = mp.Pool(processes=jobs_to_run_in_parallel)
116
+ pool.map(os.system, pb_mpi_cmd_list)
117
+ pool.close()
118
+ pool.join()
119
+
120
+ # readpb_cmd = ''
121
+ # bpcomp_cmd = ''
122
+ # print(readpb_cmd)
123
+ # print(bpcomp_cmd)
124
+
125
+
126
+ if __name__ == '__main__':
127
+
128
+ parser = argparse.ArgumentParser()
129
+ parser.add_argument('-i', required=True, help='input MSA file')
130
+ parser.add_argument('-o', required=True, help='output directory')
131
+ parser.add_argument('-p', required=True, help='output prefix')
132
+ parser.add_argument('-fa2plp', required=False, action="store_true", help='convert MSA format from fasta to phylip')
133
+ parser.add_argument('-chain', required=False, type=int, default=4, help='num of chains to run in parallel, default: 4')
134
+ parser.add_argument('-t', required=False, type=int, default=4, help='num of cores, default: 4')
135
+ parser.add_argument('-f', required=False, action="store_true", help='force overwrite')
136
+ args = vars(parser.parse_args())
137
+ PB(args)
@@ -1,4 +1,4 @@
1
- 1.34.4
1
+ 1.34.6
2
2
  - fixed bugs
3
3
 
4
4
  1.34.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TreeSAK
3
- Version: 1.34.4
3
+ Version: 1.34.6
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.34.4
27
+ TreeSAK v1.34.6
@@ -682,10 +682,13 @@ if __name__ == '__main__':
682
682
  elif sys.argv[1] in ['PB', 'Pb', 'pb']:
683
683
  from TreeSAK import PB
684
684
  PB_parser = subparsers.add_parser('PB', usage=PB.PB_usage)
685
- PB_parser.add_argument('-i', required=True, help='input MSA file')
686
- PB_parser.add_argument('-p', required=True, help='output prefix')
687
- PB_parser.add_argument('-fa2plp', required=False, action="store_true", help='convert MSA format from fasta to phylip')
688
- PB_parser.add_argument('-t', required=False, type=int, default=1, help='num of threads, default 1')
685
+ parser.add_argument('-i', required=True, help='input MSA file')
686
+ parser.add_argument('-o', required=True, help='output directory')
687
+ parser.add_argument('-p', required=True, help='output prefix')
688
+ parser.add_argument('-fa2plp', required=False, action="store_true", help='convert MSA format from fasta to phylip')
689
+ parser.add_argument('-chain', required=False, type=int, default=4, help='num of chains to run in parallel, default: 4')
690
+ parser.add_argument('-t', required=False, type=int, default=4, help='num of cores, default: 4')
691
+ parser.add_argument('-f', required=False, action="store_true", help='force overwrite')
689
692
  args = vars(parser.parse_args())
690
693
  PB.PB(args)
691
694
 
@@ -1,87 +0,0 @@
1
- import os
2
- import argparse
3
- from Bio import AlignIO
4
-
5
-
6
- PB_usage = '''
7
- ========================================== PB example commands ==========================================
8
-
9
- # Dependency: mpirun, pb_mpi and readpb_mpi (from PhyloBayes-MPI)
10
-
11
- export OMPI_MCA_btl=^openib
12
- TreeSAK PB -i in.phylip -p chain_name -t 12
13
-
14
- # Notes:
15
- 1. This is a wrapper for: mpirun -np 12 pb_mpi -d in.phylip -cat -gtr -x 10 -1 -dgam 4 -s chain_name
16
-
17
- 2. Input MSA need to be in phylip format.
18
-
19
- 3. Settings used by Nina Dombrowski: -cat -gtr -x 10 -1 -dgam 4
20
- For each marker protein family, four parallel chains were run until convergence was reached, unless stated
21
- otherwise (maxdiff < 0.3; settings: bpcomp -x 25_burnin chain1 chain2 chain3 chain4). Additionally, we
22
- checked for the minimum effective size using tracecomp (minimum effective size > 50; settings: -x 25_burnin
23
- chain1 chain2 chain3 chain4).
24
-
25
- 4. Settings used by Fan Lu:
26
- Four chains were run for each consensus tree, and for each chain over 15,000 cycles (5,000 burn-in)
27
- were conducted, until a maxdiff value lower than 0.3 was reached. Otherwise, non-converged chains were
28
- continually run to over 20,000 cycles. Posterior predictive tests were conducted using PhyloBayes MPI
29
- with the ‘readpb_mpi -x 5000 50 -allppred’ command.
30
-
31
- =========================================================================================================
32
- '''
33
-
34
-
35
- def fa2phy(fasta_in, phy_out):
36
-
37
- alignment = AlignIO.read(fasta_in, 'fasta')
38
-
39
- max_seq_id_len = 0
40
- for each_seq in alignment:
41
- seq_id_len = len(each_seq.id)
42
- if seq_id_len > max_seq_id_len:
43
- max_seq_id_len = seq_id_len
44
-
45
- with open(phy_out, 'w') as msa_out_handle:
46
- msa_out_handle.write('%s %s\n' % (len(alignment), alignment.get_alignment_length()))
47
- for each_seq in alignment:
48
- seq_id = each_seq.id
49
- seq_id_with_space = '%s%s' % (seq_id, ' ' * (max_seq_id_len + 2 - len(seq_id)))
50
- msa_out_handle.write('%s%s\n' % (seq_id_with_space, str(each_seq.seq)))
51
-
52
-
53
- def PB(args):
54
-
55
- msa_in = args['i']
56
- op_prefix = args['p']
57
- fa_to_plp = args['fa2plp']
58
- num_of_threads = args['t']
59
-
60
- settings_dombrowski = '-cat -gtr -x 10 -1 -dgam 4'
61
-
62
- msa_to_use = msa_in
63
- if fa_to_plp is True:
64
- msa_in_plp = '%s.phylip' % msa_in
65
- fa2phy(msa_in, msa_in_plp)
66
- msa_to_use = msa_in_plp
67
-
68
- pb_mpi_cmd = 'mpirun -np %s pb_mpi -d %s %s -s %s' % (num_of_threads, msa_to_use, settings_dombrowski, op_prefix)
69
- readpb_cmd = ''
70
- bpcomp_cmd = ''
71
-
72
- print(pb_mpi_cmd)
73
- os.system(pb_mpi_cmd)
74
-
75
- # print(readpb_cmd)
76
- # print(bpcomp_cmd)
77
-
78
-
79
- if __name__ == '__main__':
80
-
81
- parser = argparse.ArgumentParser()
82
- parser.add_argument('-i', required=True, help='input MSA file')
83
- parser.add_argument('-p', required=True, help='output prefix')
84
- parser.add_argument('-fa2plp', required=False, action="store_true", help='convert MSA format from fasta to phylip')
85
- parser.add_argument('-t', required=False, type=int, default=1, help='num of threads, default 1')
86
- args = vars(parser.parse_args())
87
- PB(args)
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