line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bio::MUST::Core::Tree::Forest; |
2
|
|
|
|
|
|
|
# ABSTRACT: Collection of (bootstrap) trees |
3
|
|
|
|
|
|
|
$Bio::MUST::Core::Tree::Forest::VERSION = '0.212670'; |
4
|
17
|
|
|
17
|
|
136
|
use Moose; |
|
17
|
|
|
|
|
44
|
|
|
17
|
|
|
|
|
142
|
|
5
|
17
|
|
|
17
|
|
123307
|
use namespace::autoclean; |
|
17
|
|
|
|
|
48
|
|
|
17
|
|
|
|
|
181
|
|
6
|
|
|
|
|
|
|
|
7
|
17
|
|
|
17
|
|
1625
|
use autodie; |
|
17
|
|
|
|
|
45
|
|
|
17
|
|
|
|
|
162
|
|
8
|
17
|
|
|
17
|
|
95601
|
use feature qw(say); |
|
17
|
|
|
|
|
50
|
|
|
17
|
|
|
|
|
1797
|
|
9
|
|
|
|
|
|
|
|
10
|
17
|
|
|
17
|
|
137
|
use Bio::Phylo::IO qw(parse); |
|
17
|
|
|
|
|
46
|
|
|
17
|
|
|
|
|
1180
|
|
11
|
|
|
|
|
|
|
|
12
|
17
|
|
|
17
|
|
135
|
use Bio::MUST::Core::Types; |
|
17
|
|
|
|
|
43
|
|
|
17
|
|
|
|
|
565
|
|
13
|
17
|
|
|
17
|
|
104
|
use aliased 'Bio::MUST::Core::Tree'; |
|
17
|
|
|
|
|
41
|
|
|
17
|
|
|
|
|
149
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# public array |
17
|
|
|
|
|
|
|
has 'trees' => ( |
18
|
|
|
|
|
|
|
traits => ['Array'], |
19
|
|
|
|
|
|
|
is => 'ro', |
20
|
|
|
|
|
|
|
isa => 'ArrayRef[Bio::MUST::Core::Tree]', |
21
|
|
|
|
|
|
|
default => sub { [] }, |
22
|
|
|
|
|
|
|
handles => { |
23
|
|
|
|
|
|
|
count_trees => 'count', |
24
|
|
|
|
|
|
|
all_trees => 'elements', |
25
|
|
|
|
|
|
|
add_tree => 'push', |
26
|
|
|
|
|
|
|
get_tree => 'get', |
27
|
|
|
|
|
|
|
}, |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub restore_ids { |
33
|
1
|
|
|
1
|
1
|
13
|
my $self = shift; |
34
|
1
|
|
|
|
|
3
|
my $mapper = shift; |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
|
|
53
|
$_->restore_ids($mapper) for $self->all_trees; |
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
11
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub load { |
43
|
1
|
|
|
1
|
1
|
451
|
my $class = shift; |
44
|
1
|
|
|
|
|
3
|
my $infile = shift; |
45
|
|
|
|
|
|
|
|
46
|
1
|
|
|
|
|
3
|
my @trees; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# build Bio::MUST::Core::Tree object from each Bio::Phylo::Forest::Tree |
49
|
1
|
|
|
|
|
7
|
my $forest = parse(-format => 'newick', -file => $infile); |
50
|
1
|
|
|
|
|
2213452
|
while (my $tree = $forest->next) { |
51
|
10
|
|
|
|
|
525
|
push @trees, Tree->new( tree => $tree ); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
1
|
|
|
|
|
60
|
return $class->new( trees => \@trees ); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub store { |
59
|
2
|
|
|
2
|
1
|
7
|
my $self = shift; |
60
|
2
|
|
|
|
|
4
|
my $outfile = shift; |
61
|
|
|
|
|
|
|
|
62
|
2
|
|
|
|
|
16
|
open my $out, '>', $outfile; |
63
|
|
|
|
|
|
|
|
64
|
2
|
|
|
|
|
93
|
say {$out} join "\n", map { |
65
|
2
|
|
|
|
|
2834
|
$_->tree->to_newick( -nodelabels => 0 ) # This might be an issue! |
|
20
|
|
|
|
|
622941
|
|
66
|
|
|
|
|
|
|
} $self->all_trees; |
67
|
|
|
|
|
|
|
|
68
|
2
|
|
|
|
|
68532
|
return; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
72
|
|
|
|
|
|
|
1; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
__END__ |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=pod |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 NAME |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Bio::MUST::Core::Tree::Forest - Collection of (bootstrap) trees |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 VERSION |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
version 0.212670 |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 SYNOPSIS |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# TODO |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 DESCRIPTION |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
# TODO |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 METHODS |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head2 restore_ids |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head2 load |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head2 store |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 AUTHOR |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Denis BAURAIN <denis.baurain@uliege.be> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
This software is copyright (c) 2013 by University of Liege / Unit of Eukaryotic Phylogenomics / Denis BAURAIN. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
111
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=cut |