0
|
1 # $Id: TreeFactoryI.pm,v 1.6 2002/10/22 07:45:14 lapp Exp $
|
|
2 #
|
|
3 # BioPerl module for Bio::Factory::TreeFactoryI
|
|
4 #
|
|
5 # Cared for by Jason Stajich <jason@bioperl.org>
|
|
6 #
|
|
7 # Copyright Jason Stajich
|
|
8 #
|
|
9 # You may distribute this module under the same terms as perl itself
|
|
10
|
|
11 # POD documentation - main docs before the code
|
|
12
|
|
13 =head1 NAME
|
|
14
|
|
15 Bio::Factory::TreeFactoryI - Factory Interface for getting and writing trees
|
|
16 from/to a data stream
|
|
17
|
|
18 =head1 SYNOPSIS
|
|
19
|
|
20 # get a $factory from somewhere Bio::TreeIO likely
|
|
21 my $treeio = new Bio::TreeIO(-format => 'newick', #this is phylip/newick format
|
|
22 -file => 'file.tre');
|
|
23 my $treeout = new Bio::TreeIO(-format => 'nexus',
|
|
24 -file => ">file.nexus");
|
|
25
|
|
26 # convert tree formats from newick/phylip to nexus
|
|
27 while(my $tree = $treeio->next_tree) {
|
|
28 $treeout->write_tree($treeout);
|
|
29 }
|
|
30
|
|
31 =head1 DESCRIPTION
|
|
32
|
|
33 This interface describes the minimal functions needed to get and write
|
|
34 trees from a data stream. It is implemented by the L<Bio::TreeIO> factory.
|
|
35
|
|
36 =head1 FEEDBACK
|
|
37
|
|
38 =head2 Mailing Lists
|
|
39
|
|
40 User feedback is an integral part of the evolution of this and other
|
|
41 Bioperl modules. Send your comments and suggestions preferably to
|
|
42 the Bioperl mailing list. Your participation is much appreciated.
|
|
43
|
|
44 bioperl-l@bioperl.org - General discussion
|
|
45 http://bioperl.org/MailList.shtml - About the mailing lists
|
|
46
|
|
47 =head2 Reporting Bugs
|
|
48
|
|
49 Report bugs to the Bioperl bug tracking system to help us keep track
|
|
50 of the bugs and their resolution. Bug reports can be submitted via
|
|
51 email or the web:
|
|
52
|
|
53 bioperl-bugs@bioperl.org
|
|
54 http://bugzilla.bioperl.org/
|
|
55
|
|
56 =head1 AUTHOR - Jason Stajich
|
|
57
|
|
58 Email jason@bioperl.org
|
|
59
|
|
60 Describe contact details here
|
|
61
|
|
62 =head1 CONTRIBUTORS
|
|
63
|
|
64 Additional contributors names and emails here
|
|
65
|
|
66 =head1 APPENDIX
|
|
67
|
|
68 The rest of the documentation details each of the object methods.
|
|
69 Internal methods are usually preceded with a _
|
|
70
|
|
71 =cut
|
|
72
|
|
73
|
|
74 # Let the code begin...
|
|
75
|
|
76
|
|
77 package Bio::Factory::TreeFactoryI;
|
|
78 use vars qw(@ISA);
|
|
79 use strict;
|
|
80 use Bio::Root::RootI;
|
|
81
|
|
82 @ISA = qw(Bio::Root::RootI);
|
|
83
|
|
84 =head2 next_tree
|
|
85
|
|
86 Title : next_tree
|
|
87 Usage : my $tree = $factory->next_tree;
|
|
88 Function: Get a tree from the factory
|
|
89 Returns : L<Bio::Tree::TreeI>
|
|
90 Args : none
|
|
91
|
|
92 =cut
|
|
93
|
|
94 sub next_tree{
|
|
95 my ($self,@args) = @_;
|
|
96 $self->throw_not_implemented();
|
|
97 }
|
|
98
|
|
99 =head2 write_tree
|
|
100
|
|
101 Title : write_tree
|
|
102 Usage : $treeio->write_tree($tree);
|
|
103 Function: Writes a tree onto the stream
|
|
104 Returns : none
|
|
105 Args : L<Bio::Tree::TreeI>
|
|
106
|
|
107
|
|
108 =cut
|
|
109
|
|
110 sub write_tree{
|
|
111 my ($self,@args) = @_;
|
|
112 $self->throw_not_implemented();
|
|
113 }
|
|
114
|
|
115 1;
|