line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# BioPerl module for Bio::Factory::TreeFactoryI |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Please direct questions and support issues to |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Cared for by Jason Stajich |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Copyright Jason Stajich |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# You may distribute this module under the same terms as perl itself |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# POD documentation - main docs before the code |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Bio::Factory::TreeFactoryI - Factory Interface for getting and writing trees |
17
|
|
|
|
|
|
|
from/to a data stream |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# get a $factory from somewhere Bio::TreeIO likely |
22
|
|
|
|
|
|
|
my $treeio = Bio::TreeIO->new(-format => 'newick', #this is phylip/newick format |
23
|
|
|
|
|
|
|
-file => 'file.tre'); |
24
|
|
|
|
|
|
|
my $treeout = Bio::TreeIO->new(-format => 'nexus', |
25
|
|
|
|
|
|
|
-file => ">file.nexus"); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# convert tree formats from newick/phylip to nexus |
28
|
|
|
|
|
|
|
while(my $tree = $treeio->next_tree) { |
29
|
|
|
|
|
|
|
$treeout->write_tree($tree); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 DESCRIPTION |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
This interface describes the minimal functions needed to get and write |
35
|
|
|
|
|
|
|
trees from a data stream. It is implemented by the L factory. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 FEEDBACK |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 Mailing Lists |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
User feedback is an integral part of the evolution of this and other |
42
|
|
|
|
|
|
|
Bioperl modules. Send your comments and suggestions preferably to |
43
|
|
|
|
|
|
|
the Bioperl mailing list. Your participation is much appreciated. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
bioperl-l@bioperl.org - General discussion |
46
|
|
|
|
|
|
|
http://bioperl.org/wiki/Mailing_lists - About the mailing lists |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 Support |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Please direct usage questions or support issues to the mailing list: |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
I |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
rather than to the module maintainer directly. Many experienced and |
55
|
|
|
|
|
|
|
reponsive experts will be able look at the problem and quickly |
56
|
|
|
|
|
|
|
address it. Please include a thorough description of the problem |
57
|
|
|
|
|
|
|
with code and data examples if at all possible. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 Reporting Bugs |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Report bugs to the Bioperl bug tracking system to help us keep track |
62
|
|
|
|
|
|
|
of the bugs and their resolution. Bug reports can be submitted via the |
63
|
|
|
|
|
|
|
web: |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
https://github.com/bioperl/bioperl-live/issues |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 AUTHOR - Jason Stajich |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Email jason@bioperl.org |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 APPENDIX |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
The rest of the documentation details each of the object methods. |
74
|
|
|
|
|
|
|
Internal methods are usually preceded with a _ |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
# Let the code begin... |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
package Bio::Factory::TreeFactoryI; |
83
|
22
|
|
|
22
|
|
168
|
use strict; |
|
22
|
|
|
|
|
49
|
|
|
22
|
|
|
|
|
702
|
|
84
|
|
|
|
|
|
|
|
85
|
22
|
|
|
22
|
|
122
|
use base qw(Bio::Root::RootI); |
|
22
|
|
|
|
|
48
|
|
|
22
|
|
|
|
|
2624
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head2 next_tree |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Title : next_tree |
90
|
|
|
|
|
|
|
Usage : my $tree = $factory->next_tree; |
91
|
|
|
|
|
|
|
Function: Get a tree from the factory |
92
|
|
|
|
|
|
|
Returns : L |
93
|
|
|
|
|
|
|
Args : none |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=cut |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
sub next_tree{ |
98
|
0
|
|
|
0
|
1
|
|
my ($self,@args) = @_; |
99
|
0
|
|
|
|
|
|
$self->throw_not_implemented(); |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head2 write_tree |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Title : write_tree |
105
|
|
|
|
|
|
|
Usage : $treeio->write_tree($tree); |
106
|
|
|
|
|
|
|
Function: Writes a tree onto the stream |
107
|
|
|
|
|
|
|
Returns : none |
108
|
|
|
|
|
|
|
Args : L |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub write_tree{ |
114
|
0
|
|
|
0
|
1
|
|
my ($self,@args) = @_; |
115
|
0
|
|
|
|
|
|
$self->throw_not_implemented(); |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
1; |