Grep/SearchSettings.pm

filter: Statementstmt 34.4% 20 / 58 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 6 / 10 Podpod 100% 3 / 3 totaltotal 38.6% 29 / 75 CC 4 SCAR 19.6
CC
4
Cov
32%
set_attributes
20.0
new
2.0
_init
2.0
CRAP 7.1
« Grep/SearchResult.pm ↑ Summary Grep.pm »
1 #############################################################################
2 # $Author: markus $
3 # $Date: 2009-11-12 17:13:23 +0100 (Thu, 12 Nov 2009) $
4 # $Revision: 1844 $
5 #############################################################################
6  
7 package Bio::Grep::SearchSettings;
8  
9 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 2 ▶use Scalar::Util qw(reftype);
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 2 ▶use version; our $VERSION = qv('0.10.6');
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 2 ▶use Class::MethodMaker [
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 new => 'new2',
19 scalar => [
20 qw /mismatches insertions deletions editdistance query query_length
21 _real_query gumismatches upstream downstream maxhits no_alignments
22 datapath database online tmppath execpath reverse_complement direct_and_rev_com
23 sort complete query_file showdesc qspeedup hxdrop exdrop/
24 ],
25 array => [qw /filters/],
26 2 ];
27  
28 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
29 0 my $self = shift->new2;
30  
31 # initialize standard settings
32 0 $self->_init();
33 0 return $self;
34 }
35  
36 0 ▶sub _init {
Subroutine _init: not called CC=1 SCAR=6.9
37 0 my ($self) = @_;
38 0 $self->mismatches(0);
39 0 $self->insertions(0);
40 0 $self->deletions(0);
41 0 $self->editdistance_reset;
42 0 $self->gumismatches(1);
43 0 $self->no_alignments(0);
44 0 $self->upstream(0);
45 0 $self->downstream(0);
46 0 $self->reverse_complement(0);
47 0 $self->direct_and_rev_com(0);
48 0 $self->query_reset;
49 0 $self->query_file_reset;
50 0 $self->online_reset;
51 0 $self->sort_reset;
52 0 $self->complete_reset;
53 0 $self->query_length_reset;
54 0 $self->maxhits_reset;
55 0 $self->showdesc_reset;
56 0 $self->qspeedup_reset;
57 0 return;
58 }
59  
60 0 ▶sub set_attributes {
Subroutine set_attributes: not called CC=4 SCAR=30.0
Pod documented
61 0 my ( $self, $arg_ref ) = @_;
62  
63 # set default values first
64 0 $self->_init();
65 0 for my $key ( keys %{$arg_ref} ) {
66 0 my $rt = reftype $arg_ref->{$key};
67 0 ▶ if ( defined $rt ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $rt) { } 0 0 0
68 0 ▶ if ( $rt eq 'ARRAY' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($rt eq 'ARRAY') { } 0 0 0
69 0 $self->$key( @{ $arg_ref->{$key} } );
70 }
71 else {
72 0 $self->$key( $arg_ref->{$key} );
73 }
74 }
75 else {
76 0 $self->$key( $arg_ref->{$key} );
77 }
78 }
79 0 return;
80 }
81  
82 0 ▶sub to_string {
Subroutine to_string: not called CC=1 SCAR=6.9
Pod documented
83 0 my $self = shift;
84 0 return Data::Dumper->Dump( [$self] );
85 }
86 2 1; # Magic true value required at end of module
87 __END__
« Grep/SearchResult.pm ↑ Summary Grep.pm »