TreeSAK 1.31.2__tar.gz → 1.31.4__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.
- {TreeSAK-1.31.2/TreeSAK.egg-info → TreeSAK-1.31.4}/PKG-INFO +2 -2
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/PhyloBiAssoc.py +40 -11
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/VERSION +1 -1
- TreeSAK-1.31.4/TreeSAK/tmp_4.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4/TreeSAK.egg-info}/PKG-INFO +2 -2
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK.egg-info/SOURCES.txt +1 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/bin/TreeSAK +1 -1
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/LICENSE +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/MANIFEST.in +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/README.md +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/ALE.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/ALE1.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/ALE2.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/ALE2RTC.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/ALE3.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/ALE4.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/ALE5.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/ALE6.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/ALE_backup.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/AlignmentPruner.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/AssessCVG.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/AssessMarker.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/AssessMarkerDeltaLL.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/AssessMarkerPA.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/BMGE.jar +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/BMGE.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/CompareMCMC.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/ConcateMSA.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/ConvertMSA.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/Dating.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/Dir.rb +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/ExtractMarkerSeq.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/FastRoot.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/FastRoot_backup.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/GTDB_tree.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/KEGG_Luo17.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/LcaToLeaves.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/MCMCtreeR.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/MarkerRef2Tree.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/MarkerRef2Tree_backup.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/MarkerSeq2Tree.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/ModifyTopo.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/OMA.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/OMA2.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/OneLineAln.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/PMSF.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/PhyloBiAssoc.R +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/PlotMcmcNode.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/RootTree.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/SequentialDating.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/SingleAleHGT.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/SingleLinePhy.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/SliceMSA.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/SplitScore.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/SplitScore1.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/SplitScore1OMA.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/SplitScore2.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/TaxaCountStats.R +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/TreeSAK_config.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/VisHPD95.R +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/VisHPD95.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/__init__.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/ale_parser.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/ale_splitter.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/compare_trees.R +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/compare_trees.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/do_rrtc.rb +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/fa2phy.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/format_leaf_name.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/get_arCOG_seq.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/global_functions.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/gtdb_root.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/pRTC.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/parse_deltall_stdout.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/pb_mpi.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/plot_distruibution_th.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/prep_mcmctree_ctl.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/print_leaves.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/rename_leaves.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/replace_clades.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/root_with_out_group.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/run_TaxaCountStats_R_s1.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/subsample_drep_gnms.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/subset_tree.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/subset_tree_stupid_old_way.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/test_1.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/test_2.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/tmp_1.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/tmp_2.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/tmp_3.py +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK/weighted_rand.rb +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK.egg-info/dependency_links.txt +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK.egg-info/requires.txt +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/TreeSAK.egg-info/top_level.txt +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/setup.cfg +0 -0
- {TreeSAK-1.31.2 → TreeSAK-1.31.4}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: TreeSAK
|
|
3
|
-
Version: 1.31.
|
|
3
|
+
Version: 1.31.4
|
|
4
4
|
Summary: BioSAK
|
|
5
5
|
Home-page: https://github.com/songweizhi/TreeSAK
|
|
6
6
|
Author: Weizhi Song
|
|
@@ -23,4 +23,4 @@ Requires-Dist: plotly
|
|
|
23
23
|
Requires-Dist: kaleido
|
|
24
24
|
Requires-Dist: PyPDF3
|
|
25
25
|
|
|
26
|
-
TreeSAK v1.31.
|
|
26
|
+
TreeSAK v1.31.4
|
|
@@ -2,6 +2,7 @@ import os
|
|
|
2
2
|
import argparse
|
|
3
3
|
import pandas as pd
|
|
4
4
|
import multiprocessing as mp
|
|
5
|
+
from statsmodels.stats.multitest import multipletests
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
PhyloBiAssoc_usage = '''
|
|
@@ -24,14 +25,11 @@ BioSAK PhyloBiAssoc -i demo.tre -d demo.txt -o op_dir -t 10 -f
|
|
|
24
25
|
|
|
25
26
|
def sep_path_basename_ext(file_in):
|
|
26
27
|
|
|
27
|
-
# separate path and file name
|
|
28
28
|
f_path, file_name = os.path.split(file_in)
|
|
29
29
|
if f_path == '':
|
|
30
30
|
f_path = '.'
|
|
31
31
|
|
|
32
|
-
# separate file basename and extension
|
|
33
32
|
f_base, f_ext = os.path.splitext(file_name)
|
|
34
|
-
|
|
35
33
|
return f_path, f_base, f_ext
|
|
36
34
|
|
|
37
35
|
|
|
@@ -65,10 +63,12 @@ def PhyloBiAssoc(args):
|
|
|
65
63
|
current_script_path = '/'.join(pwd_current_script.split('/')[:-1])
|
|
66
64
|
PhyloBiAssoc_R = '%s/PhyloBiAssoc.R' % current_script_path
|
|
67
65
|
|
|
68
|
-
cmd_txt
|
|
69
|
-
df_subset_dir
|
|
70
|
-
stats_op_dir
|
|
71
|
-
combined_stats_txt
|
|
66
|
+
cmd_txt = '%s/cmds.txt' % op_dir
|
|
67
|
+
df_subset_dir = '%s/df_subset' % op_dir
|
|
68
|
+
stats_op_dir = '%s/stats_results' % op_dir
|
|
69
|
+
combined_stats_txt = '%s/stats_results_all.txt' % op_dir
|
|
70
|
+
combined_stats_txt_sig = '%s/stats_results_0.05.txt' % op_dir
|
|
71
|
+
combined_stats_txt_adjusted = '%s/stats_results_0.05_adjusted.txt' % op_dir
|
|
72
72
|
|
|
73
73
|
# create op_dir
|
|
74
74
|
if os.path.isdir(op_dir) is True:
|
|
@@ -95,8 +95,8 @@ def PhyloBiAssoc(args):
|
|
|
95
95
|
op_stats_txt_set = set()
|
|
96
96
|
for each_subset in subset_dict:
|
|
97
97
|
cols_to_keep = subset_dict[each_subset]
|
|
98
|
-
df_subset_file = '%s/%s.
|
|
99
|
-
stats_out_txt = '%s/%
|
|
98
|
+
df_subset_file = '%s/%s.tab' % (df_subset_dir, each_subset)
|
|
99
|
+
stats_out_txt = '%s/%s.txt' % (stats_op_dir, each_subset)
|
|
100
100
|
subset_df(data_file, set(), cols_to_keep, '\t', 0, 0, df_subset_file)
|
|
101
101
|
stats_cmd = 'Rscript %s -t %s -d %s > %s' % (PhyloBiAssoc_R, tree_file, df_subset_file, stats_out_txt)
|
|
102
102
|
cmd_txt_handle.write(stats_cmd + '\n')
|
|
@@ -109,20 +109,49 @@ def PhyloBiAssoc(args):
|
|
|
109
109
|
pool.map(os.system, stats_cmd_list)
|
|
110
110
|
pool.close()
|
|
111
111
|
pool.join()
|
|
112
|
+
#os.system('cp /Users/songweizhi/Documents/Research/Sponge/12_PhyloBiAssoc_wd/PhyloBiAssoc_wd_backup/stats_results/*.txt %s/' % stats_op_dir)
|
|
112
113
|
|
|
113
114
|
# combine stats results
|
|
115
|
+
sig_list_id = []
|
|
116
|
+
sig_list_value = []
|
|
117
|
+
|
|
114
118
|
combined_stats_txt_handle = open(combined_stats_txt, 'w')
|
|
115
119
|
combined_stats_txt_handle.write('ID phylosig binaryPGLMM chisq.test coefficient significance\n')
|
|
120
|
+
combined_stats_txt_sig_handle = open(combined_stats_txt_sig, 'w')
|
|
116
121
|
for each_file in sorted(list(op_stats_txt_set)):
|
|
117
122
|
f_path, f_base, f_ext = sep_path_basename_ext(each_file)
|
|
118
123
|
for each_line in open(each_file):
|
|
119
|
-
if not each_line.startswith('ID\tphylosig\tbinaryPGLMM\tchisq.test
|
|
124
|
+
if not each_line.startswith('ID\tphylosig\tbinaryPGLMM\tchisq.test'):
|
|
120
125
|
each_line_split = each_line.strip().split('\t')
|
|
126
|
+
significance = each_line_split[5]
|
|
121
127
|
combined_stats_txt_handle.write('%s\t%s\n' % (f_base, '\t'.join(each_line_split[1:])))
|
|
128
|
+
if significance == 'y':
|
|
129
|
+
combined_stats_txt_sig_handle.write(f_base + '\n')
|
|
130
|
+
sig_bi = each_line_split[2]
|
|
131
|
+
sig_chi = each_line_split[3]
|
|
132
|
+
current_sig = ''
|
|
133
|
+
if sig_bi == 'na':
|
|
134
|
+
current_sig = sig_chi
|
|
135
|
+
elif sig_chi == 'na':
|
|
136
|
+
current_sig = sig_bi
|
|
137
|
+
sig_list_id.append(f_base)
|
|
138
|
+
sig_list_value.append(float(current_sig))
|
|
122
139
|
combined_stats_txt_handle.close()
|
|
140
|
+
combined_stats_txt_sig_handle.close()
|
|
141
|
+
|
|
142
|
+
# perform Bonferroni correction
|
|
143
|
+
sig_list_value_adjusted = list(multipletests(sig_list_value, alpha=0.1, method='bonferroni')[1])
|
|
144
|
+
|
|
145
|
+
# write out adjusted p values
|
|
146
|
+
combined_stats_txt_adjusted_handle = open(combined_stats_txt_adjusted, 'w')
|
|
147
|
+
combined_stats_txt_adjusted_handle.write('ID\tadjusted_p_value\n')
|
|
148
|
+
for (id, adjusted_p) in zip(sig_list_id, sig_list_value_adjusted):
|
|
149
|
+
if adjusted_p <= 0.05:
|
|
150
|
+
combined_stats_txt_adjusted_handle.write('%s\t%s\n' % (id, adjusted_p))
|
|
151
|
+
combined_stats_txt_adjusted_handle.close()
|
|
123
152
|
|
|
124
153
|
# Final report
|
|
125
|
-
print('Results exported to %s' % combined_stats_txt)
|
|
154
|
+
print('Results exported to: \n%s\n%s' % (combined_stats_txt, combined_stats_txt_adjusted))
|
|
126
155
|
print('Done')
|
|
127
156
|
|
|
128
157
|
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: TreeSAK
|
|
3
|
-
Version: 1.31.
|
|
3
|
+
Version: 1.31.4
|
|
4
4
|
Summary: BioSAK
|
|
5
5
|
Home-page: https://github.com/songweizhi/TreeSAK
|
|
6
6
|
Author: Weizhi Song
|
|
@@ -23,4 +23,4 @@ Requires-Dist: plotly
|
|
|
23
23
|
Requires-Dist: kaleido
|
|
24
24
|
Requires-Dist: PyPDF3
|
|
25
25
|
|
|
26
|
-
TreeSAK v1.31.
|
|
26
|
+
TreeSAK v1.31.4
|
|
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
|
|
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
|