blib/lib/Bio/Tradis/DetectTags.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 27 CC 2 SCAR 12.8
CC
2
Cov
0%
tags_present
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.6
1 package Bio::Tradis::DetectTags;
2  
3 # ABSTRACT: Detect tr tags in BAM file
4  
5  
6 use Moose;
7 use Bio::DB::Sam;
8  
9 has 'bamfile' => ( is => 'ro', isa => 'Str', required => 1 );
10  
11 sub tags_present {
12 my ($self) = @_;
13 my $bam = Bio::DB::Bam->open( $self->bamfile );
14 my $header = $bam->header;
15 my $a = $bam->read1;
16 my $tr = $a->get_tag_values('tr');
17 if ( defined($tr) ) { return 1; }
18 else { return 0; }
19 }
20  
21 __PACKAGE__->meta->make_immutable;
22 no Moose;
23 1;
24  
25 __END__
26  
27 =pod
28  
29 =head1 NAME
30  
31 Bio::Tradis::DetectTags - Detect tr tags in BAM file
32  
33 =head1 VERSION
34  
35 version 1.132190
36  
37 =head1 SYNOPSIS
38  
39 Detects presence of tr/tq tags in BAM files from Tradis analyses
40 use Bio::Tradis::DetectTags;
41  
42 my $pipeline = Bio::Tradis::DetectTags->new(bamfile => 'abc');
43 $pipeline->tags_present();
44  
45 =head1 NAME
46  
47 Bio::Tradis::DetectTags
48  
49 =head1 PARAMETERS
50  
51 =head2 Required
52  
53 C<bamfile> - path to/name of file to check
54  
55 =head1 METHODS
56  
57 C<tags_present> - returns true if TraDIS tags are detected in C<bamfile>
58  
59 =head1 AUTHOR
60  
61 Carla Cummins <cc21@sanger.ac.uk>
62  
63 =head1 COPYRIGHT AND LICENSE
64  
65 This software is Copyright (c) 2013 by Wellcome Trust Sanger Institute.
66  
67 This is free software, licensed under:
68  
69 The GNU General Public License, Version 3, June 2007
70  
71 =cut