TreeSAK 1.58.4__tar.gz → 1.58.5__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.58.4/treesak.egg-info → treesak-1.58.5}/PKG-INFO +2 -2
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/VERSION +1 -1
- treesak-1.58.5/TreeSAK/mcmc2tree.py +93 -0
- {treesak-1.58.4 → treesak-1.58.5}/bin/TreeSAK +0 -1
- {treesak-1.58.4 → treesak-1.58.5/treesak.egg-info}/PKG-INFO +2 -2
- treesak-1.58.4/TreeSAK/mcmc2tree.py +0 -58
- {treesak-1.58.4 → treesak-1.58.5}/LICENSE +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/MANIFEST.in +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/README.md +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ALE.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ALE1.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ALE2.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ALE2RTC.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ALE3.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ALE4.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ALE5.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ALE6.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ALE7.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ALE_backup.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/AssessCVG.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/AssessMarker.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/AssessMarkerDeltaLL.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/AssessMarkerPA.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/BMGE.jar +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/BMGE.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/C60SR4.nex +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/CompareMCMC.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ConcateMSA.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ConvertMSA.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/Dir.rb +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ExtractMarkerSeq.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/FastRoot.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/FastRoot_backup.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/FigTree.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/GTDB_tree.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/GeneTree.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/KEGG_Luo17.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/LcaToLeaves.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/MarkerRef2Tree.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/MarkerRef2Tree_backup.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/MarkerSeq2Tree.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/MarkerSeq2Tree_backup.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ModifyTopo.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/Newick_tree_plotter.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/OMA.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/OMA2.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/OneLineAln.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/PB.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/PMSF.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/PhyloBiAssoc.R +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/PhyloBiAssoc.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/PlotMCMC.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/PlotMcmcNode.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/PlotMcmcNode_old.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/RootTree.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/RootTreeGTDB.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/RootTreeGTDB214.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/RootTreeGTDB220.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/SequentialDating.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/SingleAleHGT.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/SingleLinePhy.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/SliceMSA.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/SplitScore.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/SplitScore1.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/SplitScore1OMA.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/SplitScore2.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/TaxaCountStats.R +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/TaxonTree.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/TreeSAK_config.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/VisHPD95.R +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/VisHPD95.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/__init__.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ale_parser.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/ale_splitter.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/alignment_pruner.pl +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/assessOG.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/assessPB.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/batch_itol.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/catfasta2phy.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/cogTree.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/compare_trees.R +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/compare_trees.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/cophyloplot.R +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/cophyloplot.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/dating.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/dating_ss.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/deltall.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/do_rrtc.rb +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/fa2phy.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/filter_rename_ar53.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/format_leaf_name.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/gap_stats.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/get_SCG_tree.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/get_arCOG_seq.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/get_lca_id.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/global_functions.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/gnm_leaves.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/guide_tree.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/iTOL.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/iTOL_Tanglegram.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/iTOL_gene_tree.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/itol_msa_stats.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/keep_highest_rrtc.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/koTree.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/label_gene_tree_by_gnm.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/label_tree.R +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/label_tree.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/mad.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/mcmcTC copy.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/mcmcTC.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/mcmctree_out.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/mcmctree_vs_reltime.R +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/mcmctree_vs_reltime.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/merge_pdf.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/pRTC.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/parse_mcmctree.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/parse_reltime.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/phy2fa.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/plot_distruibution_th.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/prep_mcmctree_ctl.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/print_leaves.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/pruneMSA.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/recode.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/remove_bias.R +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/rename_leaves.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/replace_clade.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/rm_leaf.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/root_with_out_group.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/run_TaxaCountStats_R_s1.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/subsample_drep_gnms.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/subset.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/subset_tree_stupid_old_way.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/supertree.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/tmp_1.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/tmp_2.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/tmp_3.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/tmp_4.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/tree_fmt.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/TreeSAK/weighted_rand.rb +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/setup.cfg +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/setup.py +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/treesak.egg-info/SOURCES.txt +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/treesak.egg-info/dependency_links.txt +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/treesak.egg-info/requires.txt +0 -0
- {treesak-1.58.4 → treesak-1.58.5}/treesak.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: treesak
|
|
3
|
-
Version: 1.58.
|
|
3
|
+
Version: 1.58.5
|
|
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.58.
|
|
27
|
+
TreeSAK v1.58.5
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import argparse
|
|
3
|
+
from ete3 import Tree
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
mcmc2tree_usage = '''
|
|
7
|
+
=============== mcmc2tree example commands ===============
|
|
8
|
+
|
|
9
|
+
TreeSAK mcmc2tree -i mcmctree.out
|
|
10
|
+
|
|
11
|
+
# This module will extract two trees from the input file
|
|
12
|
+
1. one tree with mcmctree added internal node ids
|
|
13
|
+
2. another tree with node ages
|
|
14
|
+
|
|
15
|
+
=========================================================
|
|
16
|
+
'''
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def sep_path_basename_ext(file_in):
|
|
20
|
+
|
|
21
|
+
f_path, f_name = os.path.split(file_in)
|
|
22
|
+
if f_path == '':
|
|
23
|
+
f_path = '.'
|
|
24
|
+
f_base, f_ext = os.path.splitext(f_name)
|
|
25
|
+
f_ext = f_ext[1:]
|
|
26
|
+
|
|
27
|
+
return f_name, f_path, f_base, f_ext
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def mcmc2tree(args):
|
|
31
|
+
|
|
32
|
+
mamctree_out = args['i']
|
|
33
|
+
|
|
34
|
+
# define output file name
|
|
35
|
+
_, _, file_in_base, _ = sep_path_basename_ext(mamctree_out)
|
|
36
|
+
|
|
37
|
+
op_tree_with_internal_node = '%s_with_mcmctree_internal_node.treefile' % file_in_base
|
|
38
|
+
op_tree_with_node_age = '%s_with_node_age.treefile' % file_in_base
|
|
39
|
+
|
|
40
|
+
if os.path.isfile(mamctree_out) is False:
|
|
41
|
+
print('%s not found, program exited!' % mamctree_out)
|
|
42
|
+
|
|
43
|
+
# get tree string from mcmctree_out
|
|
44
|
+
tree_str_list = []
|
|
45
|
+
add_str_to_list = False
|
|
46
|
+
for each_line in open(mamctree_out):
|
|
47
|
+
each_line = each_line.strip()
|
|
48
|
+
if 'Species tree for FigTree. Branch lengths = posterior mean times; 95% CIs = labels' in each_line:
|
|
49
|
+
add_str_to_list = True
|
|
50
|
+
if 'Posterior mean (95% Equal-tail CI) (95% HPD CI) HPD-CI-width' in each_line:
|
|
51
|
+
add_str_to_list = False
|
|
52
|
+
|
|
53
|
+
if add_str_to_list is True:
|
|
54
|
+
if (not each_line.startswith('Species tree for FigTree.')) and (len(each_line) > 0):
|
|
55
|
+
tree_str_list.append(each_line.replace(' ', ''))
|
|
56
|
+
|
|
57
|
+
tree_str_with_internal_node_id = tree_str_list[0]
|
|
58
|
+
tree_str_with_node_age = tree_str_list[-1]
|
|
59
|
+
|
|
60
|
+
# rename internal nodes
|
|
61
|
+
t = Tree(tree_str_with_internal_node_id, format=1)
|
|
62
|
+
for each_node in t.traverse():
|
|
63
|
+
if each_node.is_leaf():
|
|
64
|
+
node_name_new = '_'.join(each_node.name.split('_')[1:])
|
|
65
|
+
else:
|
|
66
|
+
node_name_new = 't_n%s' % each_node.name
|
|
67
|
+
each_node.name = node_name_new
|
|
68
|
+
|
|
69
|
+
# write out tree_str_with_node_age
|
|
70
|
+
op_tree_with_node_age_handle = open(op_tree_with_node_age, 'w')
|
|
71
|
+
op_tree_with_node_age_handle.write(tree_str_with_node_age + '\n')
|
|
72
|
+
op_tree_with_node_age_handle.close()
|
|
73
|
+
|
|
74
|
+
# rename tree nodes
|
|
75
|
+
t = Tree(tree_str_with_internal_node_id, format=1)
|
|
76
|
+
for each_node in t.traverse():
|
|
77
|
+
if each_node.is_leaf():
|
|
78
|
+
node_name_new = '_'.join(each_node.name.split('_')[1:])
|
|
79
|
+
else:
|
|
80
|
+
node_name_new = 't_n%s' % each_node.name
|
|
81
|
+
each_node.name = node_name_new
|
|
82
|
+
|
|
83
|
+
op_tree_with_internal_node_handle = open(op_tree_with_internal_node, 'w')
|
|
84
|
+
op_tree_with_internal_node_handle.write(t.write(format=8) + '\n')
|
|
85
|
+
op_tree_with_internal_node_handle.close()
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
if __name__ == '__main__':
|
|
89
|
+
|
|
90
|
+
mcmc2tree_parser = argparse.ArgumentParser()
|
|
91
|
+
mcmc2tree_parser.add_argument('-i', required=True, help='the .out file from mcmctree')
|
|
92
|
+
args = vars(mcmc2tree_parser.parse_args())
|
|
93
|
+
mcmc2tree(args)
|
|
@@ -856,7 +856,6 @@ if __name__ == '__main__':
|
|
|
856
856
|
from TreeSAK import mcmc2tree
|
|
857
857
|
mcmc2tree_parser = subparsers.add_parser('mcmc2tree', usage=mcmc2tree.mcmc2tree_usage)
|
|
858
858
|
mcmc2tree_parser.add_argument('-i', required=True, help='the .out file from mcmctree')
|
|
859
|
-
mcmc2tree_parser.add_argument('-o', required=True, help='output tree file')
|
|
860
859
|
args = vars(parser.parse_args())
|
|
861
860
|
mcmc2tree.mcmc2tree(args)
|
|
862
861
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: treesak
|
|
3
|
-
Version: 1.58.
|
|
3
|
+
Version: 1.58.5
|
|
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.58.
|
|
27
|
+
TreeSAK v1.58.5
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import argparse
|
|
3
|
-
from ete3 import Tree
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
mcmc2tree_usage = '''
|
|
7
|
-
============ mcmc2tree example commands ============
|
|
8
|
-
|
|
9
|
-
TreeSAK mcmc2tree -i mcmctree.out -o renamed.tree
|
|
10
|
-
|
|
11
|
-
====================================================
|
|
12
|
-
'''
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def mcmc2tree(args):
|
|
16
|
-
|
|
17
|
-
mamctree_out = args['i']
|
|
18
|
-
tree_file = args['o']
|
|
19
|
-
|
|
20
|
-
if os.path.isfile(mamctree_out) is False:
|
|
21
|
-
print('%s not found, program exited!' % mamctree_out)
|
|
22
|
-
|
|
23
|
-
# get tree string from mcmctree_out
|
|
24
|
-
tree_str = ''
|
|
25
|
-
tree_line = 0
|
|
26
|
-
current_line = 1
|
|
27
|
-
for each_line in open(mamctree_out):
|
|
28
|
-
if 'Species tree for FigTree. Branch lengths = posterior mean times; 95% CIs = labels' in each_line:
|
|
29
|
-
tree_line = current_line + 1
|
|
30
|
-
if tree_line == current_line:
|
|
31
|
-
tree_str = each_line.strip()
|
|
32
|
-
current_line += 1
|
|
33
|
-
|
|
34
|
-
tree_str_no_space = tree_str.replace(' ', '')
|
|
35
|
-
|
|
36
|
-
# rename tree nodes
|
|
37
|
-
t = Tree(tree_str_no_space, format=1)
|
|
38
|
-
for each_node in t.traverse():
|
|
39
|
-
if each_node.is_leaf():
|
|
40
|
-
node_name_new = '_'.join(each_node.name.split('_')[1:])
|
|
41
|
-
else:
|
|
42
|
-
node_name_new = 't_n%s' % each_node.name
|
|
43
|
-
each_node.name = node_name_new
|
|
44
|
-
|
|
45
|
-
tree_str_renamed = t.write(format=8)
|
|
46
|
-
|
|
47
|
-
tree_file_handle = open(tree_file, 'w')
|
|
48
|
-
tree_file_handle.write(tree_str_renamed + '\n')
|
|
49
|
-
tree_file_handle.close()
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if __name__ == '__main__':
|
|
53
|
-
|
|
54
|
-
mcmc2tree_parser = argparse.ArgumentParser()
|
|
55
|
-
mcmc2tree_parser.add_argument('-i', required=True, help='the .out file from mcmctree')
|
|
56
|
-
mcmc2tree_parser.add_argument('-o', required=True, help='output tree file')
|
|
57
|
-
args = vars(mcmc2tree_parser.parse_args())
|
|
58
|
-
mcmc2tree(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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|