| Filename | /Users/ap13/pathogens/Roary/lib/Bio/Roary/GroupLabels.pm |
| Statements | Executed 72886 statements in 124ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 140ms | 220ms | Bio::Roary::GroupLabels::add_labels |
| 1 | 1 | 1 | 40µs | 87µs | Bio::Roary::GroupLabels::_build__input_fh |
| 1 | 1 | 1 | 37µs | 4.01ms | Bio::Roary::GroupLabels::BEGIN@18 |
| 1 | 1 | 1 | 19µs | 334µs | Bio::Roary::GroupLabels::_build__output_fh |
| 1 | 1 | 1 | 10µs | 115µs | Bio::Roary::GroupLabels::BEGIN@59 |
| 1 | 1 | 1 | 8µs | 8µs | Bio::Roary::GroupLabels::BEGIN@19 |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Bio::Roary::GroupLabels; | ||||
| 2 | |||||
| 3 | # ABSTRACT: Add labels to the groups | ||||
| 4 | |||||
| 5 | =head1 SYNOPSIS | ||||
| 6 | |||||
| 7 | Add 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 | |||||
| 18 | 2 | 51µs | 2 | 7.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 # spent 4.01ms making 1 call to Bio::Roary::GroupLabels::BEGIN@18
# spent 3.97ms making 1 call to Moose::import |
| 19 | 2 | 280µs | 1 | 8µ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 # spent 8µs making 1 call to Bio::Roary::GroupLabels::BEGIN@19 |
| 20 | |||||
| 21 | 1 | 2µs | 1 | 1.95ms | has 'groups_filename' => ( is => 'ro', isa => 'Str', required => 1 ); # spent 1.95ms making 1 call to Moose::has |
| 22 | 1 | 2µs | 1 | 1.68ms | has 'output_filename' => ( is => 'ro', isa => 'Str', default => 'labelled_groups_file' ); # spent 1.68ms making 1 call to Moose::has |
| 23 | |||||
| 24 | 1 | 2µs | 1 | 1.60ms | has '_input_fh' => ( is => 'ro', lazy => 1, builder => '_build__input_fh' ); # spent 1.60ms making 1 call to Moose::has |
| 25 | 1 | 2µs | 1 | 1.46ms | has '_output_fh' => ( is => 'ro', lazy => 1, builder => '_build__output_fh' ); # spent 1.46ms making 1 call to Moose::has |
| 26 | 1 | 2µs | 1 | 1.50ms | has '_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] | ||||
| 29 | 3 | 72µs | my ($self) = @_; | ||
| 30 | 2 | 47µ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] | ||||
| 36 | 3 | 325µs | my ($self) = @_; | ||
| 37 | 2 | 315µ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 | ||||
| 44 | 72867 | 123ms | my ($self) = @_; | ||
| 45 | |||||
| 46 | my $counter = 1; | ||||
| 47 | 1 | 115µs | my $in_fh = $self->_input_fh; # spent 115µs making 1 call to Bio::Roary::GroupLabels::_input_fh | ||
| 48 | 1 | 20µs | while (<$in_fh>) { # spent 20µs making 1 call to Bio::Roary::GroupLabels::CORE:readline | ||
| 49 | my $line = $_; | ||||
| 50 | next if ( $line eq "" ); | ||||
| 51 | 54645 | 69.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 | ||
| 52 | 18215 | 10.5ms | $counter++; # spent 10.5ms making 18215 calls to Bio::Roary::GroupLabels::CORE:readline, avg 579ns/call | ||
| 53 | } | ||||
| 54 | 2 | 14µ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 | ||
| 55 | 2 | 206µ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 | |||||
| 59 | 2 | 53µs | 2 | 220µ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 # spent 115µs making 1 call to Bio::Roary::GroupLabels::BEGIN@59
# spent 105µs making 1 call to Moose::unimport |
| 60 | 1 | 6µs | 2 | 4.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 | |||||
| 62 | 1 | 42µs | 1; |