line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bio::Roary::ParseGFFAnnotationRole; |
2
|
|
|
|
|
|
|
$Bio::Roary::ParseGFFAnnotationRole::VERSION = '3.11.0'; |
3
|
|
|
|
|
|
|
# ABSTRACT: A role for parsing a gff file efficiently |
4
|
|
|
|
|
|
|
|
5
|
20
|
|
|
20
|
|
13881
|
use Moose::Role; |
|
20
|
|
|
|
|
76849
|
|
|
20
|
|
|
|
|
86
|
|
6
|
20
|
|
|
20
|
|
101436
|
use Bio::Tools::GFF; |
|
20
|
|
|
|
|
46
|
|
|
20
|
|
|
|
|
3110
|
|
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
|
|
375
|
my ($self) = @_; |
16
|
110
|
|
|
|
|
3597
|
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.11.0 |
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 |