← 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:42 2015

Filename/Users/ap13/pathogens/Roary/lib/Bio/Roary/GroupLabels.pm
StatementsExecuted 72886 statements in 124ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111140ms220msBio::Roary::GroupLabels::::add_labelsBio::Roary::GroupLabels::add_labels
11140µs87µsBio::Roary::GroupLabels::::_build__input_fhBio::Roary::GroupLabels::_build__input_fh
11137µs4.01msBio::Roary::GroupLabels::::BEGIN@18Bio::Roary::GroupLabels::BEGIN@18
11119µs334µsBio::Roary::GroupLabels::::_build__output_fhBio::Roary::GroupLabels::_build__output_fh
11110µs115µsBio::Roary::GroupLabels::::BEGIN@59Bio::Roary::GroupLabels::BEGIN@59
1118µs8µsBio::Roary::GroupLabels::::BEGIN@19Bio::Roary::GroupLabels::BEGIN@19
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::GroupLabels;
2
3# ABSTRACT: Add labels to the groups
4
5=head1 SYNOPSIS
6
7Add labels to the groups
8 use Bio::Roary::GroupLabels;
9
10 my $obj = Bio::Roary::GroupLabels->new(
11 groups_filename => 'abc.groups',
12 output_filename => 'output.groups'
13 );
14 $obj->add_labels;
15
16=cut
17
18251µs27.99ms
# spent 4.01ms (37µs+3.97) within Bio::Roary::GroupLabels::BEGIN@18 which was called: # once (37µs+3.97ms) by Bio::Roary::PostAnalysis::BEGIN@15 at line 18
use Moose;
# spent 4.01ms making 1 call to Bio::Roary::GroupLabels::BEGIN@18 # spent 3.97ms making 1 call to Moose::import
192280µs18µs
# spent 8µs within Bio::Roary::GroupLabels::BEGIN@19 which was called: # once (8µs+0s) by Bio::Roary::PostAnalysis::BEGIN@15 at line 19
use Bio::Roary::Exceptions;
# spent 8µs making 1 call to Bio::Roary::GroupLabels::BEGIN@19
20
2112µs11.95mshas 'groups_filename' => ( is => 'ro', isa => 'Str', required => 1 );
# spent 1.95ms making 1 call to Moose::has
2212µs11.68mshas 'output_filename' => ( is => 'ro', isa => 'Str', default => 'labelled_groups_file' );
# spent 1.68ms making 1 call to Moose::has
23
2412µs11.60mshas '_input_fh' => ( is => 'ro', lazy => 1, builder => '_build__input_fh' );
# spent 1.60ms making 1 call to Moose::has
2512µs11.46mshas '_output_fh' => ( is => 'ro', lazy => 1, builder => '_build__output_fh' );
# spent 1.46ms making 1 call to Moose::has
2612µs11.50mshas '_group_default_prefix' => ( is => 'ro', isa => 'Str', default => 'group_' );
# spent 1.50ms making 1 call to Moose::has
27
28
# spent 87µs (40+47) within Bio::Roary::GroupLabels::_build__input_fh which was called: # once (40µs+47µs) by Bio::Roary::GroupLabels::_input_fh at line 11 of (eval 25)[Eval/Closure.pm:125]
sub _build__input_fh {
29372µs my ($self) = @_;
30247µs open( my $fh, $self->groups_filename )
# spent 39µs making 1 call to Bio::Roary::GroupLabels::CORE:open # spent 8µs making 1 call to Bio::Roary::GroupLabels::groups_filename
31 or Bio::Roary::Exceptions::FileNotFound->throw( error => "Group file not found:" . $self->groups_filename );
32 return $fh;
33}
34
35
# spent 334µs (19+315) within Bio::Roary::GroupLabels::_build__output_fh which was called: # once (19µs+315µs) by Bio::Roary::GroupLabels::_output_fh at line 11 of (eval 25)[Eval/Closure.pm:125]
sub _build__output_fh {
363325µs my ($self) = @_;
372315µs open( my $fh, '>', $self->output_filename )
# spent 311µs making 1 call to Bio::Roary::GroupLabels::CORE:open # spent 3µs making 1 call to Bio::Roary::GroupLabels::output_filename
38 or Bio::Roary::Exceptions::CouldntWriteToFile->throw(
39 error => "Couldnt write output file:" . $self->output_filename );
40 return $fh;
41}
42
43
# spent 220ms (140+80.5) within Bio::Roary::GroupLabels::add_labels which was called: # once (140ms+80.5ms) by Bio::Roary::PostAnalysis::run at line 74 of lib/Bio/Roary/PostAnalysis.pm
sub add_labels {
447293µs my ($self) = @_;
45
46 my $counter = 1;
471115µs my $in_fh = $self->_input_fh;
# spent 115µs making 1 call to Bio::Roary::GroupLabels::_input_fh
48120µs while (<$in_fh>) {
# spent 20µs making 1 call to Bio::Roary::GroupLabels::CORE:readline
4972860123ms my $line = $_;
50 next if ( $line eq "" );
515464569.6ms print { $self->_output_fh } $self->_group_default_prefix . $counter . ": " . $line;
# spent 32.2ms making 18215 calls to Bio::Roary::GroupLabels::_output_fh, avg 2µs/call # spent 28.0ms making 18215 calls to Bio::Roary::GroupLabels::_group_default_prefix, avg 2µs/call # spent 9.42ms making 18215 calls to Bio::Roary::GroupLabels::CORE:print, avg 517ns/call
521821510.5ms $counter++;
# spent 10.5ms making 18215 calls to Bio::Roary::GroupLabels::CORE:readline, avg 579ns/call
53 }
54214µs close( $self->_input_fh );
# spent 10µs making 1 call to Bio::Roary::GroupLabels::CORE:close # spent 4µs making 1 call to Bio::Roary::GroupLabels::_input_fh
552206µs close( $self->_output_fh );
# spent 204µs making 1 call to Bio::Roary::GroupLabels::CORE:close # spent 2µs making 1 call to Bio::Roary::GroupLabels::_output_fh
56 return 1;
57}
58
59253µs2220µs
# spent 115µs (10+105) within Bio::Roary::GroupLabels::BEGIN@59 which was called: # once (10µs+105µs) by Bio::Roary::PostAnalysis::BEGIN@15 at line 59
no Moose;
# spent 115µs making 1 call to Bio::Roary::GroupLabels::BEGIN@59 # spent 105µs making 1 call to Moose::unimport
6016µs24.32ms__PACKAGE__->meta->make_immutable;
# spent 4.31ms making 1 call to Class::MOP::Class::make_immutable # spent 15µs making 1 call to Bio::Roary::GroupLabels::meta
61
62142µs1;