File Coverage

lib/Bio/Roary/ParseGFFAnnotationRole.pm
Criterion Covered Total %
statement 8 10 80.0
branch n/a
condition n/a
subroutine 3 4 75.0
pod n/a
total 11 14 78.5


line stmt bran cond sub pod time code
1             package Bio::Roary::ParseGFFAnnotationRole;
2             $Bio::Roary::ParseGFFAnnotationRole::VERSION = '3.10.2';
3             # ABSTRACT: A role for parsing a gff file efficiently
4              
5 20     20   12871 use Moose::Role;
  20         74418  
  20         81  
6 20     20   97272 use Bio::Tools::GFF;
  20         45  
  20         2913  
7              
8             has 'gff_file' => ( is => 'ro', isa => 'Str', required => 1 );
9              
10             has '_tags_to_filter' => ( is => 'ro', isa => 'Str', default => '(CDS|ncRNA|tRNA|tmRNA|rRNA)' );
11             has '_gff_parser' => ( is => 'ro', isa => 'Bio::Tools::GFF', lazy => 1, builder => '_build__gff_parser' );
12             has '_awk_filter' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build__awk_filter' );
13              
14             sub _gff_fh_input_string {
15 110     110   338 my ($self) = @_;
16 110         3698 return 'sed -n \'/##gff-version 3/,/^>/p\' '.$self->gff_file.'| grep -v \'^>\''." | " . $self->_awk_filter;
17             }
18              
19             sub _build__awk_filter {
20 0     0     my ($self) = @_;
21             return
22 0           'awk \'BEGIN {FS="\t"};{ if ($3 ~/'
23             . $self->_tags_to_filter
24             . '/) print $9;}\' ';
25             }
26              
27             1;
28              
29             __END__
30              
31             =pod
32              
33             =encoding UTF-8
34              
35             =head1 NAME
36              
37             Bio::Roary::ParseGFFAnnotationRole - A role for parsing a gff file efficiently
38              
39             =head1 VERSION
40              
41             version 3.10.2
42              
43             =head1 SYNOPSIS
44              
45             with 'Bio::Roary::ParseGFFAnnotationRole';
46              
47             =head1 AUTHOR
48              
49             Andrew J. Page <ap13@sanger.ac.uk>
50              
51             =head1 COPYRIGHT AND LICENSE
52              
53             This software is Copyright (c) 2013 by Wellcome Trust Sanger Institute.
54              
55             This is free software, licensed under:
56              
57             The GNU General Public License, Version 3, June 2007
58              
59             =cut