blib/lib/Bio/Tools/Run/BlastPlus.pm

filter: Statementstmt 61.7% 29 / 47 Branchbran 0.0% 0 / 12 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 9 / 12 Podpod 100% 3 / 3 totaltotal 53.1% 42 / 79 CC 8 SCAR 18.4
CC
8
Cov
48%
program_version
12.0
package_version
12.0
_version
12.0
CRAP 6.3
« blib/lib/Bio/Tools/Run/Phylo/Phylip/Base.pm ↑ Summary blib/lib/Bio/DB/SoapEUtilities/LinkAdaptor.pm »
1 # $Id$
2 #
3 # BioPerl module for Bio::Tools::Run::BlastPlus
4 #
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 #
7 # Cared for by Mark A. Jensen <maj -at- fortinbras -dot- us>
8 #
9 # Copyright Mark A. Jensen
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::BlastPlus - A wrapper for NCBI's blast+ suite
18  
19 =head1 SYNOPSIS
20  
21 Give standard usage here
22  
23 =head1 DESCRIPTION
24  
25 Blast+ is NCBI's successor to the C<blastall> family of programs.
26  
27 =head1 FEEDBACK
28  
29 =head2 Mailing Lists
30  
31 User feedback is an integral part of the evolution of this and other
32 Bioperl modules. Send your comments and suggestions preferably to
33 the Bioperl mailing list. Your participation is much appreciated.
34  
35 bioperl-l@bioperl.org - General discussion
36 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
37  
38 =head2 Support
39  
40 Please direct usage questions or support issues to the mailing list:
41  
42 L<bioperl-l@bioperl.org>
43  
44 rather than to the module maintainer directly. Many experienced and
45 reponsive experts will be able look at the problem and quickly
46 address it. Please include a thorough description of the problem
47 with code and data examples if at all possible.
48  
49 =head2 Reporting Bugs
50  
51 Report bugs to the Bioperl bug tracking system to help us keep track
52 of the bugs and their resolution. Bug reports can be submitted via
53 the web:
54  
55 http://redmine.open-bio.org/projects/bioperl/
56  
57 =head1 AUTHOR - Mark A. Jensen
58  
59 Email maj -at- fortinbras -dot- us
60  
61 Describe contact details here
62  
63 =head1 CONTRIBUTORS
64  
65 Additional contributors names and emails here
66  
67 =head1 APPENDIX
68  
69 The rest of the documentation details each of the object methods.
70 Internal methods are usually preceded with a _
71  
72 =cut
73  
74 # Let the code begin...
75  
76  
77 package Bio::Tools::Run::BlastPlus;
78 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
79 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
80  
81 1 ▶use lib '../../..';
Subroutine BEGIN: called CC=1 SCAR=0.0
82 1 ▶use Bio::Root::Root;
Subroutine BEGIN: called CC=1 SCAR=0.0
83 1 ▶use Bio::Tools::Run::BlastPlus::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
84 1 ▶use Bio::Tools::Run::WrapperBase;
Subroutine BEGIN: called CC=1 SCAR=0.0
85 1 ▶use Bio::Tools::Run::WrapperBase::CommandExts;
Subroutine BEGIN: called CC=1 SCAR=0.0
86  
87 1 ▶use base qw(Bio::Tools::Run::WrapperBase Bio::Root::Root);
Subroutine BEGIN: called CC=1 SCAR=0.0
88  
89 =head2 new
90  
91 Title : new
92 Usage : my $obj = new Bio::Tools::Run::BlastPlus();
93 Function: Builds a new Bio::Tools::Run::BlastPlus object
94 Returns : an instance of Bio::Tools::Run::BlastPlus
95 Args :
96  
97 =cut
98  
99 sub new {
100 1 ▶ my ($class,@args) = @_;
Subroutine new: called CC=2 SCAR=7.4
Pod documented
101 1 ▶ $program_dir ||= $ENV{BLASTPLUSDIR};
Condition33%1/3
$Bio::Tools::Run::BlastPlus::program_dir ||= $ENV{"BLASTPLUSDIR"}
l!l&&r!l&&!r
001
MC/DC0%0/2
$Bio::Tools::Run::BlastPlus::program_dir ||= $ENV{"BLASTPLUSDIR"}
$Bio::Tools::Run::BlastPlus::program_dir $ENV{"BLASTPLUSDIR"}
Truth table33%1/3
A ||= B
A= $Bio::Tools::Run::BlastPlus::program_dirB= $ENV{"BLASTPLUSDIR"}
ABresult
1X1
011
000
102 1 my $self = $class->SUPER::new(@args);
103 1 return $self;
104 }
105  
106 =head2 program_version()
107  
108 Title : program_version
109 Usage : $version = $bedtools_fac->program_version()
110 Function: Returns the program version (if available)
111 Returns : string representing location and version of the program
112 Note : this works around the WrapperBase::version() method conflicting with
113 the -version parameter for SABlast (good argument for not having
114 getter/setters for these)
115  
116 =cut
117  
118 =head2 package_version()
119  
120 Title : package_version
121 Usage : $version = $bedtools_fac->version()
122 Function: Returns the BLAST+ package version (if available)
123 Returns : string representing BLAST+ package version (may differ from version())
124  
125 =cut
126  
127 sub program_version {
128 0 ▶ my ($self) = @_;
Subroutine program_version: not called CC=3 SCAR=24.8
Pod documented
129 0 ▶ if (!defined $self->{program_version}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"program_version"}) 0 0 0
130 0 $self->_version;
131 }
132 0 ▶ $self->{program_version} || '';
Branch: 1 branch
BranchTrueFalseTotal
$self->{"program_version"} or "" 0 0 0
133 }
134  
135 sub package_version {
136 0 ▶ my ($self) = @_;
Subroutine package_version: not called CC=3 SCAR=24.8
Pod documented
137 0 ▶ if (!defined $self->{package_version}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"package_version"}) 0 0 0
138 0 $self->_version;
139 }
140 0 ▶ $self->{package_version} || '';
Branch: 1 branch
BranchTrueFalseTotal
$self->{"package_version"} or "" 0 0 0
141 }
142  
143 sub _version {
144 0 ▶ my $self = shift;
Subroutine _version: not called CC=3 SCAR=24.8
145 0 my ($in, $out, $err);
146  
147 # Get program executable
148 0 my $exe = $self->executable;
149 0 my @ipc_args = ( $exe, '-version');
150
151 0 eval {
152 0 ▶ IPC::Run::run(\@ipc_args, \$in, \$out, \$err) or
Branch: 1 branch
BranchTrueFalseTotal
IPC::Run::run(\@ipc_args, \$in, \$out, \$err) or die "There was a problem running $exe : $!" 0 0 0
153 die ("There was a problem running $exe : $!");
154 };
155
156 0 ▶ if ($out =~ /blastdbcmd\:\s+(\S+)\nPackage\:\s+([^,]+)/xms) {
Branch: 1 branch
BranchTrueFalseTotal
if ($out =~ /blastdbcmd\:\s+(\S+)\nPackage\:\s+([^,]+)/msx) { } 0 0 0
157 0 @{$self}{qw(program_version package_version)} = ($1, $2);
158 } else {
159 0 $self->throw("Unknown version output: $out");
160 }
161 }
162  
163 1 1;
« blib/lib/Bio/Tools/Run/Phylo/Phylip/Base.pm ↑ Summary blib/lib/Bio/DB/SoapEUtilities/LinkAdaptor.pm »