-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhideSupportValues.pl
More file actions
executable file
·50 lines (35 loc) · 1.17 KB
/
Copy pathhideSupportValues.pl
File metadata and controls
executable file
·50 lines (35 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/perl -w
use strict;
use Getopt::Long;
use Bio::TreeIO;
my ($tree_in,$format, $cutoff);
GetOptions('t|tree=s' => \$tree_in,
'f|format=s' => \$format,
'c|cutoff=s' => \$cutoff,
);
# objects
my $in = Bio::TreeIO->new(-format => $format,
-file => $tree_in);
my $out = Bio::TreeIO->new(-format => $format,
-fh => \*STDOUT);
# loop through trees
while( my $tree = $in->next_tree ) {
# loop through nodes
for my $node ($tree->get_nodes ) {
# skip terminal nodes (leafs)
next if ($node->is_Leaf);
# delete node id (bootstrap value) if lower then 70
$node->id('') if ($node->id < $cutoff);
# print $node->bootstrap, "\n" if ($node->bootstrap < 70);
}
# write new tree to out object (newick file, STDOUT)
$out->write_tree($tree);
}
=head1 USAGE
hideSupportValues.pl -t|--tree [input tree] -f|--format [tree format] -c|--cutoff [support value]
=head1 EXAMPLE
hideSupportValues.pl -t|--tree 16S.newick -f|--format newick -c|--cutoff 70
=head1 SYNOPSIS
Hides / Omits support values (bootstraps, posterior probabilities) below the specified value in the provided tree
=head1 AUTHOR
Joran Martijn (joran.martijn@icm.uu.se)