TreeSAK 1.58.0__tar.gz → 1.58.2__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.0/treesak.egg-info → treesak-1.58.2}/PKG-INFO +2 -2
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/VERSION +3 -3
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/iTOL.py +43 -48
- treesak-1.58.2/TreeSAK/iTOL_Tanglegram.py +124 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/mcmctree_out.py +11 -18
- {treesak-1.58.0 → treesak-1.58.2}/bin/TreeSAK +1 -0
- {treesak-1.58.0 → treesak-1.58.2/treesak.egg-info}/PKG-INFO +2 -2
- {treesak-1.58.0 → treesak-1.58.2}/treesak.egg-info/SOURCES.txt +1 -1
- treesak-1.58.0/TreeSAK/Tanglegram.py +0 -84
- {treesak-1.58.0 → treesak-1.58.2}/LICENSE +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/MANIFEST.in +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/README.md +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ALE.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ALE1.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ALE2.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ALE2RTC.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ALE3.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ALE4.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ALE5.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ALE6.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ALE7.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ALE_backup.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/AssessCVG.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/AssessMarker.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/AssessMarkerDeltaLL.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/AssessMarkerPA.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/BMGE.jar +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/BMGE.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/C60SR4.nex +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/CompareMCMC.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ConcateMSA.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ConvertMSA.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/Dir.rb +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ExtractMarkerSeq.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/FastRoot.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/FastRoot_backup.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/FigTree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/GTDB_tree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/GeneTree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/KEGG_Luo17.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/LcaToLeaves.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/MarkerRef2Tree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/MarkerRef2Tree_backup.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/MarkerSeq2Tree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/MarkerSeq2Tree_backup.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ModifyTopo.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/Newick_tree_plotter.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/OMA.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/OMA2.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/OneLineAln.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/PB.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/PMSF.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/PhyloBiAssoc.R +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/PhyloBiAssoc.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/PlotMCMC.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/PlotMcmcNode.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/PlotMcmcNode_old.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/RootTree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/RootTreeGTDB.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/RootTreeGTDB214.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/RootTreeGTDB220.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/SequentialDating.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/SingleAleHGT.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/SingleLinePhy.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/SliceMSA.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/SplitScore.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/SplitScore1.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/SplitScore1OMA.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/SplitScore2.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/TaxaCountStats.R +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/TaxonTree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/TimeScale.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/TreeSAK_config.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/VisHPD95.R +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/VisHPD95.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/__init__.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ale_parser.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/ale_splitter.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/alignment_pruner.pl +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/assessOG.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/assessPB.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/batch_itol.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/catfasta2phy.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/cogTree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/compare_trees.R +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/compare_trees.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/cophyloplot.R +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/cophyloplot.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/dating.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/dating_ss.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/deltall.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/do_rrtc.rb +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/fa2phy.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/filter_rename_ar53.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/format_leaf_name.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/gap_stats.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/get_SCG_tree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/get_arCOG_seq.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/get_lca_id.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/global_functions.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/gnm_leaves.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/guide_tree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/iTOL_gene_tree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/itol_msa_stats.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/keep_highest_rrtc.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/koTree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/label_gene_tree_by_gnm.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/label_tree.R +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/label_tree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/mad.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/mcmc2tree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/mcmcTC copy.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/mcmcTC.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/mcmctree_vs_reltime.R +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/mcmctree_vs_reltime.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/merge_pdf.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/pRTC.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/parse_mcmctree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/parse_reltime.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/phy2fa.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/plot_distruibution_th.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/prep_mcmctree_ctl.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/print_leaves.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/pruneMSA.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/recode.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/remove_bias.R +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/rename_leaves.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/replace_clade.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/rm_leaf.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/root_with_out_group.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/run_TaxaCountStats_R_s1.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/subsample_drep_gnms.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/subset.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/subset_tree_stupid_old_way.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/supertree.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/tmp_1.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/tmp_2.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/tmp_3.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/tmp_4.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/tree_fmt.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/TreeSAK/weighted_rand.rb +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/setup.cfg +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/setup.py +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/treesak.egg-info/dependency_links.txt +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/treesak.egg-info/requires.txt +0 -0
- {treesak-1.58.0 → treesak-1.58.2}/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.2
|
|
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.2
|
|
@@ -92,57 +92,43 @@ def get_timescale_file(chart_ttl, time_range, time_unit, interested_rank):
|
|
|
92
92
|
interested_rank_list = interested_rank.split(',')
|
|
93
93
|
for each_rank in dod:
|
|
94
94
|
if each_rank in interested_rank_list:
|
|
95
|
+
current_rank_dict = dod[each_rank]
|
|
96
|
+
items = current_rank_dict.items()
|
|
97
|
+
sorted_items = sorted(items, key=lambda item: item[1][0])
|
|
98
|
+
sorted_keys = [item[0] for item in sorted_items]
|
|
99
|
+
|
|
100
|
+
vertical_shift_index = interested_rank_list.index(each_rank)
|
|
101
|
+
if vertical_shift_index == 0:
|
|
102
|
+
vertical_shift_value_grey = (2 * vertical_shift_index) * 50
|
|
103
|
+
vertical_shift_value_non_grey = (2 * vertical_shift_index + 1) * 50
|
|
104
|
+
else:
|
|
105
|
+
|
|
106
|
+
vertical_shift_value_grey = 50 + (vertical_shift_index * 50)
|
|
107
|
+
vertical_shift_value_non_grey = vertical_shift_value_grey
|
|
108
|
+
|
|
95
109
|
itol_file = './iTOL_TimeScale_%s.txt' % each_rank
|
|
96
110
|
itol_file_handle = open(itol_file, 'w')
|
|
97
|
-
itol_file_handle.write('DATASET_TIMESCALE\nSEPARATOR TAB\n')
|
|
98
|
-
itol_file_handle.write('\n')
|
|
99
|
-
|
|
100
|
-
itol_file_handle.write('# position related\n')
|
|
101
|
-
itol_file_handle.write('POSITION_ABOVE\t0\n')
|
|
102
|
-
vertical_shift_index = interested_rank_list.index(each_rank) + 1
|
|
103
|
-
vertical_shift_value = vertical_shift_index * 50
|
|
104
|
-
itol_file_handle.write('VERTICAL_SHIFT\t%s\n' % vertical_shift_value)
|
|
105
|
-
itol_file_handle.write('AUTO_SCALE\t0\n')
|
|
106
|
-
itol_file_handle.write('SCALING_FACTOR\t1\n')
|
|
107
|
-
itol_file_handle.write('COVER_TREE\t0\n')
|
|
108
|
-
itol_file_handle.write('\n')
|
|
109
|
-
|
|
110
|
-
itol_file_handle.write('# dataset label related\n')
|
|
111
|
-
itol_file_handle.write('DATASET_LABEL\t%s\n' % each_rank)
|
|
112
|
-
itol_file_handle.write('SHOW_LABELS\t1\n')
|
|
113
|
-
itol_file_handle.write('LABEL_POSITION\tend\n')
|
|
114
|
-
itol_file_handle.write('LABEL_SHIFT_X\t30\n')
|
|
115
|
-
itol_file_handle.write('LABEL_SHIFT_Y\t0\n')
|
|
116
|
-
itol_file_handle.write('SIZE_FACTOR\t2\n')
|
|
117
|
-
itol_file_handle.write('LABEL_ROTATION\t0\n')
|
|
118
|
-
itol_file_handle.write('\n')
|
|
119
|
-
|
|
120
|
-
itol_file_handle.write('# range label related\n')
|
|
121
|
-
itol_file_handle.write('SHOW_RANGE_LABELS\t1\n')
|
|
122
|
-
itol_file_handle.write('RANGE_LABEL_SIZE\t10\n')
|
|
123
|
-
itol_file_handle.write('RANGE_LABEL_ROTATION\t0\n')
|
|
124
|
-
itol_file_handle.write('RANGE_LABEL_POSITION\tcenter\n')
|
|
125
|
-
itol_file_handle.write('RANGE_LABEL_SHIFT_X\t0\n')
|
|
126
|
-
itol_file_handle.write('RANGE_LABEL_SHIFT_Y\t0\n')
|
|
127
|
-
itol_file_handle.write('RANGE_LABEL_COLOR\t#000000\n')
|
|
128
|
-
itol_file_handle.write('# RANGE_LABEL_AUTO_COLOR\t1\n')
|
|
129
|
-
itol_file_handle.write('\n')
|
|
130
|
-
|
|
131
|
-
itol_file_handle.write('# border related\n')
|
|
132
|
-
itol_file_handle.write('BORDER_WIDTH\t0\n')
|
|
133
|
-
itol_file_handle.write('BORDER_COLOR\t#000000\n')
|
|
134
|
-
itol_file_handle.write('BORDER_DASHED\t0\n')
|
|
135
|
-
itol_file_handle.write('\n')
|
|
136
|
-
|
|
137
|
-
itol_file_handle.write('# value label related\n')
|
|
138
|
-
itol_file_handle.write('SHOW_VALUE_LABELS\t0\n')
|
|
139
|
-
itol_file_handle.write('VALUE_LABEL_SIZE_FACTOR\t0.5\n')
|
|
140
|
-
itol_file_handle.write('VALUE_LABEL_ROTATION\t0\n')
|
|
141
|
-
itol_file_handle.write('VALUE_LABEL_SHIFT\t0\n')
|
|
142
|
-
itol_file_handle.write('\n')
|
|
111
|
+
itol_file_handle.write('DATASET_TIMESCALE\nSEPARATOR TAB\n\n')
|
|
143
112
|
|
|
113
|
+
itol_file_handle.write('# position related\nPOSITION_ABOVE\t0\nVERTICAL_SHIFT\t%s\nAUTO_SCALE\t0\nSCALING_FACTOR\t1\nCOVER_TREE\t0\n\n' % (vertical_shift_value_non_grey))
|
|
114
|
+
itol_file_handle.write('# dataset label related\nDATASET_LABEL\t%s\nSHOW_LABELS\t1\nLABEL_POSITION\tend\nLABEL_SHIFT_X\t30\nLABEL_SHIFT_Y\t0\nSIZE_FACTOR\t2\nLABEL_ROTATION\t0\n\n' % each_rank)
|
|
115
|
+
itol_file_handle.write('# range label related\nSHOW_RANGE_LABELS\t1\nRANGE_LABEL_SIZE\t10\nRANGE_LABEL_ROTATION\t0\nRANGE_LABEL_POSITION\tcenter\nRANGE_LABEL_SHIFT_X\t0\nRANGE_LABEL_SHIFT_Y\t0\nRANGE_LABEL_COLOR\t#000000\n# RANGE_LABEL_AUTO_COLOR\t1\n\n')
|
|
116
|
+
itol_file_handle.write('# border related\nBORDER_WIDTH\t0\nBORDER_COLOR\t#000000\nBORDER_DASHED\t0\n\n')
|
|
117
|
+
itol_file_handle.write('# value label related\nSHOW_VALUE_LABELS\t0\nVALUE_LABEL_SIZE_FACTOR\t0.5\nVALUE_LABEL_ROTATION\t0\nVALUE_LABEL_SHIFT\t0\n\n')
|
|
144
118
|
itol_file_handle.write('\nDATA\n')
|
|
145
|
-
|
|
119
|
+
|
|
120
|
+
itol_file_grey = './iTOL_TimeScale_%s_grey.txt' % each_rank
|
|
121
|
+
itol_file_grey_handle = open(itol_file_grey, 'w')
|
|
122
|
+
itol_file_grey_handle.write('DATASET_TIMESCALE\nSEPARATOR TAB\n\n')
|
|
123
|
+
itol_file_grey_handle.write('# position related\nPOSITION_ABOVE\t0\nVERTICAL_SHIFT\t%s\nAUTO_SCALE\t0\nSCALING_FACTOR\t1\nCOVER_TREE\t1\n\n' % vertical_shift_value_grey)
|
|
124
|
+
itol_file_grey_handle.write('# dataset label related\nDATASET_LABEL\t%s_grey\nSHOW_LABELS\t0\nLABEL_POSITION\tend\nLABEL_SHIFT_X\t30\nLABEL_SHIFT_Y\t0\nSIZE_FACTOR\t2\nLABEL_ROTATION\t0\n\n' % each_rank)
|
|
125
|
+
itol_file_grey_handle.write('# range label related\nSHOW_RANGE_LABELS\t0\nRANGE_LABEL_SIZE\t10\nRANGE_LABEL_ROTATION\t0\nRANGE_LABEL_POSITION\tcenter\nRANGE_LABEL_SHIFT_X\t0\nRANGE_LABEL_SHIFT_Y\t0\nRANGE_LABEL_COLOR\t#000000\n# RANGE_LABEL_AUTO_COLOR\t1\n\n')
|
|
126
|
+
itol_file_grey_handle.write('# border related\nBORDER_WIDTH\t0\nBORDER_COLOR\t#000000\nBORDER_DASHED\t0\n\n')
|
|
127
|
+
itol_file_grey_handle.write('# value label related\nSHOW_VALUE_LABELS\t0\nVALUE_LABEL_SIZE_FACTOR\t0.5\nVALUE_LABEL_ROTATION\t0\nVALUE_LABEL_SHIFT\t0\n\n')
|
|
128
|
+
itol_file_grey_handle.write('\nDATA\n')
|
|
129
|
+
|
|
130
|
+
current_grey = '#D6D3D1' # darker:#D6D3D1 lighter: #F3F2F1
|
|
131
|
+
for each_range in sorted_keys:
|
|
146
132
|
current_range_color = dod[each_rank][each_range][2]
|
|
147
133
|
current_range_l = float(dod[each_rank][each_range][0])
|
|
148
134
|
current_range_r = float(dod[each_rank][each_range][1])
|
|
@@ -174,10 +160,19 @@ def get_timescale_file(chart_ttl, time_range, time_unit, interested_rank):
|
|
|
174
160
|
range_r_to_write = specified_time_range_r
|
|
175
161
|
|
|
176
162
|
if (range_l_to_write != '') and (range_r_to_write != ''):
|
|
163
|
+
|
|
177
164
|
itol_data_str = '%s\t%s\t\t\t%s\t%s\t%s\tnormal' % (range_l_to_write, range_r_to_write, current_range_color, current_range_color, each_range)
|
|
178
165
|
itol_file_handle.write(itol_data_str + '\n')
|
|
179
|
-
itol_file_handle.close()
|
|
180
166
|
|
|
167
|
+
itol_data_str_grey = '%s\t%s\t\t\t%s\t%s\t%s\tnormal' % (range_l_to_write, range_r_to_write, current_grey, current_grey, each_range)
|
|
168
|
+
itol_file_grey_handle.write(itol_data_str_grey + '\n')
|
|
169
|
+
if current_grey == '#D6D3D1':
|
|
170
|
+
current_grey = '#F3F2F1'
|
|
171
|
+
elif current_grey == '#F3F2F1':
|
|
172
|
+
current_grey = '#D6D3D1'
|
|
173
|
+
|
|
174
|
+
itol_file_handle.close()
|
|
175
|
+
itol_file_grey_handle.close()
|
|
181
176
|
|
|
182
177
|
def get_color_list(color_num):
|
|
183
178
|
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from ete3 import Tree
|
|
3
|
+
|
|
4
|
+
def iTOL_Tanglegram():
|
|
5
|
+
|
|
6
|
+
########################################################################################################################
|
|
7
|
+
|
|
8
|
+
# file in
|
|
9
|
+
meta_data_txt = '/Users/songweizhi/Desktop/Sponge_r226/00_metadata/AOA_metadata_20260130.txt'
|
|
10
|
+
tree_file_host = '/Users/songweizhi/Desktop/Sponge_r226/07_Sponge_tree/RefSeqs_with_AOA_18S_iden99_g_representatives_JL_wd/Sponge_phylogeny_Maria_topo_genus_level.tree'
|
|
11
|
+
tree_file_symbiont = '/Users/songweizhi/Desktop/Sponge_r226/08_Host_specificity/codiv_data_test/18_sym.treefile'
|
|
12
|
+
association_table = '/Users/songweizhi/Desktop/Sponge_r226/08_Host_specificity/codiv_data_test/codiv_sponge_to_AOA_all.txt'
|
|
13
|
+
color_code_genome_txt = '/Users/songweizhi/Desktop/Sponge_r226/00_metadata/color_code_symbiont.txt'
|
|
14
|
+
color_code_sponge_txt = ''
|
|
15
|
+
color_link_by_host = True
|
|
16
|
+
color_link_by_symbiont = False
|
|
17
|
+
|
|
18
|
+
# tanglegram tree position
|
|
19
|
+
tree_pan_h = 3000
|
|
20
|
+
tree_pan_v = 1500
|
|
21
|
+
|
|
22
|
+
# tanglegram tree scaling
|
|
23
|
+
tree_scale_h = 1
|
|
24
|
+
tree_scale_v = 7
|
|
25
|
+
|
|
26
|
+
# tanglegram tree label
|
|
27
|
+
show_leaf_label = 1
|
|
28
|
+
leaf_label_size_factor = 6
|
|
29
|
+
leaf_label_shift = 0
|
|
30
|
+
leaf_label_align = 'left'
|
|
31
|
+
|
|
32
|
+
# linkages
|
|
33
|
+
max_link_line_width = 3
|
|
34
|
+
connection_margin_left = 12
|
|
35
|
+
connection_margin_right = 3
|
|
36
|
+
|
|
37
|
+
# file out
|
|
38
|
+
itol_tanglegram_txt = '/Users/songweizhi/Desktop/Sponge_r226/08_Host_specificity/codiv_data_test/iTOL_Tanglegram.txt'
|
|
39
|
+
|
|
40
|
+
########################################################################################################################
|
|
41
|
+
|
|
42
|
+
gnm_tax_dict = dict()
|
|
43
|
+
col_index = dict()
|
|
44
|
+
for each_gnm in open(meta_data_txt):
|
|
45
|
+
each_gnm_split = each_gnm.strip().split('\t')
|
|
46
|
+
if each_gnm.startswith('Genome\t'):
|
|
47
|
+
col_index = {key: i for i, key in enumerate(each_gnm_split)}
|
|
48
|
+
else:
|
|
49
|
+
gnm_id = each_gnm_split[col_index['Genome']]
|
|
50
|
+
gnm_tax = each_gnm_split[col_index['GTDB_Taxon_r226']]
|
|
51
|
+
gnm_g = 'g__'
|
|
52
|
+
for each_r in gnm_tax.split(';'):
|
|
53
|
+
if each_r.startswith('g__'):
|
|
54
|
+
gnm_g = each_r
|
|
55
|
+
gnm_tax_dict[gnm_id] = gnm_g
|
|
56
|
+
|
|
57
|
+
host_color_code_dict = dict()
|
|
58
|
+
if os.path.isfile(color_code_sponge_txt):
|
|
59
|
+
for each_line in open(color_code_sponge_txt):
|
|
60
|
+
each_line_split = each_line.strip().split()
|
|
61
|
+
host_color_code_dict[each_line_split[0]] = each_line_split[1]
|
|
62
|
+
|
|
63
|
+
symbiont_color_code_dict = dict()
|
|
64
|
+
if os.path.isfile(color_code_genome_txt):
|
|
65
|
+
for each_line in open(color_code_genome_txt):
|
|
66
|
+
each_line_split = each_line.strip().split()
|
|
67
|
+
symbiont_color_code_dict[each_line_split[0]] = each_line_split[1]
|
|
68
|
+
|
|
69
|
+
tanglegram_tree_str = ''
|
|
70
|
+
with open(tree_file_host, 'r') as f:
|
|
71
|
+
tanglegram_tree_str = f.readline()
|
|
72
|
+
|
|
73
|
+
itol_tanglegram_txt_handle = open(itol_tanglegram_txt, 'w')
|
|
74
|
+
itol_tanglegram_txt_handle.write('DATASET_TANGLEGRAM\nSEPARATOR TAB\n\n')
|
|
75
|
+
itol_tanglegram_txt_handle.write('DATASET_LABEL\tTanglegram\nCOLOR\t#00ff00\n\n')
|
|
76
|
+
itol_tanglegram_txt_handle.write('TANGLEGRAM_TREE\n%s\nEND_TANGLEGRAM_TREE\n\n' % tanglegram_tree_str)
|
|
77
|
+
itol_tanglegram_txt_handle.write('\n')
|
|
78
|
+
itol_tanglegram_txt_handle.write('# Connection lines\n')
|
|
79
|
+
itol_tanglegram_txt_handle.write('CONNECTION_CURVE\t0\n')
|
|
80
|
+
itol_tanglegram_txt_handle.write('MAXIMUM_LINE_WIDTH\t%s\n' % max_link_line_width)
|
|
81
|
+
itol_tanglegram_txt_handle.write('CONNECTION_MARGIN_LEFT\t%s\nCONNECTION_MARGIN_RIGHT\t%s\n' % (connection_margin_left, connection_margin_right))
|
|
82
|
+
|
|
83
|
+
itol_tanglegram_txt_handle.write('\n')
|
|
84
|
+
itol_tanglegram_txt_handle.write('\n')
|
|
85
|
+
|
|
86
|
+
itol_tanglegram_txt_handle.write('\n')
|
|
87
|
+
itol_tanglegram_txt_handle.write('# Move the tanglegram tree horizontally and/or vertically\n')
|
|
88
|
+
itol_tanglegram_txt_handle.write('TREE_PAN_H\t%s\nTREE_PAN_V\t%s\n' % (tree_pan_h, tree_pan_v))
|
|
89
|
+
itol_tanglegram_txt_handle.write('\n')
|
|
90
|
+
itol_tanglegram_txt_handle.write('# Tanglegram tree scaling factors, horizontal and vertical\n')
|
|
91
|
+
itol_tanglegram_txt_handle.write('TREE_SCALE_H\t%s\nTREE_SCALE_V\t%s\n' % (tree_scale_h, tree_scale_v))
|
|
92
|
+
itol_tanglegram_txt_handle.write('\n')
|
|
93
|
+
itol_tanglegram_txt_handle.write('# Tanglegram tree label\n')
|
|
94
|
+
itol_tanglegram_txt_handle.write('SHOW_LABELS\t%s\nSIZE_FACTOR\t%s\nLABEL_SHIFT\t%s\nLABEL_ALIGN\t%s\n' % (show_leaf_label, leaf_label_size_factor, leaf_label_shift, leaf_label_align))
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
itol_tanglegram_txt_handle.write('\n')
|
|
99
|
+
itol_tanglegram_txt_handle.write('\n')
|
|
100
|
+
itol_tanglegram_txt_handle.write('DATA\n')
|
|
101
|
+
itol_tanglegram_txt_handle.write('#connect\tMAIN_TREE_NODE_ID\tTANGLEGRAM_TREE_NODE_ID\tWIDTH\tCOLOR\tSTYLE\tLABEL\n')
|
|
102
|
+
itol_tanglegram_txt_handle.write('#colorstrip\tCOLUMN_INDEX\tTANGLEGRAM_TREE_NODE_ID\tCOLOR LABEL\n')
|
|
103
|
+
itol_tanglegram_txt_handle.write('#style\tTANGLEGRAM_TREE_NODE_ID\tTYPE\tWHAT\tCOLOR\tWIDTH_OR_SIZE_FACTOR\tSTYLE\tBACKGROUND_COLOR\n')
|
|
104
|
+
itol_tanglegram_txt_handle.write('#symbol\tTANGLEGRAM_TREE_NODE_ID\tSYMBOL\tSIZE\tCOLOR\tFILL\tPOSITION\tLABEL\n')
|
|
105
|
+
itol_tanglegram_txt_handle.write('\n')
|
|
106
|
+
for each_line in open(association_table):
|
|
107
|
+
each_line_split = each_line.strip().split()
|
|
108
|
+
leaf_l = each_line_split[0]
|
|
109
|
+
leaf_r = each_line_split[1]
|
|
110
|
+
color_by_host = host_color_code_dict.get(leaf_l, 'black')
|
|
111
|
+
symbiont_tax = gnm_tax_dict.get(leaf_r, 'g__')
|
|
112
|
+
color_by_symbiont = symbiont_color_code_dict.get(symbiont_tax, 'black')
|
|
113
|
+
|
|
114
|
+
# link color
|
|
115
|
+
link_color_to_use = 'black'
|
|
116
|
+
if color_link_by_symbiont is True:
|
|
117
|
+
link_color_to_use = color_by_symbiont
|
|
118
|
+
elif color_link_by_host is True:
|
|
119
|
+
link_color_to_use = color_by_host
|
|
120
|
+
|
|
121
|
+
itol_tanglegram_txt_handle.write('connect\t%s\t%s\t3\t%s\tnormal\ttest\n' % (leaf_r, leaf_l, link_color_to_use))
|
|
122
|
+
itol_tanglegram_txt_handle.close()
|
|
123
|
+
|
|
124
|
+
iTOL_Tanglegram()
|
|
@@ -44,27 +44,25 @@ def get_node_age_dict(out_txt):
|
|
|
44
44
|
node_mean = each_line_split[1].replace(',', '')
|
|
45
45
|
hpd_ci_95_l = each_line_split[4].replace(',', '')
|
|
46
46
|
hpd_ci_95_r = each_line_split[5].replace(',', '')
|
|
47
|
-
value_str = '%s
|
|
47
|
+
value_str = '%s\t%s-%s' % (node_mean, hpd_ci_95_l, hpd_ci_95_r)
|
|
48
48
|
node_age_dict[node_id] = value_str
|
|
49
49
|
return node_age_dict
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
def mcmctree_out(args):
|
|
53
53
|
|
|
54
|
-
mcmc_out_dir
|
|
55
|
-
interested_nodes_txt
|
|
56
|
-
op_txt
|
|
57
|
-
|
|
58
|
-
_, op_f_path, op_f_base, op_f_ext = sep_path_basename_ext(op_txt)
|
|
59
|
-
op_txt_with_hpd_ci_95 = '%s/%s_HPD_CI_95.%s' % (op_f_path, op_f_base, op_f_ext)
|
|
54
|
+
mcmc_out_dir = args['i']
|
|
55
|
+
interested_nodes_txt = args['n']
|
|
56
|
+
op_txt = args['o']
|
|
60
57
|
|
|
61
58
|
# read in interested_nodes_txt
|
|
62
59
|
interested_node_dict = dict()
|
|
63
60
|
for each_line in open(interested_nodes_txt):
|
|
64
61
|
each_line_split = each_line.strip().split('\t')
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
if len(each_line_split) > 1:
|
|
63
|
+
node_id = each_line_split[0]
|
|
64
|
+
node_desc = each_line_split[1]
|
|
65
|
+
interested_node_dict[node_id] = node_desc
|
|
68
66
|
|
|
69
67
|
node_age_dod = dict()
|
|
70
68
|
if os.path.isfile(mcmc_out_dir) is True:
|
|
@@ -90,20 +88,17 @@ def mcmctree_out(args):
|
|
|
90
88
|
node_list_sorted = sorted(list(interested_node_dict.keys()))
|
|
91
89
|
node_list_sorted_with_desc = [('%s__%s' % (i, interested_node_dict[i])) for i in node_list_sorted]
|
|
92
90
|
|
|
93
|
-
op_txt_handle = open(
|
|
94
|
-
|
|
91
|
+
op_txt_handle = open(op_txt, 'w')
|
|
92
|
+
op_txt_handle.write('Node\tPosterior_mean\tHPD_CI_95\tDescription\n')
|
|
95
93
|
if len(node_age_dod) ==1:
|
|
96
94
|
for each_setting in node_age_dod:
|
|
97
95
|
current_value_dict = node_age_dod[each_setting]
|
|
98
96
|
for each_node_id in node_list_sorted:
|
|
99
97
|
current_node_value = current_value_dict[each_node_id]
|
|
100
|
-
|
|
101
|
-
op_txt_handle.write('%s\t%s\t%s\n' % (each_node_id, current_node_value, interested_node_dict.get(each_node_id, '')))
|
|
102
|
-
op_txt_mean_handle.write('%s\t%s\t%s\n' % (each_node_id, current_node_mean, interested_node_dict.get(each_node_id, '')))
|
|
98
|
+
op_txt_handle.write('%s\t%s\t%s\n' % (each_node_id, current_node_value, interested_node_dict.get(each_node_id, '')))
|
|
103
99
|
|
|
104
100
|
elif len(node_age_dod) >=2:
|
|
105
101
|
op_txt_handle.write('\t' + '\t'.join(node_list_sorted_with_desc) + '\n')
|
|
106
|
-
op_txt_mean_handle.write('\t' + '\t'.join(node_list_sorted_with_desc) + '\n')
|
|
107
102
|
for each_setting in node_age_dod:
|
|
108
103
|
current_value_dict = node_age_dod[each_setting]
|
|
109
104
|
current_value_list = [each_setting]
|
|
@@ -114,9 +109,7 @@ def mcmctree_out(args):
|
|
|
114
109
|
current_value_list.append(current_node_value)
|
|
115
110
|
current_mean_list.append(current_node_mean)
|
|
116
111
|
op_txt_handle.write('\t'.join(current_value_list) + '\n')
|
|
117
|
-
op_txt_mean_handle.write('\t'.join(current_mean_list) + '\n')
|
|
118
112
|
op_txt_handle.close()
|
|
119
|
-
op_txt_mean_handle.close()
|
|
120
113
|
|
|
121
114
|
|
|
122
115
|
if __name__ == '__main__':
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: treesak
|
|
3
|
-
Version: 1.58.
|
|
3
|
+
Version: 1.58.2
|
|
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.2
|
|
@@ -59,7 +59,6 @@ TreeSAK/SplitScore.py
|
|
|
59
59
|
TreeSAK/SplitScore1.py
|
|
60
60
|
TreeSAK/SplitScore1OMA.py
|
|
61
61
|
TreeSAK/SplitScore2.py
|
|
62
|
-
TreeSAK/Tanglegram.py
|
|
63
62
|
TreeSAK/TaxaCountStats.R
|
|
64
63
|
TreeSAK/TaxonTree.py
|
|
65
64
|
TreeSAK/TimeScale.py
|
|
@@ -95,6 +94,7 @@ TreeSAK/global_functions.py
|
|
|
95
94
|
TreeSAK/gnm_leaves.py
|
|
96
95
|
TreeSAK/guide_tree.py
|
|
97
96
|
TreeSAK/iTOL.py
|
|
97
|
+
TreeSAK/iTOL_Tanglegram.py
|
|
98
98
|
TreeSAK/iTOL_gene_tree.py
|
|
99
99
|
TreeSAK/itol_msa_stats.py
|
|
100
100
|
TreeSAK/keep_highest_rrtc.py
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
|
|
3
|
-
from ete3 import Tree
|
|
4
|
-
|
|
5
|
-
########################################################################################################################
|
|
6
|
-
|
|
7
|
-
# file in
|
|
8
|
-
meta_data_txt = '/Users/songweizhi/Desktop/Sponge_r226/00_metadata/AOA_metadata_20260130.txt'
|
|
9
|
-
tree_file_host = '/Users/songweizhi/Desktop/Sponge_r226/08_Host_specificity/codiv_data_test/51_host.treefile'
|
|
10
|
-
tree_file_symbiont = '/Users/songweizhi/Desktop/Sponge_r226/08_Host_specificity/codiv_data_test/18_sym.treefile'
|
|
11
|
-
association_table = '/Users/songweizhi/Desktop/Sponge_r226/08_Host_specificity/codiv_data_test/codiv_sponge_to_AOA_all.txt'
|
|
12
|
-
color_code_genome_txt = '/Users/songweizhi/Desktop/Sponge_r226/00_metadata/color_code_symbiont.txt'
|
|
13
|
-
color_code_sponge_txt = ''
|
|
14
|
-
color_link_by_symbiont = True
|
|
15
|
-
|
|
16
|
-
# file out
|
|
17
|
-
itol_tanglegram_txt = '/Users/songweizhi/Desktop/Sponge_r226/08_Host_specificity/codiv_data_test/iTOL_Tanglegram.txt'
|
|
18
|
-
|
|
19
|
-
########################################################################################################################
|
|
20
|
-
|
|
21
|
-
current_file_path = '/'.join(os.path.realpath(__file__).split('/')[:-1])
|
|
22
|
-
cophyloplot_Rscript = '%s/cophyloplot.R' % current_file_path
|
|
23
|
-
|
|
24
|
-
gnm_tax_dict = dict()
|
|
25
|
-
col_index = dict()
|
|
26
|
-
for each_gnm in open(meta_data_txt):
|
|
27
|
-
each_gnm_split = each_gnm.strip().split('\t')
|
|
28
|
-
if each_gnm.startswith('Genome\t'):
|
|
29
|
-
col_index = {key: i for i, key in enumerate(each_gnm_split)}
|
|
30
|
-
else:
|
|
31
|
-
gnm_id = each_gnm_split[col_index['Genome']]
|
|
32
|
-
gnm_tax = each_gnm_split[col_index['GTDB_Taxon_r226']]
|
|
33
|
-
gnm_g = 'g__'
|
|
34
|
-
for each_r in gnm_tax.split(';'):
|
|
35
|
-
if each_r.startswith('g__'):
|
|
36
|
-
gnm_g = each_r
|
|
37
|
-
gnm_tax_dict[gnm_id] = gnm_g
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
host_color_code_dict = dict()
|
|
42
|
-
if os.path.isfile(color_code_sponge_txt):
|
|
43
|
-
for each_line in open(color_code_sponge_txt):
|
|
44
|
-
each_line_split = each_line.strip().split()
|
|
45
|
-
host_color_code_dict[each_line_split[0]] = each_line_split[1]
|
|
46
|
-
|
|
47
|
-
symbiont_color_code_dict = dict()
|
|
48
|
-
if os.path.isfile(color_code_genome_txt):
|
|
49
|
-
for each_line in open(color_code_genome_txt):
|
|
50
|
-
each_line_split = each_line.strip().split()
|
|
51
|
-
symbiont_color_code_dict[each_line_split[0]] = each_line_split[1]
|
|
52
|
-
|
|
53
|
-
tanglegram_tree_str = ''
|
|
54
|
-
with open(tree_file_host, 'r') as f:
|
|
55
|
-
tanglegram_tree_str = f.readline()
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
itol_tanglegram_txt_handle = open(itol_tanglegram_txt, 'w')
|
|
59
|
-
itol_tanglegram_txt_handle.write('DATASET_TANGLEGRAM\nSEPARATOR TAB\n\n')
|
|
60
|
-
itol_tanglegram_txt_handle.write('DATASET_LABEL\tTanglegram\nCOLOR\t#00ff00\n\n')
|
|
61
|
-
itol_tanglegram_txt_handle.write('TANGLEGRAM_TREE\n%s\nEND_TANGLEGRAM_TREE\n\n' % tanglegram_tree_str)
|
|
62
|
-
itol_tanglegram_txt_handle.write('\n')
|
|
63
|
-
itol_tanglegram_txt_handle.write('#connection lines\n')
|
|
64
|
-
itol_tanglegram_txt_handle.write('CONNECTION_CURVE\t0\n')
|
|
65
|
-
itol_tanglegram_txt_handle.write('\n')
|
|
66
|
-
itol_tanglegram_txt_handle.write('\n')
|
|
67
|
-
itol_tanglegram_txt_handle.write('DATA\n')
|
|
68
|
-
itol_tanglegram_txt_handle.write('#connect\tMAIN_TREE_NODE_ID\tTANGLEGRAM_TREE_NODE_ID\tWIDTH\tCOLOR\tSTYLE\tLABEL\n')
|
|
69
|
-
itol_tanglegram_txt_handle.write('#colorstrip\tCOLUMN_INDEX\tTANGLEGRAM_TREE_NODE_ID\tCOLOR LABEL\n')
|
|
70
|
-
itol_tanglegram_txt_handle.write('#style\tTANGLEGRAM_TREE_NODE_ID\tTYPE\tWHAT\tCOLOR\tWIDTH_OR_SIZE_FACTOR\tSTYLE\tBACKGROUND_COLOR\n')
|
|
71
|
-
itol_tanglegram_txt_handle.write('#symbol\tTANGLEGRAM_TREE_NODE_ID\tSYMBOL\tSIZE\tCOLOR\tFILL\tPOSITION\tLABEL\n')
|
|
72
|
-
itol_tanglegram_txt_handle.write('\n')
|
|
73
|
-
for each_line in open(association_table):
|
|
74
|
-
each_line_split = each_line.strip().split()
|
|
75
|
-
leaf_l = each_line_split[0]
|
|
76
|
-
leaf_r = each_line_split[1]
|
|
77
|
-
color_by_host = host_color_code_dict.get(leaf_l, 'black')
|
|
78
|
-
symbiont_tax = gnm_tax_dict.get(leaf_r, 'g__')
|
|
79
|
-
color_by_symbiont = symbiont_color_code_dict.get(symbiont_tax, 'black')
|
|
80
|
-
color_to_use = color_by_host
|
|
81
|
-
if color_link_by_symbiont is True:
|
|
82
|
-
color_to_use = color_by_symbiont
|
|
83
|
-
itol_tanglegram_txt_handle.write('connect\t%s\t%s\t3\t%s\tnormal\ttest\n' % (leaf_r, leaf_l, color_to_use))
|
|
84
|
-
itol_tanglegram_txt_handle.close()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|