← 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:45:27 2015

Filename/Users/ap13/pathogens/Roary/lib/Bio/Roary/GeneNamesFromGFF.pm
StatementsExecuted 511423 statements in 1.47s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
811855ms1.66sBio::Roary::GeneNamesFromGFF::::_build_ids_to_gene_nameBio::Roary::GeneNamesFromGFF::_build_ids_to_gene_name
1114.47ms91.2msBio::Roary::GeneNamesFromGFF::::BEGIN@19Bio::Roary::GeneNamesFromGFF::BEGIN@19
81158µs58µsBio::Roary::GeneNamesFromGFF::::__ANON__[lib/Bio/Roary/GeneNamesFromGFF.pm:23]Bio::Roary::GeneNamesFromGFF::__ANON__[lib/Bio/Roary/GeneNamesFromGFF.pm:23]
11144µs4.98msBio::Roary::GeneNamesFromGFF::::BEGIN@17Bio::Roary::GeneNamesFromGFF::BEGIN@17
11112µs116µsBio::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
1package Bio::Roary::GeneNamesFromGFF;
2
3# ABSTRACT: Parse a GFF and efficiently extract ID -> Gene Name
4
5=head1 SYNOPSIS
6
7Parse 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
17289µs29.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
192535µs191.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
2013µs115.4mswith 'Bio::Roary::ParseGFFAnnotationRole';
# spent 15.4ms making 1 call to Moose::with
21
2214µs12.54mshas '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
23954µs11.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 {
275114041.47s my ($self) = @_;
28 my %id_to_gene_name;
29
301617.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
318226ms while(<$fh>)
# spent 226ms making 8 calls to Bio::Roary::GeneNamesFromGFF::CORE:readline, avg 28.3ms/call
32 {
33 chomp;
34 my $line = $_;
35 my $id_name;
364000890.5ms if($line =~/ID=["']?([^;"']+)["']?;?/i)
# spent 90.5ms making 40008 calls to Bio::Roary::GeneNamesFromGFF::CORE:match, avg 2µs/call
37 {
38 $id_name = $1;
394000816.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
464000865.9ms if($line =~/gene=["']?([^;"']+)["']?;?/i)
# spent 65.9ms making 40008 calls to Bio::Roary::GeneNamesFromGFF::CORE:match, avg 2µs/call
47 {
48 my $gene_name = $1;
49278199.20ms $gene_name =~ s!"!!g;
# spent 9.20ms making 27819 calls to Bio::Roary::GeneNamesFromGFF::CORE:subst, avg 331ns/call
50 next if ( $gene_name eq "" );
51 $id_to_gene_name{$id_name} = $gene_name;
52 }
53
5480016294ms 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 my $product = $1;
574000888.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 }
618329µs close($fh);
# spent 329µs making 8 calls to Bio::Roary::GeneNamesFromGFF::CORE:close, avg 41µs/call
62 return \%id_to_gene_name;
63}
64
65241µs2220µ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
6616µs25.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
68131µs1;