File Coverage

blib/lib/Bio/Tools/Run/Phylo/Phylip/Base.pm
Criterion Covered Total %
statement 23 36 63.8
branch 3 12 25.0
condition 1 14 7.1
subroutine 8 12 66.6
pod 5 5 100.0
total 40 79 50.6


line stmt bran cond sub pod time code
1             # $Id $
2             #
3             # BioPerl module for Bio::Tools::Run::Phylo::Phylip::Base
4             #
5             # Please direct questions and support issues to
6             #
7             # Cared for by Jason Stajich
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              
17             Bio::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              
27             This module is just a base object for Bioperl Phylip wrappers.
28              
29             IMPORTANT PHYLIP VERSION ISSUES
30             By default we assume you have Phylip 3.6 installed, if you
31             have installed Phylip 3.5 you need to set the environment variable
32             PHYLIPVERSION
33              
34              
35             =head1 FEEDBACK
36              
37             =head2 Mailing Lists
38              
39             User feedback is an integral part of the evolution of this and other
40             Bioperl modules. Send your comments and suggestions preferably to
41             the 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              
48             Please direct usage questions or support issues to the mailing list:
49              
50             I
51              
52             rather than to the module maintainer directly. Many experienced and
53             reponsive experts will be able look at the problem and quickly
54             address it. Please include a thorough description of the problem
55             with code and data examples if at all possible.
56              
57             =head2 Reporting Bugs
58              
59             Report bugs to the Bioperl bug tracking system to help us keep track
60             of the bugs and their resolution. Bug reports can be submitted via the
61             web:
62              
63             http://redmine.open-bio.org/projects/bioperl/
64              
65             =head1 AUTHOR - Jason Stajich
66              
67             Email jason-at-bioperl.org
68              
69             =head1 APPENDIX
70              
71             The rest of the documentation details each of the object methods.
72             Internal methods are usually preceded with a _
73              
74             =cut
75              
76              
77             # Let the code begin...
78              
79              
80             package Bio::Tools::Run::Phylo::Phylip::Base;
81 7     7   27 use vars qw(@ISA %DEFAULT %FILENAME);
  7         9  
  7         353  
82 7     7   26 use strict;
  7         10  
  7         273  
83              
84             BEGIN {
85 7     7   9 eval { require File::Spec };
  7         23  
86 7 50       116 if( $@) { Bio::Root::RootI->throw("Must have installed File::Spec to run Bio::Tools::Run::Phylo::Phylip tools");
  0         0  
87             }
88            
89             }
90              
91 7     7   1030 use Bio::Root::Root;
  7         38196  
  7         185  
92 7     7   2624 use Bio::Tools::Run::WrapperBase;
  7         8  
  7         169  
93 7     7   2677 use Bio::Tools::Run::Phylo::Phylip::PhylipConf;
  7         12  
  7         517  
94             @ISA = qw(Bio::Root::Root Bio::Tools::Run::WrapperBase);
95              
96             BEGIN {
97             %DEFAULT = (
98 7   50 7   61 'VERSION' => $ENV{'PHYLIPVERSION'} || '3.6',
99             );
100 7         1470 %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              
128             sub outfile{
129 0     0 1 0 my $self = shift;
130 0 0       0 $self->{'_outfile'} = shift if @_;
131 0   0     0 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              
146             sub treefile{
147 0     0 1 0 my $self = shift;
148 0 0       0 $self->{'_treefile'} = shift if @_;
149 0   0     0 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              
164             sub fontfile{
165 4     4 1 5 my $self = shift;
166              
167 4 100       14 return $self->{'fontfile'} = shift if @_;
168 2         12 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              
182             sub plotfile {
183 0     0 1   my $self = shift;
184              
185 0 0         return $self->{'plotfile'} = shift if @_;
186 0   0       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              
200             sub version {
201 0     0 1   my $self = shift;
202              
203 0 0         return $self->{'version'} = shift if @_;
204 0   0       return $self->{'version'} || $DEFAULT{'VERSION'};
205             }
206             1;