Grep/Filter/FilterRemoveDuplicates.pm

filter: Statementstmt 55.5% 20 / 36 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 6 / 9 Podpod 100% 3 / 3 totaltotal 55.7% 29 / 52 CC 3 SCAR 14.3
CC
3
Cov
50%
filter
12.0
new
2.0
reset_filter
2.0
CRAP 4.2
« Grep.pm ↑ Summary Grep/Backend/Agrep.pm »
1 #############################################################################
2 # $Author: markus $
3 # $Date: 2009-11-12 14:21:37 +0100 (Thu, 12 Nov 2009) $
4 # $Revision: 1843 $
5 #############################################################################
6  
7 package Bio::Grep::Filter::FilterRemoveDuplicates;
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 Bio::Grep::Filter::FilterI;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 2 ▶use base 'Bio::Grep::Filter::FilterI';
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 2 ▶use version; our $VERSION = qv('0.10.6');
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 2 ▶use Class::MethodMaker [
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 new => [qw /new2/],
20 hash => [qw /_ids/],
21 2 ];
22  
23 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
24 0 my $self = shift->new2;
25 0 $self->delete(1);
26 0 $self->supports_alphabet( dna => 1, protein => 1 );
27 0 return $self;
28 }
29  
30 0 ▶sub filter {
Subroutine filter: not called CC=3 SCAR=24.8
Pod documented
31 0 my $self = shift;
32 0 my %ids = $self->_ids;
33 0 my ($id) = $self->search_result->sequence->id =~ m{\A (.*) \. \d+ \z}xms;
34 0 ▶ if ( !defined $id ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $id) 0 0 0
35 0 $id = $self->search_result->sequence->id;
36 }
37 0 ▶ return 0 if defined $ids{$id};
Branch: 1 branch
BranchTrueFalseTotal
if defined $ids{$id} 0 0 0
38 0 $ids{$id} = 1;
39 0 $self->_ids(%ids);
40 0 return 1;
41 }
42  
43 0 ▶sub reset_filter {
Subroutine reset_filter: not called CC=1 SCAR=6.9
Pod documented
44 0 my $self = shift;
45 0 $self->_ids_reset;
46 0 return;
47 }
48 2 1; # Magic true value required at end of module
49 __END__
« Grep.pm ↑ Summary Grep/Backend/Agrep.pm »