lib/Bio/Tradis/DetectTags.pm

filter: Statementstmt 77.2% 17 / 22 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 72.4% 21 / 29 CC 2 SCAR 5.9
CC
2
Cov
71%
tags_present
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« blib/lib/Bio/Tradis/TradisPlot.pm ↑ Summary lib/Bio/Tradis/Parser/Fastq.pm »
1 package Bio::Tradis::DetectTags;
2 1 $Bio::Tradis::DetectTags::VERSION = '1.4.1';
3 # ABSTRACT: Detect tr tags in BAM file
4  
5  
6 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 use Bio::Tradis::Parser::Bam
8  
9 1 ▶has 'bamfile' => ( is => 'ro', isa => 'Str', required => 1 );
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 has 'samtools_exec' => ( is => 'rw', isa => 'Str', default => 'samtools' );
11  
12 sub tags_present {
13 1 ▶ my ($self) = @_;
Subroutine tags_present: called CC=2 SCAR=11.1
Pod undocumented
14 1 my $pars = Bio::Tradis::Parser::Bam->new( file => $self->bamfile, samtools_exec => $self->samtools_exec );
15 1 my $read_info = $pars->read_info;
16 1 $pars->next_read;
17 0 $read_info = $pars->read_info;
18 0 ▶ if(defined(${$read_info}{tr}))
Branch: 1 branch
BranchTrueFalseTotal
if (defined do { $read_info }->{'tr'}) { } 0 0 0
19 {
20 0 return 1;
21 }
22 else
23 {
24 0 return 0;
25 }
26
27 }
28  
29 1 __PACKAGE__->meta->make_immutable;
30 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 1 1;
32  
33 __END__
34  
35 =pod
36  
37 =encoding UTF-8
38  
39 =head1 NAME
40  
41 Bio::Tradis::DetectTags - Detect tr tags in BAM file
42  
43 =head1 VERSION
44  
45 version 1.4.1
46  
47 =head1 SYNOPSIS
48  
49 Detects presence of tr/tq tags in BAM files from Tradis analyses
50 use Bio::Tradis::DetectTags;
51  
52 my $pipeline = Bio::Tradis::DetectTags->new(bamfile => 'abc');
53 $pipeline->tags_present();
54  
55 =head1 NAME
56  
57 Bio::Tradis::DetectTags
58  
59 =head1 PARAMETERS
60  
61 =head2 Required
62  
63 C<bamfile> - path to/name of file to check
64  
65 =head1 METHODS
66  
67 C<tags_present> - returns true if TraDIS tags are detected in C<bamfile>
68  
69 =head1 AUTHOR
70  
71 Carla Cummins <path-help@sanger.ac.uk>
72  
73 =head1 COPYRIGHT AND LICENSE
74  
75 This software is Copyright (c) 2013 by Wellcome Trust Sanger Institute.
76  
77 This is free software, licensed under:
78  
79 The GNU General Public License, Version 3, June 2007
80  
81 =cut
« blib/lib/Bio/Tradis/TradisPlot.pm ↑ Summary lib/Bio/Tradis/Parser/Fastq.pm »