Skip to content

Commit eefd5d3

Browse files
committed
added terminal branch names to verbose option of bss function
1 parent 5d40e56 commit eefd5d3

File tree

5 files changed

+36
-25
lines changed

5 files changed

+36
-25
lines changed

docs/usage/index.rst

+8-5
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Calling functions
3030
phykit <command> [optional command arguments]
3131
3232
Command specific help messages can be viewed by adding a
33-
-h/\\-\\-help argument after the command. For example, to see the
34-
to see the help message for the command 'treeness', execute:
33+
-h/\\-\\-help argument after the command. For example, to see the help message
34+
for the command 'treeness', execute:
3535

3636
.. code-block:: shell
3737
@@ -650,6 +650,9 @@ High bipartition support values are thought to be desirable because
650650
they are indicative of greater certainty in tree topology.
651651

652652
To obtain all bipartition support values, use the -v/\\-\\-verbose option.
653+
In addition to support values for each node, the names of all terminal
654+
branches tips are also included. Each terminal branch name is separated
655+
with a semi-colon (;).
653656

654657
.. code-block:: shell
655658
@@ -878,7 +881,7 @@ or otherwise.
878881

879882
.. code-block:: shell
880883
881-
phykit internode_labeler <file> [-o/--output <file>]
884+
phykit internode_labeler <tree> [-o/--output <file>]
882885
883886
Options: |br|
884887
*<tree>*: first argument after function name should be a tree file |br|
@@ -1371,8 +1374,8 @@ Saturation is defined as sequences in multiple sequence
13711374
alignments that have undergone numerous substitutions such
13721375
that the distances between taxa are underestimated.
13731376

1374-
Data with no saturation will have a value of 1. Completely
1375-
saturated data will have a value of 0.
1377+
Data with no saturation will have a value of 1. The closer
1378+
the value is to 1, the less saturated the data.
13761379

13771380
Saturation is calculated following Philippe et al., PLoS
13781381
Biology (2011), doi: 10.1371/journal.pbio.1000602.

phykit/phykit.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,9 @@ def bipartition_support_stats(argv):
11461146
they are indicative of greater certainty in tree topology.
11471147
11481148
To obtain all bipartition support values, use the -v/--verbose option.
1149+
In addition to support values for each node, the names of all terminal
1150+
branches tips are also included. Each terminal branch name is separated
1151+
with a semi-colon (;).
11491152
11501153
Aliases:
11511154
bipartition_support_stats, bss
@@ -1553,7 +1556,7 @@ def internode_labeler(argv):
15531556
pk_internode_labeler, pk_il
15541557
15551558
Usage:
1556-
phykit internode_labeler <file> [-o/--output <file>]
1559+
phykit internode_labeler <tree> [-o/--output <file>]
15571560
15581561
Options
15591562
=====================================================
@@ -2442,10 +2445,10 @@ def saturation(argv):
24422445
alignments that have undergone numerous substitutions such
24432446
that the distances between taxa are underestimated.
24442447
2445-
Data with no saturation will have a value of 1. Completely
2446-
saturated data will have a value of 0.
2448+
Data with no saturation will have a value of 1. The closer
2449+
the value is to 1, the less saturated the data.
24472450
2448-
Saturation is calculated following Philippe et al., PLoS
2451+
Saturation is calculated following Philippe et al., PLoS
24492452
Biology (2011), doi: 10.1371/journal.pbio.1000602.
24502453
24512454
Aliases:

phykit/services/tree/bipartition_support_stats.py

+12-7
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ def __init__(self, args) -> None:
1111

1212
def run(self):
1313
tree = self.read_tree_file()
14-
bs_vals = self.get_bipartition_support_vals(tree)
14+
bs_vals, term_names = self.get_bipartition_support_vals(tree)
1515

1616
if self.verbose:
1717
try:
18-
for bs_val in bs_vals:
19-
print(bs_val)
18+
for bs_val, names in zip(bs_vals, term_names):
19+
print(bs_val, ";".join(names))
2020
except BrokenPipeError:
2121
pass
2222
else:
@@ -29,10 +29,15 @@ def process_args(self, args):
2929
def get_bipartition_support_vals(self, tree):
3030
# initialize list to hold bootstrap values
3131
bs_vals = []
32+
term_names = []
3233

3334
# populate bs_vals with bootstrap values
34-
for terminal in tree.get_nonterminals():
35+
for nonterminal in tree.get_nonterminals():
3536
# only include if a bootstrap value is present
36-
if terminal.confidence != None:
37-
bs_vals.append(terminal.confidence)
38-
return bs_vals
37+
if nonterminal.confidence != None:
38+
bs_vals.append(nonterminal.confidence)
39+
temp = []
40+
for term in nonterminal.get_terminals():
41+
temp.append(term.name)
42+
term_names.append(temp)
43+
return bs_vals, term_names

phykit/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.19.6"
1+
__version__ = "1.19.7"

tests/integration/tree/test_bipartition_support_stats_integration.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ def test_bipartition_support_stats_verbose(self, mocked_print):
4545
Phykit()
4646

4747
assert mocked_print.mock_calls == [
48-
call(85),
49-
call(85),
50-
call(100),
51-
call(100),
52-
call(100),
53-
call(100),
54-
call(100),
48+
call(85, "Aspergillus_fischeri_IBT_3007;Aspergillus_fischeri_NRRL181.GCF_000149645.1_ASM14964v1;Aspergillus_fischeri_NRRL4585;Aspergillus_fumigatus_Af293;Aspergillus_fumigatus_CEA10;Aspergillus_fumigatus_HMR_AF_270;Aspergillus_fumigatus_Z5;Aspergillus_oerlinghausenensis_CBS139183"),
49+
call(85, "Aspergillus_fischeri_NRRL181.GCF_000149645.1_ASM14964v1;Aspergillus_fischeri_NRRL4585;Aspergillus_fumigatus_Af293;Aspergillus_fumigatus_CEA10;Aspergillus_fumigatus_HMR_AF_270;Aspergillus_fumigatus_Z5;Aspergillus_oerlinghausenensis_CBS139183"),
50+
call(100, "Aspergillus_fischeri_NRRL4585;Aspergillus_fumigatus_Af293;Aspergillus_fumigatus_CEA10;Aspergillus_fumigatus_HMR_AF_270;Aspergillus_fumigatus_Z5;Aspergillus_oerlinghausenensis_CBS139183"),
51+
call(100, "Aspergillus_fumigatus_Af293;Aspergillus_fumigatus_CEA10;Aspergillus_fumigatus_HMR_AF_270;Aspergillus_fumigatus_Z5;Aspergillus_oerlinghausenensis_CBS139183"),
52+
call(100, "Aspergillus_fumigatus_Af293;Aspergillus_fumigatus_CEA10;Aspergillus_fumigatus_HMR_AF_270;Aspergillus_fumigatus_Z5"),
53+
call(100, "Aspergillus_fumigatus_Af293;Aspergillus_fumigatus_CEA10"),
54+
call(100, "Aspergillus_fumigatus_HMR_AF_270;Aspergillus_fumigatus_Z5"),
5555
]
5656

5757
@patch("builtins.print")
@@ -87,4 +87,4 @@ def test_bipartition_support_stats_alias(self, mocked_print):
8787
call("maximum: 100"),
8888
call("standard deviation: 7.3193"),
8989
call("variance: 53.5714")
90-
]
90+
]

0 commit comments

Comments
 (0)