TreeSAK 1.58.1__tar.gz → 1.58.3__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.1/treesak.egg-info → treesak-1.58.3}/PKG-INFO +2 -2
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/VERSION +1 -1
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/gap_stats.py +3 -3
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/iTOL.py +45 -50
- {treesak-1.58.1 → treesak-1.58.3}/bin/TreeSAK +1 -1
- {treesak-1.58.1 → treesak-1.58.3/treesak.egg-info}/PKG-INFO +2 -2
- {treesak-1.58.1 → treesak-1.58.3}/treesak.egg-info/SOURCES.txt +0 -1
- treesak-1.58.1/TreeSAK/TimeScale.py +0 -141
- {treesak-1.58.1 → treesak-1.58.3}/LICENSE +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/MANIFEST.in +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/README.md +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ALE.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ALE1.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ALE2.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ALE2RTC.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ALE3.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ALE4.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ALE5.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ALE6.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ALE7.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ALE_backup.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/AssessCVG.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/AssessMarker.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/AssessMarkerDeltaLL.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/AssessMarkerPA.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/BMGE.jar +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/BMGE.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/C60SR4.nex +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/CompareMCMC.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ConcateMSA.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ConvertMSA.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/Dir.rb +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ExtractMarkerSeq.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/FastRoot.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/FastRoot_backup.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/FigTree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/GTDB_tree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/GeneTree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/KEGG_Luo17.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/LcaToLeaves.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/MarkerRef2Tree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/MarkerRef2Tree_backup.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/MarkerSeq2Tree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/MarkerSeq2Tree_backup.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ModifyTopo.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/Newick_tree_plotter.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/OMA.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/OMA2.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/OneLineAln.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/PB.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/PMSF.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/PhyloBiAssoc.R +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/PhyloBiAssoc.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/PlotMCMC.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/PlotMcmcNode.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/PlotMcmcNode_old.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/RootTree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/RootTreeGTDB.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/RootTreeGTDB214.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/RootTreeGTDB220.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/SequentialDating.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/SingleAleHGT.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/SingleLinePhy.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/SliceMSA.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/SplitScore.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/SplitScore1.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/SplitScore1OMA.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/SplitScore2.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/TaxaCountStats.R +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/TaxonTree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/TreeSAK_config.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/VisHPD95.R +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/VisHPD95.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/__init__.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ale_parser.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/ale_splitter.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/alignment_pruner.pl +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/assessOG.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/assessPB.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/batch_itol.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/catfasta2phy.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/cogTree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/compare_trees.R +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/compare_trees.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/cophyloplot.R +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/cophyloplot.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/dating.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/dating_ss.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/deltall.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/do_rrtc.rb +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/fa2phy.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/filter_rename_ar53.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/format_leaf_name.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/get_SCG_tree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/get_arCOG_seq.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/get_lca_id.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/global_functions.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/gnm_leaves.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/guide_tree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/iTOL_Tanglegram.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/iTOL_gene_tree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/itol_msa_stats.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/keep_highest_rrtc.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/koTree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/label_gene_tree_by_gnm.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/label_tree.R +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/label_tree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/mad.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/mcmc2tree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/mcmcTC copy.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/mcmcTC.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/mcmctree_out.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/mcmctree_vs_reltime.R +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/mcmctree_vs_reltime.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/merge_pdf.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/pRTC.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/parse_mcmctree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/parse_reltime.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/phy2fa.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/plot_distruibution_th.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/prep_mcmctree_ctl.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/print_leaves.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/pruneMSA.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/recode.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/remove_bias.R +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/rename_leaves.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/replace_clade.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/rm_leaf.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/root_with_out_group.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/run_TaxaCountStats_R_s1.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/subsample_drep_gnms.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/subset.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/subset_tree_stupid_old_way.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/supertree.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/tmp_1.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/tmp_2.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/tmp_3.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/tmp_4.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/tree_fmt.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/TreeSAK/weighted_rand.rb +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/setup.cfg +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/setup.py +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/treesak.egg-info/dependency_links.txt +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/treesak.egg-info/requires.txt +0 -0
- {treesak-1.58.1 → treesak-1.58.3}/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.3
|
|
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.3
|
|
@@ -5,7 +5,7 @@ from Bio import SeqIO
|
|
|
5
5
|
gap_stats_usage = '''
|
|
6
6
|
================================== gap_stats example commands ==================================
|
|
7
7
|
|
|
8
|
-
TreeSAK gap_stats -i msa.fasta -c 40 -
|
|
8
|
+
TreeSAK gap_stats -i msa.fasta -c 40 -o stats.txt -o2 msa_maxgap40.fasta -o3 MSA_gap_iTOL.txt
|
|
9
9
|
|
|
10
10
|
================================================================================================
|
|
11
11
|
'''
|
|
@@ -15,7 +15,7 @@ def gap_stats(args):
|
|
|
15
15
|
|
|
16
16
|
msa_in_fa = args['i']
|
|
17
17
|
gap_cutoff = args['c']
|
|
18
|
-
op_stats_txt = args['
|
|
18
|
+
op_stats_txt = args['o']
|
|
19
19
|
op_msa_file = args['o2']
|
|
20
20
|
op_itol_file = args['o3']
|
|
21
21
|
|
|
@@ -69,7 +69,7 @@ if __name__ == '__main__':
|
|
|
69
69
|
gap_stats_parser = argparse.ArgumentParser()
|
|
70
70
|
gap_stats_parser.add_argument('-i', required=True, help='MSA in fasta format')
|
|
71
71
|
gap_stats_parser.add_argument('-c', required=False, default=100, type=float, help='maximum gap allowed in MSAs, default is 100, i.e., no filtering')
|
|
72
|
-
gap_stats_parser.add_argument('-
|
|
72
|
+
gap_stats_parser.add_argument('-o', required=True, help='output stats file')
|
|
73
73
|
gap_stats_parser.add_argument('-o2', required=False, default=None, help='filtered MSA')
|
|
74
74
|
gap_stats_parser.add_argument('-o3', required=False, default=None, help='iTOL file')
|
|
75
75
|
args = vars(gap_stats_parser.parse_args())
|
|
@@ -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
|
-
itol_file = './iTOL_TimeScale_%s.txt' % each_rank
|
|
96
|
-
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')
|
|
143
95
|
|
|
96
|
+
itol_file = './iTOL_TimeScale_%s%s_%s.txt' % (time_range, time_unit, each_rank)
|
|
97
|
+
itol_file_grey = './iTOL_TimeScale_%s%s_%s_grey.txt' % (time_range, time_unit, each_rank)
|
|
98
|
+
|
|
99
|
+
current_rank_dict = dod[each_rank]
|
|
100
|
+
items = current_rank_dict.items()
|
|
101
|
+
sorted_items = sorted(items, key=lambda item: item[1][0])
|
|
102
|
+
sorted_keys = [item[0] for item in sorted_items]
|
|
103
|
+
|
|
104
|
+
vertical_shift_index = interested_rank_list.index(each_rank)
|
|
105
|
+
if vertical_shift_index == 0:
|
|
106
|
+
vertical_shift_value_grey = ((2 * vertical_shift_index) * 50) -50
|
|
107
|
+
vertical_shift_value_non_grey = ((2 * vertical_shift_index + 1) * 50) -50
|
|
108
|
+
else:
|
|
109
|
+
vertical_shift_value_grey = vertical_shift_index * 50
|
|
110
|
+
vertical_shift_value_non_grey = vertical_shift_value_grey
|
|
111
|
+
|
|
112
|
+
itol_file_handle = open(itol_file, 'w')
|
|
113
|
+
itol_file_handle.write('DATASET_TIMESCALE\nSEPARATOR TAB\n\n')
|
|
114
|
+
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))
|
|
115
|
+
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)
|
|
116
|
+
itol_file_handle.write('# range label related\nSHOW_RANGE_LABELS\t1\nRANGE_LABEL_SIZE\t2\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')
|
|
117
|
+
itol_file_handle.write('# border related\nBORDER_WIDTH\t0\nBORDER_COLOR\t#000000\nBORDER_DASHED\t0\n\n')
|
|
118
|
+
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
119
|
itol_file_handle.write('\nDATA\n')
|
|
145
|
-
|
|
120
|
+
|
|
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\t2\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
|
|
|
@@ -753,7 +753,7 @@ if __name__ == '__main__':
|
|
|
753
753
|
gap_stats_parser = subparsers.add_parser('gap_stats', usage=gap_stats.gap_stats_usage)
|
|
754
754
|
gap_stats_parser.add_argument('-i', required=True, help='MSA in fasta format')
|
|
755
755
|
gap_stats_parser.add_argument('-c', required=False, default=100, type=float, help='maximum gap allowed in MSAs, default is 100, i.e., no filtering')
|
|
756
|
-
gap_stats_parser.add_argument('-
|
|
756
|
+
gap_stats_parser.add_argument('-o', required=True, help='output stats file')
|
|
757
757
|
gap_stats_parser.add_argument('-o2', required=False, default=None, help='filtered MSA')
|
|
758
758
|
gap_stats_parser.add_argument('-o3', required=False, default=None, help='iTOL file')
|
|
759
759
|
args = vars(parser.parse_args())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: treesak
|
|
3
|
-
Version: 1.58.
|
|
3
|
+
Version: 1.58.3
|
|
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.3
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
def get_timescale_file(args):
|
|
3
|
-
|
|
4
|
-
# https://github.com/i-c-stratigraphy/chart/blob/main/chart.ttl
|
|
5
|
-
|
|
6
|
-
chart_ttl = args['i']
|
|
7
|
-
time_range = args['rg']
|
|
8
|
-
time_unit = args['u']
|
|
9
|
-
interested_rank = args['rk']
|
|
10
|
-
op_dir = '.'
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
chart_ttl = '/Users/songweizhi/Desktop/chart.ttl'
|
|
15
|
-
time_range = '3.5-0'
|
|
16
|
-
time_unit = 'Ga' # choose from Ma and Ga
|
|
17
|
-
interested_rank = 'Era,Eon' # choose from Super-Eon, Eon, Era, Period, Sub-Period, Epoch and Age
|
|
18
|
-
op_dir = '/Users/songweizhi/Desktop'
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
time_range_split = time_range.split('-')
|
|
23
|
-
specified_time_range_l = float(time_range_split[0])
|
|
24
|
-
specified_time_range_r = float(time_range_split[1])
|
|
25
|
-
|
|
26
|
-
dod = dict()
|
|
27
|
-
current_ns2_id = ''
|
|
28
|
-
current_ns1_rank = ''
|
|
29
|
-
current_range_start = ''
|
|
30
|
-
current_range_end = ''
|
|
31
|
-
current_color = ''
|
|
32
|
-
for each_line in open(chart_ttl):
|
|
33
|
-
if each_line.startswith('ns2:'):
|
|
34
|
-
current_ns2_id = each_line.strip()[len('ns2:'):]
|
|
35
|
-
if each_line.startswith(' ns1:rank '):
|
|
36
|
-
current_ns1_rank = each_line.strip().split('/rank/')[1].split('>')[0]
|
|
37
|
-
if each_line.startswith(' skos:definition "A time period from '):
|
|
38
|
-
if 'million years ago to the present"' in each_line:
|
|
39
|
-
current_range_start = each_line.split('A time period from ')[-1].split()[0]
|
|
40
|
-
current_range_end = '0'
|
|
41
|
-
else:
|
|
42
|
-
current_range_start = each_line.split(' to ')[0].split()[-1]
|
|
43
|
-
current_range_end = each_line.split(' to ')[1].split()[0]
|
|
44
|
-
if each_line.startswith(' schema:color "'):
|
|
45
|
-
current_color = each_line.strip().split('"')[1]
|
|
46
|
-
if current_ns1_rank not in dod:
|
|
47
|
-
dod[current_ns1_rank] = dict()
|
|
48
|
-
if current_ns2_id not in dod[current_ns1_rank]:
|
|
49
|
-
dod[current_ns1_rank][current_ns2_id] = dict()
|
|
50
|
-
dod[current_ns1_rank][current_ns2_id] = [float(current_range_start), float(current_range_end), current_color]
|
|
51
|
-
|
|
52
|
-
interested_rank_list = interested_rank.split(',')
|
|
53
|
-
for each_rank in dod:
|
|
54
|
-
|
|
55
|
-
if each_rank in interested_rank_list:
|
|
56
|
-
itol_file = '%s/iTOL_TimeScale_%s.txt' % (op_dir, each_rank)
|
|
57
|
-
itol_file_handle = open(itol_file, 'w')
|
|
58
|
-
itol_file_handle.write('DATASET_TIMESCALE\nSEPARATOR TAB\n')
|
|
59
|
-
itol_file_handle.write('\n')
|
|
60
|
-
|
|
61
|
-
itol_file_handle.write('# position related\n')
|
|
62
|
-
itol_file_handle.write('POSITION_ABOVE\t0\n')
|
|
63
|
-
vertical_shift_index = interested_rank_list.index(each_rank) + 1
|
|
64
|
-
vertical_shift_value = vertical_shift_index * 50
|
|
65
|
-
itol_file_handle.write('VERTICAL_SHIFT\t%s\n' % vertical_shift_value)
|
|
66
|
-
itol_file_handle.write('AUTO_SCALE\t0\n')
|
|
67
|
-
itol_file_handle.write('SCALING_FACTOR\t1\n')
|
|
68
|
-
itol_file_handle.write('COVER_TREE\t0\n')
|
|
69
|
-
itol_file_handle.write('\n')
|
|
70
|
-
|
|
71
|
-
itol_file_handle.write('# dataset label related\n')
|
|
72
|
-
itol_file_handle.write('DATASET_LABEL\t%s\n' % each_rank)
|
|
73
|
-
itol_file_handle.write('SHOW_LABELS\t1\n')
|
|
74
|
-
itol_file_handle.write('LABEL_POSITION\tend\n')
|
|
75
|
-
itol_file_handle.write('LABEL_SHIFT_X\t30\n')
|
|
76
|
-
itol_file_handle.write('LABEL_SHIFT_Y\t0\n')
|
|
77
|
-
itol_file_handle.write('SIZE_FACTOR\t2\n')
|
|
78
|
-
itol_file_handle.write('LABEL_ROTATION\t0\n')
|
|
79
|
-
itol_file_handle.write('\n')
|
|
80
|
-
|
|
81
|
-
itol_file_handle.write('# range label related\n')
|
|
82
|
-
itol_file_handle.write('SHOW_RANGE_LABELS\t1\n')
|
|
83
|
-
itol_file_handle.write('RANGE_LABEL_SIZE\t10\n')
|
|
84
|
-
itol_file_handle.write('RANGE_LABEL_ROTATION\t0\n')
|
|
85
|
-
itol_file_handle.write('RANGE_LABEL_POSITION\tcenter\n')
|
|
86
|
-
itol_file_handle.write('RANGE_LABEL_SHIFT_X\t0\n')
|
|
87
|
-
itol_file_handle.write('RANGE_LABEL_SHIFT_Y\t0\n')
|
|
88
|
-
itol_file_handle.write('RANGE_LABEL_COLOR\t#000000\n')
|
|
89
|
-
itol_file_handle.write('# RANGE_LABEL_AUTO_COLOR\t1\n')
|
|
90
|
-
itol_file_handle.write('\n')
|
|
91
|
-
|
|
92
|
-
itol_file_handle.write('# border related\n')
|
|
93
|
-
itol_file_handle.write('BORDER_WIDTH\t0\n')
|
|
94
|
-
itol_file_handle.write('BORDER_COLOR\t#000000\n')
|
|
95
|
-
itol_file_handle.write('BORDER_DASHED\t0\n')
|
|
96
|
-
itol_file_handle.write('\n')
|
|
97
|
-
|
|
98
|
-
itol_file_handle.write('# value label related\n')
|
|
99
|
-
itol_file_handle.write('SHOW_VALUE_LABELS\t0\n')
|
|
100
|
-
itol_file_handle.write('VALUE_LABEL_SIZE_FACTOR\t0.5\n')
|
|
101
|
-
itol_file_handle.write('VALUE_LABEL_ROTATION\t0\n')
|
|
102
|
-
itol_file_handle.write('VALUE_LABEL_SHIFT\t0\n')
|
|
103
|
-
itol_file_handle.write('\n')
|
|
104
|
-
|
|
105
|
-
itol_file_handle.write('\nDATA\n')
|
|
106
|
-
for each_range in dod[each_rank]:
|
|
107
|
-
current_range_color = dod[each_rank][each_range][2]
|
|
108
|
-
current_range_l = float(dod[each_rank][each_range][0])
|
|
109
|
-
current_range_r = float(dod[each_rank][each_range][1])
|
|
110
|
-
if current_range_l < current_range_r:
|
|
111
|
-
current_range_l = float(dod[each_rank][each_range][1])
|
|
112
|
-
current_range_r = float(dod[each_rank][each_range][0])
|
|
113
|
-
|
|
114
|
-
if time_unit == 'Ga':
|
|
115
|
-
current_range_l = current_range_l/1000
|
|
116
|
-
current_range_r = current_range_r/1000
|
|
117
|
-
|
|
118
|
-
range_l_to_write = ''
|
|
119
|
-
range_r_to_write = ''
|
|
120
|
-
if (current_range_l <= specified_time_range_l) and (current_range_r >= specified_time_range_r):
|
|
121
|
-
range_l_to_write = current_range_l
|
|
122
|
-
range_r_to_write = current_range_r
|
|
123
|
-
elif (specified_time_range_l >= current_range_l >= specified_time_range_r) and (current_range_r <= specified_time_range_r):
|
|
124
|
-
range_l_to_write = current_range_l
|
|
125
|
-
range_r_to_write = specified_time_range_r
|
|
126
|
-
elif (current_range_l >= specified_time_range_l) and (specified_time_range_l >= current_range_r >= specified_time_range_r):
|
|
127
|
-
range_l_to_write = specified_time_range_l
|
|
128
|
-
range_r_to_write = current_range_r
|
|
129
|
-
elif (current_range_l <= specified_time_range_r):
|
|
130
|
-
pass
|
|
131
|
-
elif (current_range_r >= specified_time_range_l):
|
|
132
|
-
pass
|
|
133
|
-
elif (current_range_l >= specified_time_range_l) and (current_range_r<= specified_time_range_r):
|
|
134
|
-
range_l_to_write = specified_time_range_l
|
|
135
|
-
range_r_to_write = specified_time_range_r
|
|
136
|
-
|
|
137
|
-
if (range_l_to_write != '') and (range_r_to_write != ''):
|
|
138
|
-
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)
|
|
139
|
-
itol_file_handle.write(itol_data_str + '\n')
|
|
140
|
-
itol_file_handle.close()
|
|
141
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|