rework tempfile handling to explicitly close a filehanle - assigning it to undef...
[bioperl-run.git] / Bio / Tools / Run / Phylo / Phylip / Base.pm
blobfde63430cb76070af64d434c47361ee98d28f610
1 # $Id $
3 # BioPerl module for Bio::Tools::Run::Phylo::Phylip::Base
5 # Cared for by Jason Stajich <jason@bioperl.org>
7 # Copyright Jason Stajich
9 # You may distribute this module under the same terms as perl itself
11 # POD documentation - main docs before the code
13 =head1 NAME
15 Bio::Tools::Run::Phylo::Phylip::Base - Base object for Phylip modules
17 =head1 SYNOPSIS
19 # Do not use directly
20 # This module is for setting basic data sets for the Phylip wrapper
21 # modules
23 =head1 DESCRIPTION
25 This module is just a base object for Bioperl Phylip wrappers.
27 IMPORTANT PHYLIP VERSION ISSUES
28 By default we assume you have Phylip 3.5 installed, if you
29 have installed Phylip 3.6 you need to set the environment variable
30 PHYLIPVERSION
33 =head1 FEEDBACK
35 =head2 Mailing Lists
37 User feedback is an integral part of the evolution of this and other
38 Bioperl modules. Send your comments and suggestions preferably to
39 the Bioperl mailing list. Your participation is much appreciated.
41 bioperl-l@bioperl.org - General discussion
42 http://bioperl.org/MailList.shtml - About the mailing lists
44 =head2 Reporting Bugs
46 Report bugs to the Bioperl bug tracking system to help us keep track
47 of the bugs and their resolution. Bug reports can be submitted via
48 email or the web:
50 bioperl-bugs@bioperl.org
51 http://bugzilla.bioperl.org/bioperl-bugs/
53 =head1 AUTHOR - Jason Stajich
55 Email jason@bioperl.org
57 Describe contact details here
59 =head1 CONTRIBUTORS
61 Additional contributors names and emails here
63 =head1 APPENDIX
65 The rest of the documentation details each of the object methods.
66 Internal methods are usually preceded with a _
68 =cut
71 # Let the code begin...
74 package Bio::Tools::Run::Phylo::Phylip::Base;
75 use vars qw(@ISA %DEFAULT %FILENAME);
76 use strict;
78 BEGIN {
79 eval { require File::Spec };
80 if( $@) { Bio::Root::RootI->throw("Must have installed File::Spec to run Bio::Tools::Run::Phylo::Phylip tools");
85 use Bio::Root::Root;
86 use Bio::Tools::Run::WrapperBase;
87 use Bio::Tools::Run::Phylo::Phylip::PhylipConf;
88 @ISA = qw(Bio::Root::Root Bio::Tools::Run::WrapperBase);
90 BEGIN {
91 %DEFAULT = (
92 'VERSION' => $ENV{'PHYLIPVERSION'} || '3.5',
94 %FILENAME = %Bio::Tools::Run::Phylo::Phylip::PhylipConf::FileName;
97 =head2 new
99 Title : new
100 Usage : my $obj = new Bio::Tools::Run::Phylo::Phylip::Base();
101 Function: Builds a new Bio::Tools::Run::Phylo::Phylip::Base object
102 Returns : an instance of Bio::Tools::Run::Phylo::Phylip::Base
103 Args :
105 =cut
107 =head2 outfile
109 Title : outfile
110 Usage : $obj->outfile($newval)
111 Function: Get/Set default PHYLIP outfile name ('outfile' usually)
112 Changing this is only necessary when you have compiled
113 PHYLIP to use a different filename for the default 'outfile'
114 This will not change the default output filename by
115 PHYLIP
116 Returns : value of outfile
117 Args : newvalue (optional)
120 =cut
122 sub outfile{
123 my $self = shift;
124 $self->{'_outfile'} = shift if @_;
125 return $self->{'_outfile'} || $FILENAME{$self->version}{'OUTFILE'}
129 =head2 treefile
131 Title : treefile
132 Usage : $obj->treefile($newval)
133 Function: Get/Set the default PHYLIP treefile name ('treefile' usually)
134 Returns : value of treefile
135 Args : newvalue (optional)
138 =cut
140 sub treefile{
141 my $self = shift;
142 $self->{'_treefile'} = shift if @_;
143 return $self->{'_treefile'} || $FILENAME{$self->version}{'TREEFILE'};
147 =head2 fontfile
149 Title : fontfile
150 Usage : $obj->fontfile($newval)
151 Function: Get/Set the fontfile
152 Returns : value of fontfile (a scalar)
153 Args : on set, new value (a scalar or undef, optional)
156 =cut
158 sub fontfile{
159 my $self = shift;
161 return $self->{'fontfile'} = shift if @_;
162 return $self->{'fontfile'} ;
165 =head2 plotfile
167 Title : plotfile
168 Usage : $obj->plotfile($newval)
169 Function: Get/Set the plotfile
170 Returns : value of plotfile (a scalar)
171 Args : on set, new value (a scalar or undef, optional)
174 =cut
176 sub plotfile {
177 my $self = shift;
179 return $self->{'plotfile'} = shift if @_;
180 return $self->{'plotfile'} || $FILENAME{$self->version}{'PLOTFILE'};
183 =head2 version
185 Title : version
186 Usage : $obj->version($newval)
187 Function: Get/Set the version
188 Returns : value of version (a scalar)
189 Args : on set, new value (a scalar or undef, optional)
192 =cut
194 sub version {
195 my $self = shift;
197 return $self->{'version'} = shift if @_;
198 return $self->{'version'} || $DEFAULT{'VERSION'};