TreeSAK 1.46.32__tar.gz → 1.46.34__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.46.32/TreeSAK.egg-info → TreeSAK-1.46.34}/PKG-INFO +2 -2
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/BMGE.py +2 -5
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/PMSF.py +1 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/VERSION +1 -1
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/dating.py +7 -5
- TreeSAK-1.46.34/TreeSAK/mcmcTC.py +104 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34/TreeSAK.egg-info}/PKG-INFO +2 -2
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK.egg-info/SOURCES.txt +1 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/LICENSE +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/MANIFEST.in +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/README.md +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ALE.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ALE1.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ALE2.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ALE2RTC.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ALE3.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ALE4.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ALE5.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ALE6.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ALE7.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ALE_backup.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/AssessCVG.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/AssessMarker.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/AssessMarkerDeltaLL.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/AssessMarkerPA.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/AssessPB.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/BMGE.jar +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/CompareMCMC.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ConcateMSA.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ConvertMSA.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/Dir.rb +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ExtractMarkerSeq.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/FastRoot.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/FastRoot_backup.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/FigTree.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/GTDB_tree.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/KEGG_Luo17.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/LcaToLeaves.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/MarkerRef2Tree.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/MarkerRef2Tree_backup.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/MarkerSeq2Tree.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/MarkerSeq2Tree_backup.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ModifyTopo.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/Newick_tree_plotter.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/OMA.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/OMA2.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/OneLineAln.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/PB.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/PhyloBiAssoc.R +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/PhyloBiAssoc.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/PlotMCMC.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/PlotMcmcNode.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/PlotMcmcNode_old.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/RootTree.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/RootTreeGTDB214.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/RootTreeGTDB220.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/SequentialDating.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/SingleAleHGT.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/SingleLinePhy.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/SliceMSA.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/SplitScore.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/SplitScore1.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/SplitScore1OMA.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/SplitScore2.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/TaxaCountStats.R +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/TaxonTree.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/TreeSAK_config.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/VisHPD95.R +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/VisHPD95.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/__init__.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ale_parser.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/ale_splitter.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/alignment_pruner.pl +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/assessOG.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/catfasta2phy.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/cogTree.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/compare_trees.R +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/compare_trees.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/dating_ss.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/deltall.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/do_rrtc.rb +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/fa2phy.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/format_leaf_name.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/gap_stats.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/get_SCG_tree.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/get_arCOG_seq.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/global_functions.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/gnm_leaves.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/iTOL.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/iTOL_gene_tree.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/keep_highest_rrtc.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/koTree.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/label_tree.R +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/label_tree.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/mad.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/mcmc2tree.py +0 -0
- /TreeSAK-1.46.32/TreeSAK/mcmcTC.py → /TreeSAK-1.46.34/TreeSAK/mcmcTC copy.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/merge_pdf.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/pRTC.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/plot_distruibution_th.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/prep_mcmctree_ctl.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/print_leaves.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/pruneMSA.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/recode.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/remove_bias.R +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/rename_leaves.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/replace_clade.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/root_with_out_group.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/run_TaxaCountStats_R_s1.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/subsample_drep_gnms.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/subset.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/subset_tree_stupid_old_way.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/supertree.py +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK/weighted_rand.rb +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK.egg-info/dependency_links.txt +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK.egg-info/requires.txt +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/TreeSAK.egg-info/top_level.txt +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/bin/TreeSAK +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/setup.cfg +0 -0
- {TreeSAK-1.46.32 → TreeSAK-1.46.34}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: TreeSAK
|
|
3
|
-
Version: 1.46.
|
|
3
|
+
Version: 1.46.34
|
|
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.46.
|
|
27
|
+
TreeSAK v1.46.34
|
|
@@ -24,18 +24,15 @@ def BMGE(args):
|
|
|
24
24
|
entropy_score_cutoff = args['esc']
|
|
25
25
|
|
|
26
26
|
# define file name
|
|
27
|
-
msa_out_phylip = '%s.BMGE.phylip' % op_prefix
|
|
28
27
|
msa_out_fasta = '%s.BMGE.fasta' % op_prefix
|
|
29
|
-
msa_out_nexus = '%s.BMGE.nexus' % op_prefix
|
|
30
|
-
msa_out_html = '%s.BMGE.html' % op_prefix
|
|
31
28
|
|
|
32
29
|
# specify path to BMGE.jar
|
|
33
30
|
current_file_path = '/'.join(os.path.realpath(__file__).split('/')[:-1])
|
|
34
31
|
pwd_bmge_jar = '%s/BMGE.jar' % current_file_path
|
|
35
32
|
|
|
36
33
|
# run BMGE
|
|
37
|
-
bmge_cmd = 'java -jar %s -i %s -m %s -t AA -h %s -
|
|
38
|
-
print(
|
|
34
|
+
bmge_cmd = 'java -jar %s -i %s -m %s -t AA -h %s -of %s' % (pwd_bmge_jar, msa_in, trim_model, entropy_score_cutoff, msa_out_fasta)
|
|
35
|
+
print(bmge_cmd)
|
|
39
36
|
os.system(bmge_cmd)
|
|
40
37
|
|
|
41
38
|
print('Done!')
|
|
@@ -9,6 +9,7 @@ PMSF_usage = '''
|
|
|
9
9
|
# Dependency: iqtree2
|
|
10
10
|
|
|
11
11
|
TreeSAK PMSF -i in.aln -o get_PMSF_tree_wd -t 12
|
|
12
|
+
TreeSAK PMSF -i in.aln -o get_PMSF_tree_wd -t 12 -topo topo.tree
|
|
12
13
|
|
|
13
14
|
# This is a wrapper for:
|
|
14
15
|
iqtree2 -T 12 -B 1000 --alrt 1000 --quiet --seqtype AA -s in.aln --prefix guide_tree -m LG+F+G
|
|
@@ -9,7 +9,7 @@ dating_usage = '''
|
|
|
9
9
|
|
|
10
10
|
# Requirement: PAML
|
|
11
11
|
|
|
12
|
-
TreeSAK dating -tree gnm.tree -msa marker.phy -p topo1 -o dating_wd -f
|
|
12
|
+
TreeSAK dating -tree gnm.tree -msa marker.phy -p topo1 -o dating_wd -f -s
|
|
13
13
|
TreeSAK dating -tree gnm.tree -msa marker.phy -p topo2 -o dating_wd -f -srun
|
|
14
14
|
|
|
15
15
|
=============================================================================
|
|
@@ -183,6 +183,8 @@ def dating(args):
|
|
|
183
183
|
print('Preparing files for dating estimation')
|
|
184
184
|
|
|
185
185
|
para_comb_dict = get_parameter_combinations(para_to_test_dict)
|
|
186
|
+
print('para_comb_dict')
|
|
187
|
+
print(para_comb_dict)
|
|
186
188
|
|
|
187
189
|
dating_cmds_txt_handle = open(dating_cmds_txt, 'w')
|
|
188
190
|
for para_comb in sorted(list(para_comb_dict.keys())):
|
|
@@ -204,7 +206,7 @@ def dating(args):
|
|
|
204
206
|
mcmctree_ctl_2 = '%s/mcmctree.ctl' % current_dating_wd_2
|
|
205
207
|
|
|
206
208
|
# run 1
|
|
207
|
-
current_para_dict_run1 = para_comb_dict[para_comb]
|
|
209
|
+
current_para_dict_run1 = para_comb_dict[para_comb].copy()
|
|
208
210
|
current_para_dict_run1['seqfile'] = msa_f_name
|
|
209
211
|
current_para_dict_run1['treefile'] = tree_f_name
|
|
210
212
|
current_para_dict_run1['mcmcfile'] = '%s_%s_mcmc_run1.txt' % (op_prefix, para_comb)
|
|
@@ -213,13 +215,13 @@ def dating(args):
|
|
|
213
215
|
current_para_dict_run1['usedata'] = '2'
|
|
214
216
|
|
|
215
217
|
# run 2
|
|
216
|
-
current_para_dict_run2 = para_comb_dict[para_comb]
|
|
218
|
+
current_para_dict_run2 = para_comb_dict[para_comb].copy()
|
|
217
219
|
current_para_dict_run2['seqfile'] = msa_f_name
|
|
218
220
|
current_para_dict_run2['treefile'] = tree_f_name
|
|
219
221
|
current_para_dict_run2['mcmcfile'] = '%s_%s_mcmc_run2.txt' % (op_prefix, para_comb)
|
|
220
222
|
current_para_dict_run2['outfile'] = '%s_%s_out_run2.txt' % (op_prefix, para_comb)
|
|
221
|
-
current_para_dict_run2['seqtype']
|
|
222
|
-
current_para_dict_run2['usedata']
|
|
223
|
+
current_para_dict_run2['seqtype'] = seq_type
|
|
224
|
+
current_para_dict_run2['usedata'] = '2'
|
|
223
225
|
|
|
224
226
|
prep_mcmctree_ctl(current_para_dict_run1, mcmctree_ctl_1)
|
|
225
227
|
prep_mcmctree_ctl(current_para_dict_run2, mcmctree_ctl_2)
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
from ete3 import Tree
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
mcmcTC_usage = '''
|
|
6
|
+
======================================= mcmcTC example commands =======================================
|
|
7
|
+
|
|
8
|
+
TreeSAK mcmcTC -i in.tree -o out.tree -tc time_constraints.txt
|
|
9
|
+
|
|
10
|
+
# Format of constraint file (tab separated columns)
|
|
11
|
+
IMG2264867070_yang,GCF900696045_1_yang lca 3.46-4.38 Archaeal root
|
|
12
|
+
GCF000015225_1_yang,GCF000007225_1_yang lca -2.32 Oxygen Age Constraint, Thermoproteales
|
|
13
|
+
GCF000213215_1_yang,GCA000024305_1_yang lca -2.32 Oxygen Age Constraint, Sulfolobales
|
|
14
|
+
GCF000152265_2_yang,GCF000195915_1_yang lca -2.32 Oxygen Age Constraint, Thermoplasma
|
|
15
|
+
GCF000376445_1_yang,GCF000172995_2_yang lca -1.579 Chitin Age Constraint, Halobacteriales
|
|
16
|
+
GCF000195935_2_yang,GCF000151105_2_yang lca -1.579 Chitin Age Constraint, Thermococcales
|
|
17
|
+
GCA000802205_2_yang,GCF000303155_1_yang lca_p 0.75-1.49 HGT from Viridiplantae to Thaumarchaeota
|
|
18
|
+
|
|
19
|
+
# lca: last common ancestor
|
|
20
|
+
# lca_p: parent of last common ancestor
|
|
21
|
+
|
|
22
|
+
=======================================================================================================
|
|
23
|
+
'''
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def mcmcTC(args):
|
|
27
|
+
|
|
28
|
+
tree_file_in = args['i']
|
|
29
|
+
time_constraint_txt = args['tc']
|
|
30
|
+
tree_file_out = args['o']
|
|
31
|
+
|
|
32
|
+
constraint_set = set()
|
|
33
|
+
constraint_dict = dict()
|
|
34
|
+
constraint_type_dict = dict()
|
|
35
|
+
not_recognizable_time_constraint_set = set()
|
|
36
|
+
for each_constraint in open(time_constraint_txt):
|
|
37
|
+
each_constraint_split = each_constraint.strip().split('\t')
|
|
38
|
+
leaf_ids = each_constraint_split[0]
|
|
39
|
+
constraint_type = each_constraint_split[1]
|
|
40
|
+
provided_age = each_constraint_split[2]
|
|
41
|
+
|
|
42
|
+
str_to_add = ''
|
|
43
|
+
if provided_age.startswith('-'):
|
|
44
|
+
str_to_add = '<%s' % provided_age[1:]
|
|
45
|
+
elif provided_age.endswith('-'):
|
|
46
|
+
str_to_add = '>%s' % provided_age[:-1]
|
|
47
|
+
elif '-' in provided_age:
|
|
48
|
+
provided_age_split = provided_age.split('-')
|
|
49
|
+
str_to_add = '>%s<%s' % (provided_age_split[0], provided_age_split[1])
|
|
50
|
+
else:
|
|
51
|
+
not_recognizable_time_constraint_set.add(provided_age)
|
|
52
|
+
|
|
53
|
+
constraint_set.add(str_to_add)
|
|
54
|
+
constraint_dict[leaf_ids] = str_to_add
|
|
55
|
+
constraint_type_dict[leaf_ids] = constraint_type
|
|
56
|
+
|
|
57
|
+
if len(not_recognizable_time_constraint_set) > 0:
|
|
58
|
+
print('Format of the following time constraints are not recognizable, program exited')
|
|
59
|
+
print(','.join(not_recognizable_time_constraint_set))
|
|
60
|
+
exit()
|
|
61
|
+
|
|
62
|
+
# read in tree
|
|
63
|
+
tree_in = Tree(tree_file_in, quoted_node_names=True, format=1)
|
|
64
|
+
|
|
65
|
+
# add time constraints as node name
|
|
66
|
+
for each_node in constraint_dict:
|
|
67
|
+
node_age = constraint_dict[each_node]
|
|
68
|
+
node_split = each_node.split(',')
|
|
69
|
+
current_lca = tree_in.get_common_ancestor(node_split)
|
|
70
|
+
constraint_type = constraint_type_dict[each_node]
|
|
71
|
+
if constraint_type == 'lca':
|
|
72
|
+
current_lca.add_features(custom_label=node_age)
|
|
73
|
+
current_lca.name = node_age
|
|
74
|
+
elif constraint_type == 'lca_p':
|
|
75
|
+
current_lca_p = current_lca.up
|
|
76
|
+
current_lca_p.add_features(custom_label=node_age)
|
|
77
|
+
current_lca_p.name = node_age
|
|
78
|
+
|
|
79
|
+
tree_out_str = tree_in.write(format=1)
|
|
80
|
+
|
|
81
|
+
# remove branch length of 1
|
|
82
|
+
tree_out_str = tree_out_str.replace(':1', '')
|
|
83
|
+
|
|
84
|
+
# quote constraint strings
|
|
85
|
+
for each_constraint in constraint_set:
|
|
86
|
+
tree_out_str = tree_out_str.replace(each_constraint, ("'%s'" % each_constraint))
|
|
87
|
+
|
|
88
|
+
# remove the most outside parenthesis
|
|
89
|
+
tree_out_str = tree_out_str[1:].replace(');', ';')
|
|
90
|
+
|
|
91
|
+
# write tree to file
|
|
92
|
+
with open(tree_file_out, 'w') as tree_file_out_handle:
|
|
93
|
+
tree_file_out_handle.write('%s\t1\n' % len(tree_in.get_leaves()))
|
|
94
|
+
tree_file_out_handle.write(tree_out_str)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
if __name__ == '__main__':
|
|
98
|
+
|
|
99
|
+
mcmcTC_parser = argparse.ArgumentParser()
|
|
100
|
+
mcmcTC_parser.add_argument('-i', required=True, help='input tree')
|
|
101
|
+
mcmcTC_parser.add_argument('-o', required=True, help='output tree')
|
|
102
|
+
mcmcTC_parser.add_argument('-tc', required=True, help='time constraint file')
|
|
103
|
+
args = vars(mcmcTC_parser.parse_args())
|
|
104
|
+
mcmcTC(args)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: TreeSAK
|
|
3
|
-
Version: 1.46.
|
|
3
|
+
Version: 1.46.34
|
|
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.46.
|
|
27
|
+
TreeSAK v1.46.34
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|