Profile of lib/Bio/Roary/GeneNamesFromGFF.pm

← Index
NYTProf Performance Profile «block view•line view•sub view»
For bin/pan_genome_post_analysis
Run on Fri Mar 27 11:43:32 2015
Reported on Fri Mar 27 11:46:07 2015

Filename | /Users/ap13/pathogens/Roary/lib/Bio/Roary/GeneNamesFromGFF.pm
Statements | Executed 511423 statements in 1.47s

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
8 | 1 | 1 | 855ms | 1.66s | Bio::Roary::GeneNamesFromGFF::::_build_ids_to_gene_nameBio::Roary::GeneNamesFromGFF::_build_ids_to_gene_name
1 | 1 | 1 | 4.47ms | 91.2ms | Bio::Roary::GeneNamesFromGFF::::BEGIN@19Bio::Roary::GeneNamesFromGFF::BEGIN@19
8 | 1 | 1 | 58µs | 58µs | Bio::Roary::GeneNamesFromGFF::::__ANON__[lib/Bio/Roary/GeneNamesFromGFF.pm:23]Bio::Roary::GeneNamesFromGFF::__ANON__[lib/Bio/Roary/GeneNamesFromGFF.pm:23]
1 | 1 | 1 | 44µs | 4.98ms | Bio::Roary::GeneNamesFromGFF::::BEGIN@17Bio::Roary::GeneNamesFromGFF::BEGIN@17
1 | 1 | 1 | 12µs | 116µs | Bio::Roary::GeneNamesFromGFF::::BEGIN@65Bio::Roary::GeneNamesFromGFF::BEGIN@65

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package Bio::Roary::GeneNamesFromGFF;
2 |  |  |  |  |
3 |  |  |  |  | # ABSTRACT: Parse a GFF and efficiently extract ID -> Gene Name
4 |  |  |  |  |
5 |  |  |  |  | =head1 SYNOPSIS
6 |  |  |  |  |
7 |  |  |  |  | Parse a GFF and efficiently extract ID -> Gene Name
8 |  |  |  |  | use Bio::Roary::GeneNamesFromGFF;
9 |  |  |  |  |
10 |  |  |  |  | my $obj = Bio::Roary::GeneNamesFromGFF->new(
11 |  |  |  |  | gff_file => 'abc.gff'
12 |  |  |  |  | );
13 |  |  |  |  | $obj->ids_to_gene_name;
14 |  |  |  |  |
15 |  |  |  |  | =cut
16 |  |  |  |  |
17 | 2 | 89µs | 2 | 9.92ms | # spent 4.98ms (44µs+4.94) within Bio::Roary::GeneNamesFromGFF::BEGIN@17 which was called: # once (44µs+4.94ms) by Bio::Roary::AnnotateGroups::BEGIN@21 at line 17 use Moose; # spent 4.98ms making 1 call to Bio::Roary::GeneNamesFromGFF::BEGIN@17 # spent 4.94ms making 1 call to Moose::import
18 |  |  |  |  |
19 | 2 | 535µs | 1 | 91.2ms | # spent 91.2ms (4.47+86.7) within Bio::Roary::GeneNamesFromGFF::BEGIN@19 which was called: # once (4.47ms+86.7ms) by Bio::Roary::AnnotateGroups::BEGIN@21 at line 19 use Bio::Tools::GFF; # spent 91.2ms making 1 call to Bio::Roary::GeneNamesFromGFF::BEGIN@19
20 | 1 | 3µs | 1 | 15.4ms | with 'Bio::Roary::ParseGFFAnnotationRole'; # spent 15.4ms making 1 call to Moose::with
21 |  |  |  |  |
22 | 1 | 4µs | 1 | 2.54ms | has 'ids_to_gene_name' => ( is => 'ro', isa => 'HashRef', lazy => 1, builder => '_build_ids_to_gene_name' ); # spent 2.54ms making 1 call to Moose::has
23 | 9 | 54µs | 1 | 1.93ms | # spent 58µs within Bio::Roary::GeneNamesFromGFF::__ANON__[lib/Bio/Roary/GeneNamesFromGFF.pm:23] which was called 8 times, avg 7µs/call: # 8 times (58µs+0s) by Bio::Roary::GeneNamesFromGFF::new at line 90 of (eval 25)[Eval/Closure.pm:125], avg 7µs/call has 'ids_to_product' => ( is => 'rw', isa => 'HashRef', default => sub { {} } ); # spent 1.93ms making 1 call to Moose::has
24 |  |  |  |  |
25 |  |  |  |  | #Ā Parsing with the perl GFF module is exceptionally slow.
26 |  |  |  |  | # spent 1.66s (855ms+809ms) within Bio::Roary::GeneNamesFromGFF::_build_ids_to_gene_name which was called 8 times, avg 208ms/call: # 8 times (855ms+809ms) by Bio::Roary::GeneNamesFromGFF::ids_to_gene_name at line 12 of (eval 25)[Eval/Closure.pm:125], avg 208ms/call sub _build_ids_to_gene_name {
27 | 8 | 12µs |  |  | my ($self) = @_;
28 | 8 | 6µs |  |  | my %id_to_gene_name;
29 |  |  |  |  |
30 | 8 | 17.2ms | 16 | 17.1ms | open( my $fh, '-|', $self->_gff_fh_input_string ) or die "Couldnt open GFF file"; # spent 16.6ms making 8 calls to Bio::Roary::GeneNamesFromGFF::CORE:open, avg 2.07ms/call # spent 506µs making 8 calls to Bio::Roary::ParseGFFAnnotationRole::_gff_fh_input_string, avg 63µs/call
31 | 8 | 227ms | 8 | 226ms | while(<$fh>) # spent 226ms making 8 calls to Bio::Roary::GeneNamesFromGFF::CORE:readline, avg 28.3ms/call
32 |  |  |  |  | {
33 | 40008 | 7.72ms |  |  | chomp;
34 | 40008 | 11.3ms |  |  | my $line = $_;
35 | 40008 | 2.48ms |  |  | my $id_name;
36 | 40008 | 168ms | 40008 | 90.5ms | if($line =~/ID=["']?([^;"']+)["']?;?/i) # spent 90.5ms making 40008 calls to Bio::Roary::GeneNamesFromGFF::CORE:match, avg 2µs/call
37 |  |  |  |  | {
38 | 40008 | 29.6ms |  |  | $id_name = $1;
39 | 40008 | 90.2ms | 40008 | 16.6ms | $id_name =~ s!"!!g; # spent 16.6ms making 40008 calls to Bio::Roary::GeneNamesFromGFF::CORE:subst, avg 415ns/call
40 |  |  |  |  | }
41 |  |  |  |  | else
42 |  |  |  |  | {
43 |  |  |  |  | next;
44 |  |  |  |  | }
45 |  |  |  |  |
46 | 40008 | 135ms | 40008 | 65.9ms | if($line =~/gene=["']?([^;"']+)["']?;?/i) # spent 65.9ms making 40008 calls to Bio::Roary::GeneNamesFromGFF::CORE:match, avg 2µs/call
47 |  |  |  |  | {
48 | 27819 | 18.4ms |  |  | my $gene_name = $1;
49 | 27819 | 53.3ms | 27819 | 9.20ms | $gene_name =~ s!"!!g; # spent 9.20ms making 27819 calls to Bio::Roary::GeneNamesFromGFF::CORE:subst, avg 331ns/call
50 | 27819 | 4.86ms |  |  | next if ( $gene_name eq "" );
51 | 27819 | 62.9ms |  |  | $id_to_gene_name{$id_name} = $gene_name;
52 |  |  |  |  | }
53 |  |  |  |  |
54 | 40008 | 461ms | 80016 | 294ms | if($line =~/product=["']?([^;,"']+)[,"']?;?/i) # spent 180ms making 40008 calls to Bio::Roary::GeneNamesFromGFF::CORE:readline, avg 5µs/call # spent 114ms making 40008 calls to Bio::Roary::GeneNamesFromGFF::CORE:match, avg 3µs/call
55 |  |  |  |  | {
56 | 40008 | 28.2ms |  |  | my $product = $1;
57 | 40008 | 150ms | 40008 | 88.2ms | $self->ids_to_product->{$id_name} = $product; # spent 88.2ms making 40008 calls to Bio::Roary::GeneNamesFromGFF::ids_to_product, avg 2µs/call
58 |  |  |  |  | }
59 |  |  |  |  |
60 |  |  |  |  | }
61 | 8 | 409µs | 8 | 329µs | close($fh); # spent 329µs making 8 calls to Bio::Roary::GeneNamesFromGFF::CORE:close, avg 41µs/call
62 | 8 | 278µs |  |  | return \%id_to_gene_name;
63 |  |  |  |  | }
64 |  |  |  |  |
65 | 2 | 41µs | 2 | 220µs | # spent 116µs (12+104) within Bio::Roary::GeneNamesFromGFF::BEGIN@65 which was called: # once (12µs+104µs) by Bio::Roary::AnnotateGroups::BEGIN@21 at line 65 no Moose; # spent 116µs making 1 call to Bio::Roary::GeneNamesFromGFF::BEGIN@65 # spent 104µs making 1 call to Moose::unimport
66 | 1 | 6µs | 2 | 5.47ms | __PACKAGE__->meta->make_immutable; # spent 5.46ms making 1 call to Class::MOP::Class::make_immutable # spent 15µs making 1 call to Bio::Roary::GeneNamesFromGFF::meta
67 |  |  |  |  |
68 | 1 | 31µs |  |  | 1;