treesak 1.53.3__py3-none-any.whl
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/ALE.py +63 -0
- TreeSAK/ALE1.py +268 -0
- TreeSAK/ALE2.py +168 -0
- TreeSAK/ALE2RTC.py +30 -0
- TreeSAK/ALE3.py +205 -0
- TreeSAK/ALE4.py +636 -0
- TreeSAK/ALE5.py +210 -0
- TreeSAK/ALE6.py +401 -0
- TreeSAK/ALE7.py +126 -0
- TreeSAK/ALE_backup.py +1081 -0
- TreeSAK/AssessCVG.py +128 -0
- TreeSAK/AssessMarker.py +306 -0
- TreeSAK/AssessMarkerDeltaLL.py +257 -0
- TreeSAK/AssessMarkerPA.py +317 -0
- TreeSAK/AssessPB.py +113 -0
- TreeSAK/BMGE.jar +0 -0
- TreeSAK/BMGE.py +49 -0
- TreeSAK/C60SR4.nex +127 -0
- TreeSAK/CompareMCMC.py +138 -0
- TreeSAK/ConcateMSA.py +111 -0
- TreeSAK/ConvertMSA.py +135 -0
- TreeSAK/Dir.rb +82 -0
- TreeSAK/ExtractMarkerSeq.py +263 -0
- TreeSAK/FastRoot.py +1175 -0
- TreeSAK/FastRoot_backup.py +1122 -0
- TreeSAK/FigTree.py +34 -0
- TreeSAK/GTDB_tree.py +76 -0
- TreeSAK/GeneTree.py +142 -0
- TreeSAK/KEGG_Luo17.py +807 -0
- TreeSAK/LcaToLeaves.py +66 -0
- TreeSAK/MarkerRef2Tree.py +616 -0
- TreeSAK/MarkerRef2Tree_backup.py +628 -0
- TreeSAK/MarkerSeq2Tree.py +299 -0
- TreeSAK/MarkerSeq2Tree_backup.py +259 -0
- TreeSAK/ModifyTopo.py +116 -0
- TreeSAK/Newick_tree_plotter.py +79 -0
- TreeSAK/OMA.py +170 -0
- TreeSAK/OMA2.py +212 -0
- TreeSAK/OneLineAln.py +50 -0
- TreeSAK/PB.py +155 -0
- TreeSAK/PMSF.py +115 -0
- TreeSAK/PhyloBiAssoc.R +84 -0
- TreeSAK/PhyloBiAssoc.py +167 -0
- TreeSAK/PlotMCMC.py +41 -0
- TreeSAK/PlotMcmcNode.py +152 -0
- TreeSAK/PlotMcmcNode_old.py +252 -0
- TreeSAK/RootTree.py +101 -0
- TreeSAK/RootTreeGTDB.py +371 -0
- TreeSAK/RootTreeGTDB214.py +288 -0
- TreeSAK/RootTreeGTDB220.py +300 -0
- TreeSAK/SequentialDating.py +16 -0
- TreeSAK/SingleAleHGT.py +157 -0
- TreeSAK/SingleLinePhy.py +50 -0
- TreeSAK/SliceMSA.py +142 -0
- TreeSAK/SplitScore.py +21 -0
- TreeSAK/SplitScore1.py +177 -0
- TreeSAK/SplitScore1OMA.py +148 -0
- TreeSAK/SplitScore2.py +608 -0
- TreeSAK/TaxaCountStats.R +256 -0
- TreeSAK/TaxonTree.py +47 -0
- TreeSAK/TreeSAK_config.py +32 -0
- TreeSAK/VERSION +164 -0
- TreeSAK/VisHPD95.R +45 -0
- TreeSAK/VisHPD95.py +200 -0
- TreeSAK/__init__.py +0 -0
- TreeSAK/ale_parser.py +74 -0
- TreeSAK/ale_splitter.py +63 -0
- TreeSAK/alignment_pruner.pl +1471 -0
- TreeSAK/assessOG.py +45 -0
- TreeSAK/batch_itol.py +171 -0
- TreeSAK/catfasta2phy.py +140 -0
- TreeSAK/cogTree.py +185 -0
- TreeSAK/compare_trees.R +30 -0
- TreeSAK/compare_trees.py +255 -0
- TreeSAK/dating.py +264 -0
- TreeSAK/dating_ss.py +361 -0
- TreeSAK/deltall.py +82 -0
- TreeSAK/do_rrtc.rb +464 -0
- TreeSAK/fa2phy.py +42 -0
- TreeSAK/filter_rename_ar53.py +118 -0
- TreeSAK/format_leaf_name.py +70 -0
- TreeSAK/gap_stats.py +38 -0
- TreeSAK/get_SCG_tree.py +742 -0
- TreeSAK/get_arCOG_seq.py +97 -0
- TreeSAK/global_functions.py +222 -0
- TreeSAK/gnm_leaves.py +43 -0
- TreeSAK/iTOL.py +791 -0
- TreeSAK/iTOL_gene_tree.py +80 -0
- TreeSAK/itol_msa_stats.py +56 -0
- TreeSAK/keep_highest_rrtc.py +37 -0
- TreeSAK/koTree.py +194 -0
- TreeSAK/label_gene_tree_by_gnm.py +34 -0
- TreeSAK/label_tree.R +75 -0
- TreeSAK/label_tree.py +121 -0
- TreeSAK/mad.py +708 -0
- TreeSAK/mcmc2tree.py +58 -0
- TreeSAK/mcmcTC copy.py +92 -0
- TreeSAK/mcmcTC.py +104 -0
- TreeSAK/mcmctree_vs_reltime.R +44 -0
- TreeSAK/mcmctree_vs_reltime.py +252 -0
- TreeSAK/merge_pdf.py +32 -0
- TreeSAK/pRTC.py +56 -0
- TreeSAK/parse_mcmctree.py +198 -0
- TreeSAK/parse_reltime.py +141 -0
- TreeSAK/phy2fa.py +37 -0
- TreeSAK/plot_distruibution_th.py +165 -0
- TreeSAK/prep_mcmctree_ctl.py +92 -0
- TreeSAK/print_leaves.py +32 -0
- TreeSAK/pruneMSA.py +63 -0
- TreeSAK/recode.py +73 -0
- TreeSAK/remove_bias.R +112 -0
- TreeSAK/rename_leaves.py +78 -0
- TreeSAK/replace_clade.py +55 -0
- TreeSAK/root_with_out_group.py +84 -0
- TreeSAK/run_TaxaCountStats_R_s1.py +455 -0
- TreeSAK/subsample_drep_gnms.py +74 -0
- TreeSAK/subset.py +69 -0
- TreeSAK/subset_tree_stupid_old_way.py +193 -0
- TreeSAK/supertree.py +330 -0
- TreeSAK/tmp_1.py +19 -0
- TreeSAK/tmp_2.py +19 -0
- TreeSAK/tmp_3.py +120 -0
- TreeSAK/tmp_4.py +43 -0
- TreeSAK/tmp_5.py +12 -0
- TreeSAK/weighted_rand.rb +23 -0
- treesak-1.53.3.data/scripts/TreeSAK +955 -0
- treesak-1.53.3.dist-info/LICENSE +674 -0
- treesak-1.53.3.dist-info/METADATA +27 -0
- treesak-1.53.3.dist-info/RECORD +131 -0
- treesak-1.53.3.dist-info/WHEEL +5 -0
- treesak-1.53.3.dist-info/top_level.txt +1 -0
TreeSAK/tmp_4.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import glob
|
|
3
|
+
from Bio import SeqIO
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def sep_path_basename_ext(file_in):
|
|
7
|
+
|
|
8
|
+
f_path, f_name = os.path.split(file_in)
|
|
9
|
+
if f_path == '':
|
|
10
|
+
f_path = '.'
|
|
11
|
+
f_base, f_ext = os.path.splitext(f_name)
|
|
12
|
+
f_ext = f_ext[1:]
|
|
13
|
+
|
|
14
|
+
return f_name, f_path, f_base, f_ext
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
file_dir = '/Users/songweizhi/Desktop/999/03_AOA_genomes_1369_dRep85_263_GTDB_SCG_best50'
|
|
18
|
+
file_ext = 'fa'
|
|
19
|
+
gnm_txt = '/Users/songweizhi/Desktop/999/03_AOA_genomes_1369_dRep85_255.txt'
|
|
20
|
+
op_dir = '/Users/songweizhi/Desktop/999/03_AOA_genomes_1369_dRep85_255_GTDB_SCG_best50'
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
gnm_set = set()
|
|
24
|
+
for each in open(gnm_txt):
|
|
25
|
+
gnm_set.add(each.strip())
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
file_re = '%s/*.%s' % (file_dir, file_ext)
|
|
29
|
+
file_list = glob.glob(file_re)
|
|
30
|
+
|
|
31
|
+
for each in file_list:
|
|
32
|
+
f_name, f_path, f_base, f_ext = sep_path_basename_ext(each)
|
|
33
|
+
op_fa = '%s/%s' % (op_dir, f_name)
|
|
34
|
+
op_fa_handle = open(op_fa, 'w')
|
|
35
|
+
for each_seq in SeqIO.parse(each, 'fasta'):
|
|
36
|
+
seq_id = each_seq.id
|
|
37
|
+
gnm_id = '_'.join(each_seq.id.split('_')[:-1])
|
|
38
|
+
if gnm_id in gnm_set:
|
|
39
|
+
op_fa_handle.write('>%s\n' % seq_id)
|
|
40
|
+
op_fa_handle.write('%s\n' % str(each_seq.seq))
|
|
41
|
+
else:
|
|
42
|
+
print(seq_id)
|
|
43
|
+
op_fa_handle.close()
|
TreeSAK/tmp_5.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
para_txt = '/Users/songweizhi/Desktop/555/batch_itol_para.txt'
|
|
3
|
+
|
|
4
|
+
para_dict = dict()
|
|
5
|
+
for each_line in open(para_txt):
|
|
6
|
+
if not each_line.startswith('#'):
|
|
7
|
+
if len(each_line.strip()) > 0:
|
|
8
|
+
para_without_comment = each_line.strip().split('#')[0].strip()
|
|
9
|
+
para_without_comment_split = para_without_comment.split('\t')
|
|
10
|
+
para_dict[para_without_comment_split[0]] = para_without_comment_split[1]
|
|
11
|
+
|
|
12
|
+
print(para_dict)
|
TreeSAK/weighted_rand.rb
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# /usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
# all credits to Wolfgang Teuber (https://gitlab.com/knugie)
|
|
4
|
+
|
|
5
|
+
def weighted_rand(weights = {})
|
|
6
|
+
raise 'Probabilities must sum up to 1' unless weights.values.inject(&:+) == 1.0
|
|
7
|
+
raise 'Probabilities must not be negative' unless weights.values.all? { |p| p >= 0 }
|
|
8
|
+
# Do more sanity checks depending on the amount of trust in the software component using this method,
|
|
9
|
+
# e.g. don't allow duplicates, don't allow non-numeric values, etc.
|
|
10
|
+
|
|
11
|
+
# Ignore elements with probability 0
|
|
12
|
+
weights = weights.reject { |k, v| v == 0.0 } # e.g. => {"a"=>0.4, "b"=>0.4, "c"=>0.2}
|
|
13
|
+
|
|
14
|
+
# Accumulate probabilities and map them to a value
|
|
15
|
+
u = 0.0
|
|
16
|
+
ranges = weights.map { |v, p| [u += p, v] } # e.g. => [[0.4, "a"], [0.8, "b"], [1.0, "c"]]
|
|
17
|
+
|
|
18
|
+
# Generate a (pseudo-)random floating point number between 0.0(included) and 1.0(excluded)
|
|
19
|
+
u = rand # e.g. => 0.4651073966724186
|
|
20
|
+
|
|
21
|
+
# Find the first value that has an accumulated probability greater than the random number u
|
|
22
|
+
ranges.find { |p, v| p > u }.last # e.g. => "b"
|
|
23
|
+
end
|