1# $Id $
2#
3# BioPerl module for Bio::Tools::Run::Phylo::Phylip::Base
4#
5# Please direct questions and support issues to <bioperl-l@bioperl.org>
6#
7# Cared for by Jason Stajich <jason-AT-bioperl_DOT_org>
8#
9# Copyright Jason Stajich
10#
11# You may distribute this module under the same terms as perl itself
12
13# POD documentation - main docs before the code
14
15=head1 NAME
16
17Bio::Tools::Run::Phylo::Phylip::Base - Base object for Phylip modules
18
19=head1 SYNOPSIS
20
21# Do not use directly
22# This module is for setting basic data sets for the Phylip wrapper
23# modules
24
25=head1 DESCRIPTION
26
27This module is just a base object for Bioperl Phylip wrappers.
28
29IMPORTANT PHYLIP VERSION ISSUES
30By default we assume you have Phylip 3.6 installed, if you
31have installed Phylip 3.5 you need to set the environment variable
32PHYLIPVERSION
33
34
35=head1 FEEDBACK
36
37=head2 Mailing Lists
38
39User feedback is an integral part of the evolution of this and other
40Bioperl modules. Send your comments and suggestions preferably to
41the Bioperl mailing list.  Your participation is much appreciated.
42
43  bioperl-l@bioperl.org                  - General discussion
44  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
45
46=head2 Support
47
48Please direct usage questions or support issues to the mailing list:
49
50I<bioperl-l@bioperl.org>
51
52rather than to the module maintainer directly. Many experienced and
53reponsive experts will be able look at the problem and quickly
54address it. Please include a thorough description of the problem
55with code and data examples if at all possible.
56
57=head2 Reporting Bugs
58
59Report bugs to the Bioperl bug tracking system to help us keep track
60of the bugs and their resolution. Bug reports can be submitted via the
61web:
62
63  http://redmine.open-bio.org/projects/bioperl/
64
65=head1 AUTHOR - Jason Stajich
66
67Email jason-at-bioperl.org
68
69=head1 APPENDIX
70
71The rest of the documentation details each of the object methods.
72Internal methods are usually preceded with a _
73
74=cut
75
76
77# Let the code begin...
78
79
80package Bio::Tools::Run::Phylo::Phylip::Base;
81use vars qw(@ISA %DEFAULT %FILENAME);
82use strict;
83
84BEGIN {
85    eval { require File::Spec };
86    if( $@) { Bio::Root::RootI->throw("Must have installed File::Spec to run Bio::Tools::Run::Phylo::Phylip tools");
87  }
88
89}
90
91use Bio::Root::Root;
92use Bio::Tools::Run::WrapperBase;
93use Bio::Tools::Run::Phylo::Phylip::PhylipConf;
94@ISA = qw(Bio::Root::Root  Bio::Tools::Run::WrapperBase);
95
96BEGIN {
97    %DEFAULT = (
98		 'VERSION'   => $ENV{'PHYLIPVERSION'} || '3.6',
99		 );
100    %FILENAME = %Bio::Tools::Run::Phylo::Phylip::PhylipConf::FileName;
101}
102
103=head2 new
104
105 Title   : new
106 Usage   : my $obj = Bio::Tools::Run::Phylo::Phylip::Base->new();
107 Function: Builds a new Bio::Tools::Run::Phylo::Phylip::Base object
108 Returns : an instance of Bio::Tools::Run::Phylo::Phylip::Base
109 Args    :
110
111=cut
112
113=head2 outfile
114
115 Title   : outfile
116 Usage   : $obj->outfile($newval)
117 Function: Get/Set default PHYLIP outfile name ('outfile' usually)
118           Changing this is only necessary when you have compiled
119           PHYLIP to use a different filename for the default 'outfile'
120           This will not change the default output filename by
121           PHYLIP
122 Returns : value of outfile
123 Args    : newvalue (optional)
124
125
126=cut
127
128sub outfile{
129   my $self = shift;
130   $self->{'_outfile'} = shift if @_;
131   return $self->{'_outfile'} || $FILENAME{$self->version}{'OUTFILE'}
132}
133
134
135=head2 treefile
136
137 Title   : treefile
138 Usage   : $obj->treefile($newval)
139 Function: Get/Set the default PHYLIP treefile name ('treefile' usually)
140 Returns : value of treefile
141 Args    : newvalue (optional)
142
143
144=cut
145
146sub treefile{
147   my $self = shift;
148   $self->{'_treefile'} = shift if @_;
149   return $self->{'_treefile'} || $FILENAME{$self->version}{'TREEFILE'};
150}
151
152
153=head2 fontfile
154
155 Title   : fontfile
156 Usage   : $obj->fontfile($newval)
157 Function: Get/Set the fontfile
158 Returns : value of fontfile (a scalar)
159 Args    : on set, new value (a scalar or undef, optional)
160
161
162=cut
163
164sub fontfile{
165    my $self = shift;
166
167    return $self->{'fontfile'} = shift if @_;
168    return $self->{'fontfile'} ;
169}
170
171=head2 plotfile
172
173 Title   : plotfile
174 Usage   : $obj->plotfile($newval)
175 Function: Get/Set the plotfile
176 Returns : value of plotfile (a scalar)
177 Args    : on set, new value (a scalar or undef, optional)
178
179
180=cut
181
182sub plotfile {
183    my $self = shift;
184
185    return $self->{'plotfile'} = shift if @_;
186    return $self->{'plotfile'} || $FILENAME{$self->version}{'PLOTFILE'};
187}
188
189=head2 version
190
191 Title   : version
192 Usage   : $obj->version($newval)
193 Function: Get/Set the version
194 Returns : value of version (a scalar)
195 Args    : on set, new value (a scalar or undef, optional)
196
197
198=cut
199
200sub version {
201    my $self = shift;
202
203    return $self->{'version'} = shift if @_;
204    return $self->{'version'} || $DEFAULT{'VERSION'};
205}
2061;
207