lib/Bio/Roary/External/Blastp.pm

filter: Statementstmt 100% 25 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 96.6% 29 / 30 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
_command_to_run
1.0
run
1.0
CRAP 1.0
« lib/Bio/Roary/Output/DifferenceBetweenSets.pm ↑ Summary lib/Bio/Roary/External/Makeblastdb.pm »
1 package Bio::Roary::External::Blastp;
2 4 $Bio::Roary::External::Blastp::VERSION = '3.13.0';
3 # ABSTRACT: Wrapper around NCBIs blastp command
4  
5  
6 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 with 'Bio::Roary::JobRunner::Role';
8  
9 4 has 'fasta_file' => ( is => 'ro', isa => 'Str', required => 1 );
10 4 has 'blast_database' => ( is => 'ro', isa => 'Str', required => 1 );
11 4 has 'exec' => ( is => 'ro', isa => 'Str', default => 'blastp' );
12 4 has '_evalue' => ( is => 'ro', isa => 'Num', default => 1E-6 );
13 4 has '_num_threads' => ( is => 'ro', isa => 'Int', default => 1 );
14 4 has '_max_target_seqs' => ( is => 'ro', isa => 'Int', default => 2000 );
15 4 has '_logging' => ( is => 'ro', isa => 'Str', default => '2> /dev/null' );
16 4 has 'output_file' => ( is => 'ro', isa => 'Str', default => 'results.out' );
17 4 has 'perc_identity' => ( is => 'ro', isa => 'Num', default => 98 );
18  
19 9 ▶sub _command_to_run {
Subroutine _command_to_run: called CC=1 SCAR=0.0
20 9 my ($self) = @_;
21 9 return join(
22 " ",
23 (
24 $self->exec,
25 '-query', $self->fasta_file,
26 '-db', $self->blast_database,
27 '-evalue', $self->_evalue,
28 '-num_threads', $self->_num_threads,
29 '-outfmt 6',
30 '-max_target_seqs', $self->_max_target_seqs,
31 ' | awk \'{ if ($3 > '.$self->perc_identity.') print $0;}\'',
32 $self->_logging, '1> ', $self->output_file,
33 )
34
35
36 );
37 }
38  
39 1 ▶sub run {
Subroutine run: called CC=1 SCAR=0.0
Pod undocumented
40 1 my ($self) = @_;
41 1 $self->logger->info( "Running command: " . $self->_command_to_run() );
42 1 system( $self->_command_to_run );
43 1 1;
44 }
45  
46 4 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
47 4 __PACKAGE__->meta->make_immutable;
48 4 1;
49  
50 __END__
« lib/Bio/Roary/Output/DifferenceBetweenSets.pm ↑ Summary lib/Bio/Roary/External/Makeblastdb.pm »