TreeSAK 1.57.7__tar.gz → 1.58.0__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.57.7/treesak.egg-info → treesak-1.58.0}/PKG-INFO +2 -2
- {treesak-1.57.7 → treesak-1.58.0}/README.md +23 -13
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/VERSION +3 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/replace_clade.py +13 -0
- treesak-1.58.0/TreeSAK/rm_leaf.py +83 -0
- {treesak-1.57.7 → treesak-1.58.0}/bin/TreeSAK +13 -1
- {treesak-1.57.7 → treesak-1.58.0/treesak.egg-info}/PKG-INFO +2 -2
- {treesak-1.57.7 → treesak-1.58.0}/treesak.egg-info/SOURCES.txt +1 -0
- {treesak-1.57.7 → treesak-1.58.0}/LICENSE +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/MANIFEST.in +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE1.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE2.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE2RTC.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE3.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE4.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE5.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE6.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE7.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ALE_backup.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/AssessCVG.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/AssessMarker.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/AssessMarkerDeltaLL.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/AssessMarkerPA.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/BMGE.jar +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/BMGE.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/C60SR4.nex +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/CompareMCMC.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ConcateMSA.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ConvertMSA.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/Dir.rb +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ExtractMarkerSeq.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/FastRoot.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/FastRoot_backup.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/FigTree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/GTDB_tree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/GeneTree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/KEGG_Luo17.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/LcaToLeaves.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/MarkerRef2Tree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/MarkerRef2Tree_backup.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/MarkerSeq2Tree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/MarkerSeq2Tree_backup.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ModifyTopo.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/Newick_tree_plotter.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/OMA.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/OMA2.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/OneLineAln.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/PB.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/PMSF.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/PhyloBiAssoc.R +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/PhyloBiAssoc.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/PlotMCMC.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/PlotMcmcNode.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/PlotMcmcNode_old.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/RootTree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/RootTreeGTDB.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/RootTreeGTDB214.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/RootTreeGTDB220.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SequentialDating.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SingleAleHGT.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SingleLinePhy.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SliceMSA.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SplitScore.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SplitScore1.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SplitScore1OMA.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/SplitScore2.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/Tanglegram.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/TaxaCountStats.R +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/TaxonTree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/TimeScale.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/TreeSAK_config.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/VisHPD95.R +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/VisHPD95.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/__init__.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ale_parser.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/ale_splitter.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/alignment_pruner.pl +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/assessOG.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/assessPB.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/batch_itol.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/catfasta2phy.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/cogTree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/compare_trees.R +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/compare_trees.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/cophyloplot.R +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/cophyloplot.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/dating.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/dating_ss.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/deltall.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/do_rrtc.rb +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/fa2phy.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/filter_rename_ar53.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/format_leaf_name.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/gap_stats.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/get_SCG_tree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/get_arCOG_seq.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/get_lca_id.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/global_functions.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/gnm_leaves.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/guide_tree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/iTOL.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/iTOL_gene_tree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/itol_msa_stats.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/keep_highest_rrtc.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/koTree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/label_gene_tree_by_gnm.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/label_tree.R +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/label_tree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/mad.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/mcmc2tree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/mcmcTC copy.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/mcmcTC.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/mcmctree_out.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/mcmctree_vs_reltime.R +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/mcmctree_vs_reltime.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/merge_pdf.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/pRTC.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/parse_mcmctree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/parse_reltime.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/phy2fa.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/plot_distruibution_th.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/prep_mcmctree_ctl.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/print_leaves.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/pruneMSA.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/recode.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/remove_bias.R +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/rename_leaves.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/root_with_out_group.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/run_TaxaCountStats_R_s1.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/subsample_drep_gnms.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/subset.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/subset_tree_stupid_old_way.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/supertree.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/tmp_1.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/tmp_2.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/tmp_3.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/tmp_4.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/tree_fmt.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/TreeSAK/weighted_rand.rb +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/setup.cfg +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/setup.py +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/treesak.egg-info/dependency_links.txt +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/treesak.egg-info/requires.txt +0 -0
- {treesak-1.57.7 → treesak-1.58.0}/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.
|
|
3
|
+
Version: 1.58.0
|
|
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.
|
|
27
|
+
TreeSAK v1.58.0
|
|
@@ -30,8 +30,9 @@ Installation
|
|
|
30
30
|
TreeSAK modules
|
|
31
31
|
---
|
|
32
32
|
|
|
33
|
-
...::: TreeSAK v1.
|
|
33
|
+
...::: TreeSAK v1.58.0 :::...
|
|
34
34
|
|
|
35
|
+
|
|
35
36
|
Marker-related
|
|
36
37
|
ExtractMarkerSeq -> Extract marker by blastn
|
|
37
38
|
deltall -> Parse stdout of deltaLL.rb
|
|
@@ -41,12 +42,14 @@ TreeSAK modules
|
|
|
41
42
|
AssessMarkerDeltaLL -> Assess Markers by DeltaLL
|
|
42
43
|
OMA -> Prepare input files for running OMA
|
|
43
44
|
OMA2 -> Filter OMA predicted OGs
|
|
44
|
-
|
|
45
|
+
filter_rename_ar53 -> Filter rename GTDB markers
|
|
46
|
+
|
|
45
47
|
Multiple Sequence Alignment
|
|
46
48
|
BMGE -> Run BMGE
|
|
47
49
|
pruneMSA -> Prune MSA with alignment_pruner.pl
|
|
48
|
-
|
|
50
|
+
recode -> Recode amino acids to Dayoff 4, Dayoff 6 or SR4 categories
|
|
49
51
|
fa2phy -> Convert MSA format (fasta to phylip)
|
|
52
|
+
phy2fa -> Convert MSA format (phylip to fasta)
|
|
50
53
|
SliceMSA -> Slice MSA by column
|
|
51
54
|
ConcateMSA -> Concatenate MSAs
|
|
52
55
|
ConvertMSA -> Convert MSA format
|
|
@@ -57,10 +60,12 @@ TreeSAK modules
|
|
|
57
60
|
|
|
58
61
|
Tree-related
|
|
59
62
|
iTOL -> Prepare iTOL files
|
|
63
|
+
batch_itol -> Batch access iTOL
|
|
60
64
|
iTOL_gene_tree -> Genome metadata to gene metadata
|
|
65
|
+
iTOL_msa_stats -> iTOL_msa_stats
|
|
61
66
|
PB -> Infer tree with PhyloBayes-MPI
|
|
62
|
-
|
|
63
|
-
|
|
67
|
+
assessPB -> Compare PhyloBayes chains
|
|
68
|
+
supertree -> Infer species tree from multiple gene trees
|
|
64
69
|
MarkerSeq2Tree -> Marker sequence to tree
|
|
65
70
|
MarkerRef2Tree -> Marker (reference sequence) to Tree
|
|
66
71
|
GTDB_tree -> Get GTDB tree
|
|
@@ -73,12 +78,17 @@ TreeSAK modules
|
|
|
73
78
|
ModifyTopo -> Modify tree topology
|
|
74
79
|
GeneRax -> (to be added) Run GeneRax
|
|
75
80
|
ALE -> Modules for running ALE
|
|
76
|
-
|
|
81
|
+
cogTree -> Infer tree for individual COG function
|
|
82
|
+
koTree -> Infer tree for individual KEGG function
|
|
77
83
|
RootTree -> Root tree with outgroup leaves
|
|
78
|
-
|
|
79
|
-
RootTreeGTDB220 -> Root tree by GTDB taxonomy (r220)
|
|
84
|
+
RootTreeGTDB -> Root tree by GTDB taxonomy
|
|
80
85
|
LcaToLeaves -> Get two leaves that define an internal node
|
|
81
86
|
replace_clade -> Replace tree clade
|
|
87
|
+
GeneTree -> Infer gene tree
|
|
88
|
+
guide_tree -> Prepare guide tree for iqtree
|
|
89
|
+
get_lca_id -> Get LCA id
|
|
90
|
+
tree_fmt -> Change tree format
|
|
91
|
+
rm_leaf -> Remove leaf/leaves from tree
|
|
82
92
|
|
|
83
93
|
Model-related
|
|
84
94
|
PMSF -> run iqtree with PMSF
|
|
@@ -86,13 +96,13 @@ TreeSAK modules
|
|
|
86
96
|
|
|
87
97
|
Dating-related
|
|
88
98
|
dating -> Perform molecular dating
|
|
89
|
-
AssessCVG -> Assess dating convergence
|
|
90
99
|
CompareMCMC -> Compare MCMCTree outputs
|
|
91
|
-
PlotMcmcNode ->
|
|
100
|
+
PlotMcmcNode -> Distribution of node's age estimation
|
|
92
101
|
VisHPD95 -> HPD95 of estimated node age
|
|
93
102
|
pRTC -> Perform probabilistic RTC dating
|
|
94
|
-
mcmcTC ->
|
|
95
|
-
mcmc2tree ->
|
|
96
|
-
|
|
103
|
+
mcmcTC -> Adding time constraints to mcmctree tree
|
|
104
|
+
mcmc2tree -> Get the tree with internal node from mcmctree output
|
|
105
|
+
mcmctree_out -> Parse MCMCTree produced .out file
|
|
106
|
+
|
|
97
107
|
Phylo-related stats
|
|
98
108
|
PhyloBiAssoc -> A wrapper for binaryPGLMM test
|
|
@@ -10,6 +10,19 @@ TreeSAK replace_clade -m main.tree -s sub.tree -o out.tree -l leaves.txt
|
|
|
10
10
|
TreeSAK replace_clade -m main.tree -s sub.tree -o out.tree -l leaf1
|
|
11
11
|
TreeSAK replace_clade -m main.tree -s sub.tree -o out.tree -l leaf1,leaf2
|
|
12
12
|
|
|
13
|
+
# https://etetoolkit.org/docs/latest/tutorial/tutorial_trees.html
|
|
14
|
+
0 flexible with support values
|
|
15
|
+
1 flexible with internal node names
|
|
16
|
+
2 all branches + leaf names + internal supports
|
|
17
|
+
3 all branches + all names
|
|
18
|
+
4 leaf branches + leaf names
|
|
19
|
+
5 internal and leaf branches + leaf names
|
|
20
|
+
6 internal branches + leaf names
|
|
21
|
+
7 leaf branches + all names
|
|
22
|
+
8 all names
|
|
23
|
+
9 leaf names
|
|
24
|
+
100 topology only
|
|
25
|
+
|
|
13
26
|
============================================================================
|
|
14
27
|
'''
|
|
15
28
|
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import argparse
|
|
3
|
+
from ete3 import Tree
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
rm_leaf_usage = '''
|
|
7
|
+
=============== rm_leaf example commands ===============
|
|
8
|
+
|
|
9
|
+
TreeSAK rm_leaf -i in.tree -o out.tree -l leaves.txt
|
|
10
|
+
TreeSAK rm_leaf -i in.tree -o out.tree -l leaf1
|
|
11
|
+
TreeSAK rm_leaf -i in.tree -o out.tree -l leaf1,leaf2
|
|
12
|
+
|
|
13
|
+
# Tree formats
|
|
14
|
+
0 flexible with support values
|
|
15
|
+
1 flexible with internal node names
|
|
16
|
+
2 all branches + leaf names + internal supports
|
|
17
|
+
3 all branches + all names
|
|
18
|
+
4 leaf branches + leaf names
|
|
19
|
+
5 internal and leaf branches + leaf names
|
|
20
|
+
6 internal branches + leaf names
|
|
21
|
+
7 leaf branches + all names
|
|
22
|
+
8 all names
|
|
23
|
+
9 leaf names
|
|
24
|
+
100 topology only
|
|
25
|
+
|
|
26
|
+
========================================================
|
|
27
|
+
'''
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def rm_leaf(args):
|
|
31
|
+
|
|
32
|
+
input_tree_file = args['i']
|
|
33
|
+
input_tree_fmt = args['if']
|
|
34
|
+
output_tree_file = args['o']
|
|
35
|
+
output_tree_fmt = args['of']
|
|
36
|
+
leaf_txt = args['l']
|
|
37
|
+
|
|
38
|
+
if os.path.isfile(input_tree_file) is False:
|
|
39
|
+
print('%s does not exist, program exited!' % input_tree_file)
|
|
40
|
+
exit()
|
|
41
|
+
|
|
42
|
+
# read in leaves to remove
|
|
43
|
+
leaves_to_remove_list = []
|
|
44
|
+
if os.path.isfile(leaf_txt) is True:
|
|
45
|
+
for each_leaf in open(leaf_txt):
|
|
46
|
+
leaves_to_remove_list.append(each_leaf.strip())
|
|
47
|
+
else:
|
|
48
|
+
leaves_to_remove_list = leaf_txt.split(',')
|
|
49
|
+
|
|
50
|
+
if len(leaves_to_remove_list) == 0:
|
|
51
|
+
print('Please provide at least one leaf to remove, program exited!')
|
|
52
|
+
exit()
|
|
53
|
+
|
|
54
|
+
# read in tree and remobe leaf/leaves
|
|
55
|
+
main_tre = Tree(input_tree_file, quoted_node_names=True, format=input_tree_fmt)
|
|
56
|
+
main_tre_leaves = [i.name for i in main_tre.get_leaves()]
|
|
57
|
+
|
|
58
|
+
# get leaves to keep
|
|
59
|
+
leaves_to_keep = []
|
|
60
|
+
for each_leaf in main_tre_leaves:
|
|
61
|
+
if each_leaf not in leaves_to_remove_list:
|
|
62
|
+
leaves_to_keep.append(each_leaf)
|
|
63
|
+
|
|
64
|
+
if len(main_tre_leaves) == len(leaves_to_keep):
|
|
65
|
+
print('No leaves to remove, program exited!')
|
|
66
|
+
exit()
|
|
67
|
+
|
|
68
|
+
main_tre.prune(leaves_to_keep)
|
|
69
|
+
|
|
70
|
+
# write out updated tree
|
|
71
|
+
main_tre.write(outfile=output_tree_file, format=output_tree_fmt)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
if __name__ == '__main__':
|
|
75
|
+
|
|
76
|
+
rm_leaf_parser = argparse.ArgumentParser()
|
|
77
|
+
rm_leaf_parser.add_argument('-i', required=True, help='input tree file')
|
|
78
|
+
rm_leaf_parser.add_argument('-if', required=False, default=0, type=int, help='input tree format, default is 0')
|
|
79
|
+
rm_leaf_parser.add_argument('-l', required=True, help='leaf/leaves to remove')
|
|
80
|
+
rm_leaf_parser.add_argument('-o', required=True, help='output tree file')
|
|
81
|
+
rm_leaf_parser.add_argument('-of', required=False, default=0, type=int, help='output tree format, default is 0')
|
|
82
|
+
args = vars(rm_leaf_parser.parse_args())
|
|
83
|
+
rm_leaf(args)
|
|
@@ -86,7 +86,8 @@ def print_main_help():
|
|
|
86
86
|
GeneTree -> Infer gene tree
|
|
87
87
|
guide_tree -> Prepare guide tree for iqtree
|
|
88
88
|
get_lca_id -> Get LCA id
|
|
89
|
-
tree_fmt ->
|
|
89
|
+
tree_fmt -> Change tree format
|
|
90
|
+
rm_leaf -> Remove leaf/leaves from tree
|
|
90
91
|
|
|
91
92
|
Model-related
|
|
92
93
|
PMSF -> run iqtree with PMSF
|
|
@@ -1002,6 +1003,17 @@ if __name__ == '__main__':
|
|
|
1002
1003
|
args = vars(parser.parse_args())
|
|
1003
1004
|
tree_fmt.tree_fmt(args)
|
|
1004
1005
|
|
|
1006
|
+
elif sys.argv[1] == 'rm_leaf':
|
|
1007
|
+
from TreeSAK import rm_leaf
|
|
1008
|
+
rm_leaf_parser = subparsers.add_parser('rm_leaf', usage=rm_leaf.rm_leaf_usage)
|
|
1009
|
+
rm_leaf_parser.add_argument('-i', required=True, help='input tree file')
|
|
1010
|
+
rm_leaf_parser.add_argument('-if', required=False, default=0, type=int, help='input tree format, default is 0')
|
|
1011
|
+
rm_leaf_parser.add_argument('-l', required=True, help='leaf/leaves to remove')
|
|
1012
|
+
rm_leaf_parser.add_argument('-o', required=True, help='output tree file')
|
|
1013
|
+
rm_leaf_parser.add_argument('-of', required=False, default=0, type=int, help='output tree format, default is 0')
|
|
1014
|
+
args = vars(parser.parse_args())
|
|
1015
|
+
rm_leaf.rm_leaf(args)
|
|
1016
|
+
|
|
1005
1017
|
else:
|
|
1006
1018
|
print('Unrecognized module: %s, program exited!' % sys.argv[1])
|
|
1007
1019
|
exit()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: treesak
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.58.0
|
|
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.
|
|
27
|
+
TreeSAK v1.58.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|