TreeSAK 1.45.5__tar.gz → 1.46.1__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.45.5/TreeSAK.egg-info → TreeSAK-1.46.1}/PKG-INFO +2 -2
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/README.md +13 -6
- TreeSAK-1.46.1/TreeSAK/FigTree.py +34 -0
- TreeSAK-1.46.1/TreeSAK/PlotMcmcNode.py +171 -0
- TreeSAK-1.45.5/TreeSAK/PlotMcmcNode.py → TreeSAK-1.46.1/TreeSAK/PlotMcmcNode_old.py +7 -5
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/VERSION +5 -2
- TreeSAK-1.46.1/TreeSAK/cogTree.py +186 -0
- TreeSAK-1.45.5/TreeSAK/FunTree.py → TreeSAK-1.46.1/TreeSAK/koTree.py +21 -24
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/supertree.py +2 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1/TreeSAK.egg-info}/PKG-INFO +2 -2
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK.egg-info/SOURCES.txt +4 -1
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/bin/TreeSAK +37 -23
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/LICENSE +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/MANIFEST.in +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ALE.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ALE1.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ALE2.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ALE2RTC.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ALE3.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ALE4.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ALE5.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ALE6.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ALE7.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ALE_backup.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/AssessCVG.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/AssessMarker.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/AssessMarkerDeltaLL.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/AssessMarkerPA.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/AssessPB.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/BMGE.jar +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/BMGE.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/CompareMCMC.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ConcateMSA.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ConvertMSA.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/Dir.rb +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ExtractMarkerSeq.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/FastRoot.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/FastRoot_backup.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/GTDB_tree.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/KEGG_Luo17.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/LcaToLeaves.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/MarkerRef2Tree.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/MarkerRef2Tree_backup.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/MarkerSeq2Tree.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ModifyTopo.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/Newick_tree_plotter.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/OMA.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/OMA2.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/OneLineAln.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/PB.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/PMSF.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/PhyloBiAssoc.R +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/PhyloBiAssoc.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/PlotMCMC.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/RootTree.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/RootTreeGTDB214.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/RootTreeGTDB220.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/SequentialDating.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/SingleAleHGT.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/SingleLinePhy.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/SliceMSA.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/SplitScore.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/SplitScore1.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/SplitScore1OMA.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/SplitScore2.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/TaxaCountStats.R +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/TaxonTree.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/TreeSAK_config.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/VisHPD95.R +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/VisHPD95.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/__init__.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ale_parser.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/ale_splitter.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/alignment_pruner.pl +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/catfasta2phy.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/compare_trees.R +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/compare_trees.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/dating.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/dating_ss.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/deltall.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/do_rrtc.rb +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/fa2phy.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/format_leaf_name.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/gap_stats.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/get_SCG_tree.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/get_arCOG_seq.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/global_functions.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/gnm_leaves.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/iTOL.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/iTOL_gene_tree.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/keep_highest_rrtc.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/label_tree.R +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/label_tree.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/mad.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/mcmc2tree.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/mcmcTC.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/merge_pdf.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/pRTC.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/plot_distruibution_th.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/prep_mcmctree_ctl.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/print_leaves.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/pruneMSA.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/recode.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/rename_leaves.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/replace_clade.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/root_with_out_group.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/run_TaxaCountStats_R_s1.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/subsample_drep_gnms.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/subset.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/subset_tree_stupid_old_way.py +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK/weighted_rand.rb +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK.egg-info/dependency_links.txt +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK.egg-info/requires.txt +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/TreeSAK.egg-info/top_level.txt +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/setup.cfg +0 -0
- {TreeSAK-1.45.5 → TreeSAK-1.46.1}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: TreeSAK
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.46.1
|
|
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.
|
|
27
|
+
TreeSAK v1.46.1
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
[](https://opensource.org/licenses/gpl-3.0.html)
|
|
5
5
|
[](https://pypi.python.org/pypi/TreeSAK)
|
|
6
6
|
|
|
7
|
+
|
|
7
8
|
Contact
|
|
8
9
|
---
|
|
9
10
|
|
|
@@ -29,11 +30,11 @@ Installation
|
|
|
29
30
|
TreeSAK modules
|
|
30
31
|
---
|
|
31
32
|
|
|
32
|
-
...::: TreeSAK v1.
|
|
33
|
+
...::: TreeSAK v1.45.5 :::...
|
|
33
34
|
|
|
34
35
|
Marker-related
|
|
35
36
|
ExtractMarkerSeq -> Extract marker by blastn
|
|
36
|
-
|
|
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
|
|
@@ -46,8 +47,8 @@ TreeSAK modules
|
|
|
46
47
|
pruneMSA -> Prune MSA with alignment_pruner.pl
|
|
47
48
|
recodeAA -> Recode amino acids to Dayoff 4, Dayoff 6 or SR4 categories
|
|
48
49
|
fa2phy -> Convert MSA format (fasta to phylip)
|
|
49
|
-
SliceMSA -> Slice MSA by column
|
|
50
|
-
ConcateMSA -> Concatenate
|
|
50
|
+
SliceMSA -> Slice MSA by column
|
|
51
|
+
ConcateMSA -> Concatenate MSAs
|
|
51
52
|
ConvertMSA -> Convert MSA format
|
|
52
53
|
OneLineAln -> One-line fasta format alignments
|
|
53
54
|
SingleLinePhy -> Put sequences in single line in phylip format
|
|
@@ -56,12 +57,15 @@ TreeSAK modules
|
|
|
56
57
|
|
|
57
58
|
Tree-related
|
|
58
59
|
iTOL -> Prepare iTOL files
|
|
60
|
+
iTOL_gene_tree -> Genome metadata to gene metadata
|
|
59
61
|
PB -> Infer tree with PhyloBayes-MPI
|
|
62
|
+
supertree -> Infer species tree from gene trees
|
|
60
63
|
AssessPB -> Compare PhyloBayes chains
|
|
61
64
|
MarkerSeq2Tree -> Marker sequence to tree
|
|
62
65
|
MarkerRef2Tree -> Marker (reference sequence) to Tree
|
|
63
|
-
GTDB_tree ->
|
|
66
|
+
GTDB_tree -> Get GTDB tree
|
|
64
67
|
subset -> Subset tree
|
|
68
|
+
TaxonTree -> Subset GTDB tree by taxon
|
|
65
69
|
compare_trees -> Compare trees with Mantel test
|
|
66
70
|
rename_leaves -> Rename tree leaves
|
|
67
71
|
print_leaves -> print out tree leaves
|
|
@@ -69,6 +73,7 @@ TreeSAK modules
|
|
|
69
73
|
ModifyTopo -> Modify tree topology
|
|
70
74
|
GeneRax -> (to be added) Run GeneRax
|
|
71
75
|
ALE -> Modules for running ALE
|
|
76
|
+
FunTree -> Infer tree for individual COG/KEGG function
|
|
72
77
|
RootTree -> Root tree with outgroup leaves
|
|
73
78
|
RootTreeGTDB214 -> Root tree by GTDB taxonomy (r214)
|
|
74
79
|
RootTreeGTDB220 -> Root tree by GTDB taxonomy (r220)
|
|
@@ -80,12 +85,14 @@ TreeSAK modules
|
|
|
80
85
|
PPA -> (to be added) Perform Posterior Predictive Analysis (across-site)
|
|
81
86
|
|
|
82
87
|
Dating-related
|
|
83
|
-
|
|
88
|
+
dating -> Perform molecular dating
|
|
84
89
|
AssessCVG -> Assess dating convergence
|
|
85
90
|
CompareMCMC -> Compare MCMCTree outputs
|
|
86
91
|
PlotMcmcNode -> distribution of node's age estimation
|
|
87
92
|
VisHPD95 -> HPD95 of estimated node age
|
|
88
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
|
|
89
96
|
|
|
90
97
|
Phylo-related stats
|
|
91
98
|
PhyloBiAssoc -> A wrapper for binaryPGLMM test
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import argparse
|
|
3
|
+
from ete3 import Tree
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
FigTree_usage = '''
|
|
7
|
+
====================== FigTree example commands ======================
|
|
8
|
+
|
|
9
|
+
TreeSAK FigTree -h
|
|
10
|
+
|
|
11
|
+
======================================================================
|
|
12
|
+
'''
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def FigTree(args):
|
|
16
|
+
|
|
17
|
+
input_txt_file = args['i']
|
|
18
|
+
op_txt = args['o']
|
|
19
|
+
|
|
20
|
+
if os.path.isfile(input_txt_file) is False:
|
|
21
|
+
print('Metadata file not found, program exited!')
|
|
22
|
+
exit()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
if __name__ == '__main__':
|
|
26
|
+
|
|
27
|
+
FigTree_parser = argparse.ArgumentParser(usage=FigTree_usage)
|
|
28
|
+
FigTree_parser.add_argument('-i', required=True, help='input metadata')
|
|
29
|
+
FigTree_parser.add_argument('-tree', required=False, default=None, help='gene id, in tree file')
|
|
30
|
+
FigTree_parser.add_argument('-txt', required=False, default=None, help='gene id, in txt file')
|
|
31
|
+
FigTree_parser.add_argument('-o', required=True, help='output metadata')
|
|
32
|
+
FigTree_parser.add_argument('-na', required=False, action='store_true', help='include leaves with na values')
|
|
33
|
+
args = vars(FigTree_parser.parse_args())
|
|
34
|
+
FigTree(args)
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import glob
|
|
3
|
+
import argparse
|
|
4
|
+
import pandas as pd
|
|
5
|
+
import plotly.express as px
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
PlotMcmcNode_usage = '''
|
|
9
|
+
========================== PlotMcmcNode example commands ==========================
|
|
10
|
+
|
|
11
|
+
TreeSAK PlotMcmcNode -i McmcTree_op_files -n topo123_nodes.txt -o topo123_age.pdf
|
|
12
|
+
|
|
13
|
+
# file format (-n, tab separated, no header)
|
|
14
|
+
# column 1: file name, no extension
|
|
15
|
+
# column 2: node id
|
|
16
|
+
# column 3: file name on the figure
|
|
17
|
+
# column 4: node name on the figure
|
|
18
|
+
topo1_clock3_mcmc t_n171 Topo1 Symbiosis_event_1
|
|
19
|
+
topo1_clock3_mcmc t_n151 Topo1 Symbiosis_event_2
|
|
20
|
+
topo1_clock3_mcmc t_n131 Topo1 Symbiosis_event_3
|
|
21
|
+
topo2_clock3_mcmc t_n171 Topo2 Symbiosis_event_1
|
|
22
|
+
topo2_clock3_mcmc t_n171 Topo3 Symbiosis_event_1
|
|
23
|
+
|
|
24
|
+
===================================================================================
|
|
25
|
+
'''
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def sep_path_basename_ext(file_in):
|
|
29
|
+
|
|
30
|
+
# separate path and file name
|
|
31
|
+
f_path, file_name = os.path.split(file_in)
|
|
32
|
+
if f_path == '':
|
|
33
|
+
f_path = '.'
|
|
34
|
+
|
|
35
|
+
# separate file basename and extension
|
|
36
|
+
f_base, f_ext = os.path.splitext(file_name)
|
|
37
|
+
|
|
38
|
+
return f_path, f_base, f_ext
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def plot_distribution(df_txt, output_plot):
|
|
42
|
+
|
|
43
|
+
df = pd.read_table(df_txt, sep=',')
|
|
44
|
+
run_id_list = df['Setting'].unique()
|
|
45
|
+
node_id_list = df['Node'].unique()
|
|
46
|
+
|
|
47
|
+
# sort dataframe by run id
|
|
48
|
+
df = df.sort_values(by='Setting', ascending=False)
|
|
49
|
+
|
|
50
|
+
plot_width = 900
|
|
51
|
+
plot_height = len(run_id_list)*100
|
|
52
|
+
if plot_height < 360:
|
|
53
|
+
plot_height = 360
|
|
54
|
+
|
|
55
|
+
fig = px.violin(df, x="Value", y="Setting", color="Node", points=False, orientation="h", width=plot_width, height=plot_height)
|
|
56
|
+
if len(node_id_list) == 1:
|
|
57
|
+
fig.update_traces(side="positive", fillcolor='lightblue', width=1.6, opacity=0.75)
|
|
58
|
+
else:
|
|
59
|
+
fig.update_traces(side="positive", fillcolor='rgba(0,0,0,0)', width=1.6)
|
|
60
|
+
|
|
61
|
+
fig.update_traces(showlegend=True)
|
|
62
|
+
fig.layout.template = "simple_white"
|
|
63
|
+
# fig.layout.width = 700
|
|
64
|
+
# fig.layout.height = 750
|
|
65
|
+
# fig.update_xaxes(range=[40, 0])
|
|
66
|
+
# fig.update_layout(margin_t=10, title_text='Demo', title_x=0.5)
|
|
67
|
+
fig.write_image(output_plot)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def PlotMcmcNode(args):
|
|
71
|
+
|
|
72
|
+
mcmc_in = args['i']
|
|
73
|
+
mcmc_file_ext = args['x']
|
|
74
|
+
node_txt = args['n']
|
|
75
|
+
output_plot = args['o']
|
|
76
|
+
|
|
77
|
+
# check MCMCTree output file/dir
|
|
78
|
+
if os.path.isfile(mcmc_in) is True:
|
|
79
|
+
mcmc_file_list = [mcmc_in]
|
|
80
|
+
else:
|
|
81
|
+
mcmc_file_re = '%s/*.%s' % (mcmc_in, mcmc_file_ext)
|
|
82
|
+
mcmc_file_list = glob.glob(mcmc_file_re)
|
|
83
|
+
|
|
84
|
+
if len(mcmc_file_list) == 0:
|
|
85
|
+
print('*mcmc.txt file not found, program exited!')
|
|
86
|
+
exit()
|
|
87
|
+
|
|
88
|
+
if output_plot[-4:] not in ['.PDF', '.pdf']:
|
|
89
|
+
output_plot = output_plot + '.pdf'
|
|
90
|
+
op_df_tmp = output_plot + '.txt'
|
|
91
|
+
|
|
92
|
+
mcmc_file_full_path_dict = dict()
|
|
93
|
+
for each_mcmc_file in mcmc_file_list:
|
|
94
|
+
mcmc_path, mcmc_base, mcmc_ext = sep_path_basename_ext(each_mcmc_file)
|
|
95
|
+
mcmc_file_full_path_dict[mcmc_base] = each_mcmc_file
|
|
96
|
+
|
|
97
|
+
# read in nodes to plot
|
|
98
|
+
file_to_node_dict = dict()
|
|
99
|
+
file_rename_dict = dict()
|
|
100
|
+
node_rename_dict = dict()
|
|
101
|
+
not_found_file_set = set()
|
|
102
|
+
for each_node in open(node_txt):
|
|
103
|
+
each_node_split = each_node.strip().split()
|
|
104
|
+
print(each_node_split)
|
|
105
|
+
file_name = each_node_split[0]
|
|
106
|
+
if '/' in file_name:
|
|
107
|
+
file_name = file_name.split('/')[-1]
|
|
108
|
+
|
|
109
|
+
if file_name not in mcmc_file_full_path_dict:
|
|
110
|
+
not_found_file_set.add(file_name)
|
|
111
|
+
|
|
112
|
+
node_id = each_node_split[1]
|
|
113
|
+
node_id_with_file_name = '%s_____%s' % (file_name, node_id)
|
|
114
|
+
|
|
115
|
+
if file_name not in file_to_node_dict:
|
|
116
|
+
file_to_node_dict[file_name] = set()
|
|
117
|
+
file_to_node_dict[file_name].add(node_id)
|
|
118
|
+
|
|
119
|
+
if len(each_node_split) >= 3:
|
|
120
|
+
file_short_name = each_node_split[2]
|
|
121
|
+
file_rename_dict[file_name] = file_short_name
|
|
122
|
+
|
|
123
|
+
if len(each_node_split) == 4:
|
|
124
|
+
node_desc = each_node_split[3]
|
|
125
|
+
node_rename_dict[node_id_with_file_name] = node_desc
|
|
126
|
+
|
|
127
|
+
# report not found files and exit
|
|
128
|
+
if len(not_found_file_set) > 0:
|
|
129
|
+
print('MCMC file not found, program exited!')
|
|
130
|
+
exit()
|
|
131
|
+
|
|
132
|
+
found_matched_node = False
|
|
133
|
+
op_df_tmp_handle = open(op_df_tmp, 'w')
|
|
134
|
+
op_df_tmp_handle.write('Value,Node,Setting\n')
|
|
135
|
+
for mcmc_file in file_to_node_dict:
|
|
136
|
+
pwd_mcmc_file = mcmc_file_full_path_dict[mcmc_file]
|
|
137
|
+
current_node_set = file_to_node_dict.get(mcmc_file, set())
|
|
138
|
+
file_name_to_plot = file_rename_dict.get(mcmc_file, mcmc_file)
|
|
139
|
+
mcmc_df = pd.read_table(pwd_mcmc_file, index_col=0)
|
|
140
|
+
for each_col in mcmc_df:
|
|
141
|
+
if each_col in current_node_set:
|
|
142
|
+
node_desc_to_plot = node_rename_dict.get(('%s_____%s' % (mcmc_file, each_col)), each_col)
|
|
143
|
+
found_matched_node = True
|
|
144
|
+
value_list = mcmc_df[each_col].values
|
|
145
|
+
for each_value in value_list:
|
|
146
|
+
op_df_tmp_handle.write('%s,%s,%s\n' % (each_value, node_desc_to_plot, file_name_to_plot))
|
|
147
|
+
op_df_tmp_handle.close()
|
|
148
|
+
|
|
149
|
+
if found_matched_node is False:
|
|
150
|
+
print('Provided node(s) not found, program exited!')
|
|
151
|
+
exit()
|
|
152
|
+
|
|
153
|
+
# plot distribution
|
|
154
|
+
plot_distribution(op_df_tmp, output_plot)
|
|
155
|
+
|
|
156
|
+
# remove tmp files
|
|
157
|
+
os.system('rm %s' % op_df_tmp)
|
|
158
|
+
|
|
159
|
+
# final report
|
|
160
|
+
print('Plot exported to %s, done!' % output_plot)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
if __name__ == '__main__':
|
|
164
|
+
|
|
165
|
+
PlotMcmcNode_parser = argparse.ArgumentParser()
|
|
166
|
+
PlotMcmcNode_parser.add_argument('-i', required=True, help='folder holds the *mcmc.txt files')
|
|
167
|
+
PlotMcmcNode_parser.add_argument('-x', required=False, default='txt', help='file extension, default txt')
|
|
168
|
+
PlotMcmcNode_parser.add_argument('-n', required=True, help='nodes to plot')
|
|
169
|
+
PlotMcmcNode_parser.add_argument('-o', required=True, help='output plot')
|
|
170
|
+
args = vars(PlotMcmcNode_parser.parse_args())
|
|
171
|
+
PlotMcmcNode(args)
|
|
@@ -15,14 +15,16 @@ TreeSAK PlotMcmcNode -i McmcTree_op_files -n nodes.txt -o multi_runs_multi_nodes
|
|
|
15
15
|
|
|
16
16
|
# File name of the mcmc.txt and the corresponding mcmc out file need to follow
|
|
17
17
|
# the rule as specified below:
|
|
18
|
-
[
|
|
19
|
-
[
|
|
18
|
+
[setting_1]_mcmc.txt
|
|
19
|
+
[setting_1]_out.txt
|
|
20
|
+
[setting_2]_mcmc.txt
|
|
21
|
+
[setting_2]_out.txt
|
|
20
22
|
|
|
21
23
|
# file format (-n, tab separated)
|
|
22
24
|
# leave the 2nd column blank for nodes without renaming
|
|
23
|
-
node1 Bacteria
|
|
24
|
-
node2
|
|
25
|
-
node3,node9 Archaea
|
|
25
|
+
setting_1 node1 Bacteria
|
|
26
|
+
setting_2 node2
|
|
27
|
+
setting_3 node3,node9 Archaea
|
|
26
28
|
|
|
27
29
|
# Y-axis label file format (-l, tab separated)
|
|
28
30
|
PA_75_DeltaLL_50_clock3_mcmc.txt DeltaLL_50
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import glob
|
|
3
|
+
import argparse
|
|
4
|
+
from Bio import SeqIO
|
|
5
|
+
import multiprocessing as mp
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
cogTree_usage = '''
|
|
9
|
+
================================ cogTree example commands ================================
|
|
10
|
+
|
|
11
|
+
TreeSAK cogTree -i combined.faa -cog arCOG_wd -o op_dir -bmge -t 12 -f -fun arCOG_id.txt
|
|
12
|
+
TreeSAK cogTree -i combined.faa -cog arCOG_wd -o op_dir -bmge -t 12 -f -fun arCOG00724
|
|
13
|
+
TreeSAK cogTree -i combined.faa -cog arCOG_wd -o op_dir -bmge -t 12 -f -fun arCOG00724,arCOG02271
|
|
14
|
+
|
|
15
|
+
==========================================================================================
|
|
16
|
+
'''
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def select_seq(seq_file, seq_id_set, output_file):
|
|
20
|
+
output_file_handle = open(output_file, 'w')
|
|
21
|
+
for seq_record in SeqIO.parse(seq_file, 'fasta'):
|
|
22
|
+
seq_id = seq_record.id
|
|
23
|
+
if seq_id in seq_id_set:
|
|
24
|
+
SeqIO.write(seq_record, output_file_handle, 'fasta-2line')
|
|
25
|
+
output_file_handle.close()
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def cogTree(args):
|
|
29
|
+
|
|
30
|
+
combined_faa = args['i']
|
|
31
|
+
cog_annotation_wd = args['cog']
|
|
32
|
+
interested_fun_txt = args['fun']
|
|
33
|
+
op_dir = args['o']
|
|
34
|
+
trim_with_bmge = args['bmge']
|
|
35
|
+
trim_model = args['bmge_m']
|
|
36
|
+
entropy_score_cutoff = args['bmge_esc']
|
|
37
|
+
iqtree_model = args['iqtree_m']
|
|
38
|
+
force_overwrite = args['f']
|
|
39
|
+
num_of_threads = args['t']
|
|
40
|
+
|
|
41
|
+
# specify path to BMGE.jar
|
|
42
|
+
current_file_path = '/'.join(os.path.realpath(__file__).split('/')[:-1])
|
|
43
|
+
pwd_bmge_jar = '%s/BMGE.jar' % current_file_path
|
|
44
|
+
|
|
45
|
+
interested_fun_set = set()
|
|
46
|
+
if os.path.isfile(interested_fun_txt) is False:
|
|
47
|
+
if ',' in interested_fun_txt:
|
|
48
|
+
interested_fun_set = interested_fun_txt.split(',')
|
|
49
|
+
else:
|
|
50
|
+
interested_fun_set.add(interested_fun_txt)
|
|
51
|
+
else:
|
|
52
|
+
for each_fun in open(interested_fun_txt):
|
|
53
|
+
interested_fun_set.add(each_fun.strip().split()[0])
|
|
54
|
+
|
|
55
|
+
################################################################################
|
|
56
|
+
|
|
57
|
+
faa_dir = '%s/dir_1_faa' % op_dir
|
|
58
|
+
aln_dir = '%s/dir_2_msa' % op_dir
|
|
59
|
+
trimmed_aln_dir = '%s/dir_3_trimmed_msa' % op_dir
|
|
60
|
+
tree_dir = '%s/dir_4_tree' % op_dir
|
|
61
|
+
cmd_1_mafft_txt = '%s/cmd_1_mafft.txt' % op_dir
|
|
62
|
+
cmd_2_trim_txt = '%s/cmd_2_trim.txt' % op_dir
|
|
63
|
+
cmd_3_tree_txt = '%s/cmd_3_tree.txt' % op_dir
|
|
64
|
+
|
|
65
|
+
################################################################################
|
|
66
|
+
|
|
67
|
+
# create output folder
|
|
68
|
+
if os.path.isdir(op_dir) is True:
|
|
69
|
+
if force_overwrite is True:
|
|
70
|
+
os.system('rm -r %s' % op_dir)
|
|
71
|
+
else:
|
|
72
|
+
print('%s exist, program exited!' % op_dir)
|
|
73
|
+
exit()
|
|
74
|
+
|
|
75
|
+
os.mkdir(op_dir)
|
|
76
|
+
os.mkdir(faa_dir)
|
|
77
|
+
os.mkdir(aln_dir)
|
|
78
|
+
os.mkdir(trimmed_aln_dir)
|
|
79
|
+
os.mkdir(tree_dir)
|
|
80
|
+
|
|
81
|
+
################################################################################
|
|
82
|
+
|
|
83
|
+
fun_to_gene_dict = dict()
|
|
84
|
+
if cog_annotation_wd is not None:
|
|
85
|
+
|
|
86
|
+
print('Reading in COG annotation results')
|
|
87
|
+
file_re = '%s/*COG_wd/*_query_to_cog.txt' % (cog_annotation_wd)
|
|
88
|
+
file_list = glob.glob(file_re)
|
|
89
|
+
|
|
90
|
+
if len(file_list) == 0:
|
|
91
|
+
print('COG annotation file not detected, program exited!')
|
|
92
|
+
exit()
|
|
93
|
+
|
|
94
|
+
for each_file in file_list:
|
|
95
|
+
line_index = 0
|
|
96
|
+
for each_line in open(each_file):
|
|
97
|
+
if line_index > 0:
|
|
98
|
+
each_line_split = each_line.strip().split('\t')
|
|
99
|
+
if len(each_line_split) == 4:
|
|
100
|
+
gene_id = each_line_split[0]
|
|
101
|
+
cog_id = each_line_split[4][2:]
|
|
102
|
+
if cog_id in interested_fun_set:
|
|
103
|
+
if cog_id not in fun_to_gene_dict:
|
|
104
|
+
fun_to_gene_dict[cog_id] = set()
|
|
105
|
+
fun_to_gene_dict[cog_id].add(gene_id)
|
|
106
|
+
line_index += 1
|
|
107
|
+
|
|
108
|
+
cmd_list_mafft = []
|
|
109
|
+
cmd_list_trim = []
|
|
110
|
+
cmd_list_tree = []
|
|
111
|
+
cmd_1_mafft_txt_handle = open(cmd_1_mafft_txt, 'w')
|
|
112
|
+
cmd_2_trim_txt_handle = open(cmd_2_trim_txt, 'w')
|
|
113
|
+
cmd_3_tree_txt_handle = open(cmd_3_tree_txt, 'w')
|
|
114
|
+
for each_fun in sorted(fun_to_gene_dict):
|
|
115
|
+
|
|
116
|
+
# define file name
|
|
117
|
+
fun_faa = '%s/%s.faa' % (faa_dir, each_fun)
|
|
118
|
+
current_gene_tree_dir = '%s/%s' % (tree_dir, each_fun)
|
|
119
|
+
fun_aln = '%s/%s.aln' % (aln_dir, each_fun)
|
|
120
|
+
fun_aln_trimmed = '%s/%s_trimal.aln' % (trimmed_aln_dir, each_fun)
|
|
121
|
+
if trim_with_bmge is True:
|
|
122
|
+
fun_aln_trimmed = '%s/%s_bmge.aln' % (trimmed_aln_dir, each_fun)
|
|
123
|
+
|
|
124
|
+
# extract sequences
|
|
125
|
+
current_fun_gene_set = fun_to_gene_dict[each_fun]
|
|
126
|
+
select_seq(combined_faa, current_fun_gene_set, fun_faa)
|
|
127
|
+
|
|
128
|
+
os.system('mkdir %s' % current_gene_tree_dir)
|
|
129
|
+
|
|
130
|
+
# prepare commands
|
|
131
|
+
mafft_cmd = 'mafft-einsi --thread %s --quiet %s > %s' % (1, fun_faa, fun_aln)
|
|
132
|
+
trim_cmd = 'trimal -in %s -out %s -automated1' % (fun_aln, fun_aln_trimmed)
|
|
133
|
+
if trim_with_bmge is True:
|
|
134
|
+
trim_cmd = 'java -jar %s -i %s -m %s -t AA -h %s -of %s' % (pwd_bmge_jar, fun_aln, trim_model, entropy_score_cutoff, fun_aln_trimmed)
|
|
135
|
+
infer_tree_cmd = 'iqtree2 -s %s --seqtype AA -m %s -B 1000 --wbtl --bnni --prefix %s/%s -T %s --quiet' % (fun_aln_trimmed, iqtree_model, current_gene_tree_dir, each_fun, num_of_threads)
|
|
136
|
+
|
|
137
|
+
# add commands to list
|
|
138
|
+
cmd_list_mafft.append(mafft_cmd)
|
|
139
|
+
cmd_list_trim.append(trim_cmd)
|
|
140
|
+
cmd_list_tree.append(infer_tree_cmd)
|
|
141
|
+
|
|
142
|
+
# write out commands
|
|
143
|
+
cmd_1_mafft_txt_handle.write(mafft_cmd + '\n')
|
|
144
|
+
cmd_2_trim_txt_handle.write(trim_cmd + '\n')
|
|
145
|
+
cmd_3_tree_txt_handle.write(infer_tree_cmd + '\n')
|
|
146
|
+
|
|
147
|
+
cmd_1_mafft_txt_handle.close()
|
|
148
|
+
cmd_2_trim_txt_handle.close()
|
|
149
|
+
cmd_3_tree_txt_handle.close()
|
|
150
|
+
|
|
151
|
+
# run mafft commands
|
|
152
|
+
print('Running mafft with %s cores for %s commands' % (num_of_threads, len(cmd_list_mafft)))
|
|
153
|
+
pool = mp.Pool(processes=num_of_threads)
|
|
154
|
+
pool.map(os.system, cmd_list_mafft)
|
|
155
|
+
pool.close()
|
|
156
|
+
pool.join()
|
|
157
|
+
|
|
158
|
+
# run trim commands
|
|
159
|
+
print('Trimming with %s cores for %s commands' % (num_of_threads, len(cmd_list_trim)))
|
|
160
|
+
pool = mp.Pool(processes=num_of_threads)
|
|
161
|
+
pool.map(os.system, cmd_list_trim)
|
|
162
|
+
pool.close()
|
|
163
|
+
pool.join()
|
|
164
|
+
|
|
165
|
+
# run iqtree commands
|
|
166
|
+
print('Running iqtree with %s cores' % num_of_threads)
|
|
167
|
+
for each_iqtree_cmd in sorted(cmd_list_tree):
|
|
168
|
+
print(each_iqtree_cmd)
|
|
169
|
+
os.system(each_iqtree_cmd)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
if __name__ == '__main__':
|
|
173
|
+
|
|
174
|
+
cogTree_parser = argparse.ArgumentParser()
|
|
175
|
+
cogTree_parser.add_argument('-i', required=True, help='orthologous gene sequence')
|
|
176
|
+
cogTree_parser.add_argument('-fun', required=True, help='interested functions')
|
|
177
|
+
cogTree_parser.add_argument('-cog', required=False, default=None, help='COG annotation results')
|
|
178
|
+
cogTree_parser.add_argument('-o', required=True, help='output directory')
|
|
179
|
+
cogTree_parser.add_argument('-bmge', required=False, action="store_true", help='trim with BMGE, default is trimal')
|
|
180
|
+
cogTree_parser.add_argument('-bmge_m', required=False, default='BLOSUM30', help='trim model, default: BLOSUM30')
|
|
181
|
+
cogTree_parser.add_argument('-bmge_esc', required=False, default='0.55', help='entropy score cutoff, default: 0.55')
|
|
182
|
+
cogTree_parser.add_argument('-iqtree_m', required=False, default='LG+G+I', help='iqtree_model, default: LG+G+I')
|
|
183
|
+
cogTree_parser.add_argument('-f', required=False, action="store_true", help='force overwrite')
|
|
184
|
+
cogTree_parser.add_argument('-t', required=False, type=int, default=1, help='num of threads, default: 1')
|
|
185
|
+
args = vars(cogTree_parser.parse_args())
|
|
186
|
+
cogTree(args)
|
|
@@ -5,14 +5,14 @@ from Bio import SeqIO
|
|
|
5
5
|
import multiprocessing as mp
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
================================
|
|
8
|
+
koTree_usage = '''
|
|
9
|
+
================================ koTree example commands ================================
|
|
10
10
|
|
|
11
|
-
TreeSAK
|
|
12
|
-
TreeSAK
|
|
13
|
-
TreeSAK
|
|
11
|
+
TreeSAK koTree -i combined.faa -kegg KEGG_wd -o op_dir -bmge -t 12 -f -fun ko_id.txt
|
|
12
|
+
TreeSAK koTree -i combined.faa -kegg KEGG_wd -o op_dir -bmge -t 12 -f -fun K01995
|
|
13
|
+
TreeSAK koTree -i combined.faa -kegg KEGG_wd -o op_dir -bmge -t 12 -f -fun K01995,K01996
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
=========================================================================================
|
|
16
16
|
'''
|
|
17
17
|
|
|
18
18
|
|
|
@@ -25,10 +25,9 @@ def select_seq(seq_file, seq_id_set, output_file):
|
|
|
25
25
|
output_file_handle.close()
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def
|
|
28
|
+
def koTree(args):
|
|
29
29
|
|
|
30
30
|
combined_faa = args['i']
|
|
31
|
-
cog_annotation_wd = args['cog']
|
|
32
31
|
kegg_annotation_wd = args['kegg']
|
|
33
32
|
interested_fun_txt = args['fun']
|
|
34
33
|
op_dir = args['o']
|
|
@@ -172,26 +171,24 @@ def FunTree(args):
|
|
|
172
171
|
|
|
173
172
|
if __name__ == '__main__':
|
|
174
173
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
args
|
|
188
|
-
|
|
174
|
+
koTree_parser = argparse.ArgumentParser()
|
|
175
|
+
koTree_parser.add_argument('-i', required=True, help='orthologous gene sequence')
|
|
176
|
+
koTree_parser.add_argument('-fun', required=True, help='interested functions')
|
|
177
|
+
koTree_parser.add_argument('-cog', required=False, default=None, help='COG annotation results')
|
|
178
|
+
koTree_parser.add_argument('-o', required=True, help='output directory')
|
|
179
|
+
koTree_parser.add_argument('-bmge', required=False, action="store_true", help='trim with BMGE, default is trimal')
|
|
180
|
+
koTree_parser.add_argument('-bmge_m', required=False, default='BLOSUM30', help='trim model, default: BLOSUM30')
|
|
181
|
+
koTree_parser.add_argument('-bmge_esc', required=False, default='0.55', help='entropy score cutoff, default: 0.55')
|
|
182
|
+
koTree_parser.add_argument('-iqtree_m', required=False, default='LG+G+I', help='iqtree_model, default: LG+G+I')
|
|
183
|
+
koTree_parser.add_argument('-f', required=False, action="store_true", help='force overwrite')
|
|
184
|
+
koTree_parser.add_argument('-t', required=False, type=int, default=1, help='num of threads, default: 1')
|
|
185
|
+
args = vars(koTree_parser.parse_args())
|
|
186
|
+
koTree(args)
|
|
187
|
+
|
|
189
188
|
|
|
190
189
|
'''
|
|
191
190
|
|
|
192
191
|
cd /scratch/PI/ocessongwz/Sponge_r220/4_OMA_wd/OMA_wd/Output
|
|
193
192
|
TreeSAK FunTree -i /scratch/PI/ocessongwz/Sponge_r220/3_combined_genomes_50_5_dRep97_291.faa -fun K01995,K01996,K01997,K01998,K01999 -kegg /scratch/PI/ocessongwz/Sponge_r220/3_combined_genomes_50_5_dRep97_291_KEGG_wd -o interested_fun_tree_branched_chain_aa_transport_system -bmge -t 12 -f
|
|
194
193
|
|
|
195
|
-
/scratch/PI/ocessongwz/Sponge_r220/3_combined_genomes_50_5_dRep97_291_arCOG_wd
|
|
196
|
-
|
|
197
194
|
'''
|
|
@@ -9,6 +9,8 @@ import multiprocessing as mp
|
|
|
9
9
|
supertree_usage = '''
|
|
10
10
|
====================== supertree example commands ======================
|
|
11
11
|
|
|
12
|
+
Dependencies: mafft, trimal, bmge and iqtree2
|
|
13
|
+
|
|
12
14
|
TreeSAK supertree -i best10 -x fa -o best10_astral_tree -bmge -t 12 -f
|
|
13
15
|
|
|
14
16
|
========================================================================
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: TreeSAK
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.46.1
|
|
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.
|
|
27
|
+
TreeSAK v1.46.1
|
|
@@ -26,7 +26,7 @@ TreeSAK/Dir.rb
|
|
|
26
26
|
TreeSAK/ExtractMarkerSeq.py
|
|
27
27
|
TreeSAK/FastRoot.py
|
|
28
28
|
TreeSAK/FastRoot_backup.py
|
|
29
|
-
TreeSAK/
|
|
29
|
+
TreeSAK/FigTree.py
|
|
30
30
|
TreeSAK/GTDB_tree.py
|
|
31
31
|
TreeSAK/KEGG_Luo17.py
|
|
32
32
|
TreeSAK/LcaToLeaves.py
|
|
@@ -44,6 +44,7 @@ TreeSAK/PhyloBiAssoc.R
|
|
|
44
44
|
TreeSAK/PhyloBiAssoc.py
|
|
45
45
|
TreeSAK/PlotMCMC.py
|
|
46
46
|
TreeSAK/PlotMcmcNode.py
|
|
47
|
+
TreeSAK/PlotMcmcNode_old.py
|
|
47
48
|
TreeSAK/RootTree.py
|
|
48
49
|
TreeSAK/RootTreeGTDB214.py
|
|
49
50
|
TreeSAK/RootTreeGTDB220.py
|
|
@@ -66,6 +67,7 @@ TreeSAK/ale_parser.py
|
|
|
66
67
|
TreeSAK/ale_splitter.py
|
|
67
68
|
TreeSAK/alignment_pruner.pl
|
|
68
69
|
TreeSAK/catfasta2phy.py
|
|
70
|
+
TreeSAK/cogTree.py
|
|
69
71
|
TreeSAK/compare_trees.R
|
|
70
72
|
TreeSAK/compare_trees.py
|
|
71
73
|
TreeSAK/dating.py
|
|
@@ -82,6 +84,7 @@ TreeSAK/gnm_leaves.py
|
|
|
82
84
|
TreeSAK/iTOL.py
|
|
83
85
|
TreeSAK/iTOL_gene_tree.py
|
|
84
86
|
TreeSAK/keep_highest_rrtc.py
|
|
87
|
+
TreeSAK/koTree.py
|
|
85
88
|
TreeSAK/label_tree.R
|
|
86
89
|
TreeSAK/label_tree.py
|
|
87
90
|
TreeSAK/mad.py
|
|
@@ -73,7 +73,8 @@ def print_main_help():
|
|
|
73
73
|
ModifyTopo -> Modify tree topology
|
|
74
74
|
GeneRax -> (to be added) Run GeneRax
|
|
75
75
|
ALE -> Modules for running ALE
|
|
76
|
-
|
|
76
|
+
cogTree -> Infer tree for individual COG function
|
|
77
|
+
koTree -> Infer tree for individual KEGG function
|
|
77
78
|
RootTree -> Root tree with outgroup leaves
|
|
78
79
|
RootTreeGTDB214 -> Root tree by GTDB taxonomy (r214)
|
|
79
80
|
RootTreeGTDB220 -> Root tree by GTDB taxonomy (r220)
|
|
@@ -349,12 +350,10 @@ if __name__ == '__main__':
|
|
|
349
350
|
elif sys.argv[1] == 'PlotMcmcNode':
|
|
350
351
|
from TreeSAK import PlotMcmcNode
|
|
351
352
|
PlotMcmcNode_parser = subparsers.add_parser('PlotMcmcNode', usage=PlotMcmcNode.PlotMcmcNode_usage)
|
|
352
|
-
PlotMcmcNode_parser.add_argument('-i',
|
|
353
|
-
PlotMcmcNode_parser.add_argument('-
|
|
354
|
-
PlotMcmcNode_parser.add_argument('-n',
|
|
355
|
-
PlotMcmcNode_parser.add_argument('-
|
|
356
|
-
PlotMcmcNode_parser.add_argument('-o', required=True, help='Output plot')
|
|
357
|
-
PlotMcmcNode_parser.add_argument('-tmp', required=False, action="store_true", help='keep tmp files')
|
|
353
|
+
PlotMcmcNode_parser.add_argument('-i', required=True, help='folder holds the *mcmc.txt files')
|
|
354
|
+
PlotMcmcNode_parser.add_argument('-x', required=False, default='txt', help='file extension, default txt')
|
|
355
|
+
PlotMcmcNode_parser.add_argument('-n', required=True, help='nodes to plot')
|
|
356
|
+
PlotMcmcNode_parser.add_argument('-o', required=True, help='output plot')
|
|
358
357
|
args = vars(parser.parse_args())
|
|
359
358
|
PlotMcmcNode.PlotMcmcNode(args)
|
|
360
359
|
|
|
@@ -827,22 +826,37 @@ if __name__ == '__main__':
|
|
|
827
826
|
args = vars(parser.parse_args())
|
|
828
827
|
mcmc2tree.mcmc2tree(args)
|
|
829
828
|
|
|
830
|
-
elif sys.argv[1] == '
|
|
831
|
-
from TreeSAK import
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
829
|
+
elif sys.argv[1] == 'cogTree':
|
|
830
|
+
from TreeSAK import cogTree
|
|
831
|
+
cogTree_parser = subparsers.add_parser('cogTree', usage=cogTree.cogTree_usage)
|
|
832
|
+
cogTree_parser.add_argument('-i', required=True, help='orthologous gene sequence')
|
|
833
|
+
cogTree_parser.add_argument('-fun', required=True, help='interested functions')
|
|
834
|
+
cogTree_parser.add_argument('-cog', required=False, default=None, help='COG annotation results')
|
|
835
|
+
cogTree_parser.add_argument('-o', required=True, help='output directory')
|
|
836
|
+
cogTree_parser.add_argument('-bmge', required=False, action="store_true", help='trim with BMGE, default is trimal')
|
|
837
|
+
cogTree_parser.add_argument('-bmge_m', required=False, default='BLOSUM30', help='trim model, default: BLOSUM30')
|
|
838
|
+
cogTree_parser.add_argument('-bmge_esc', required=False, default='0.55', help='entropy score cutoff, default: 0.55')
|
|
839
|
+
cogTree_parser.add_argument('-iqtree_m', required=False, default='LG+G+I', help='iqtree_model, default: LG+G+I')
|
|
840
|
+
cogTree_parser.add_argument('-f', required=False, action="store_true", help='force overwrite')
|
|
841
|
+
cogTree_parser.add_argument('-t', required=False, type=int, default=1, help='num of threads, default: 1')
|
|
842
|
+
args = vars(parser.parse_args())
|
|
843
|
+
cogTree.cogTree(args)
|
|
844
|
+
|
|
845
|
+
elif sys.argv[1] == 'koTree':
|
|
846
|
+
from TreeSAK import koTree
|
|
847
|
+
koTree_parser = subparsers.add_parser('koTree', usage=koTree.koTree_usage)
|
|
848
|
+
koTree_parser.add_argument('-i', required=True, help='orthologous gene sequence')
|
|
849
|
+
koTree_parser.add_argument('-fun', required=True, help='interested functions')
|
|
850
|
+
koTree_parser.add_argument('-kegg', required=False, default=None, help='KEGG annotation results')
|
|
851
|
+
koTree_parser.add_argument('-o', required=True, help='output directory')
|
|
852
|
+
koTree_parser.add_argument('-bmge', required=False, action="store_true", help='trim with BMGE, default is trimal')
|
|
853
|
+
koTree_parser.add_argument('-bmge_m', required=False, default='BLOSUM30', help='trim model, default: BLOSUM30')
|
|
854
|
+
koTree_parser.add_argument('-bmge_esc', required=False, default='0.55', help='entropy score cutoff, default: 0.55')
|
|
855
|
+
koTree_parser.add_argument('-iqtree_m', required=False, default='LG+G+I', help='iqtree_model, default: LG+G+I')
|
|
856
|
+
koTree_parser.add_argument('-f', required=False, action="store_true", help='force overwrite')
|
|
857
|
+
koTree_parser.add_argument('-t', required=False, type=int, default=1, help='num of threads, default: 1')
|
|
858
|
+
args = vars(parser.parse_args())
|
|
859
|
+
koTree.koTree(args)
|
|
846
860
|
|
|
847
861
|
elif sys.argv[1] == 'iTOL_gene_tree':
|
|
848
862
|
from TreeSAK import iTOL_gene_tree
|
|
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
|
|
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
|