Filename | /Users/ap13/pathogens/Roary/lib/Bio/Roary/GroupStatistics.pm |
Statements | Executed 1632953 statements in 2.72s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
18215 | 1 | 1 | 1.73s | 8.87s | _row | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 1.05s | 1.52s | _build__groups_to_files | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 452ms | 17.9s | create_spreadsheet | Bio::Roary::GroupStatistics::
18215 | 1 | 1 | 375ms | 2.11s | _non_unique_name_for_group | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 168ms | 200ms | _build__files_to_groups | Bio::Roary::GroupStatistics::
2 | 2 | 1 | 80.3ms | 80.3ms | CORE:sort (opcode) | Bio::Roary::GroupStatistics::
32985 | 2 | 1 | 22.1ms | 22.1ms | CORE:match (opcode) | Bio::Roary::GroupStatistics::
32985 | 2 | 1 | 13.5ms | 13.5ms | CORE:regcomp (opcode) | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 3.60ms | 7.91ms | BEGIN@20 | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 1.09ms | 8.85ms | BEGIN@21 | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 388µs | 388µs | CORE:open (opcode) | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 362µs | 362µs | CORE:close (opcode) | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 57µs | 4.22ms | BEGIN@19 | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 55µs | 161µs | _header | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 34µs | 255µs | _build__text_csv_obj | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 34µs | 430µs | _build__output_fh | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 22µs | 48µs | _build__sorted_file_names | Bio::Roary::GroupStatistics::
8 | 1 | 1 | 15µs | 15µs | CORE:subst (opcode) | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 13µs | 151µs | BEGIN@202 | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 10µs | 10µs | BEGIN@22 | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 9µs | 9µs | fixed_headers | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 8µs | 8µs | BEGIN@24 | Bio::Roary::GroupStatistics::
1 | 1 | 1 | 7µs | 7µs | BEGIN@23 | Bio::Roary::GroupStatistics::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Bio::Roary::GroupStatistics; | ||||
2 | |||||
3 | # ABSTRACT: Add labels to the groups | ||||
4 | |||||
5 | =head1 SYNOPSIS | ||||
6 | |||||
7 | Add labels to the groups | ||||
8 | use Bio::Roary::GroupStatistics; | ||||
9 | |||||
10 | my $obj = Bio::Roary::GroupStatistics->new( | ||||
11 | output_filename => 'group_statitics.csv', | ||||
12 | annotate_groups_obj => $annotate_groups_obj, | ||||
13 | analyse_groups_obj => $analyse_groups_obj | ||||
14 | ); | ||||
15 | $obj->create_spreadsheet; | ||||
16 | |||||
17 | =cut | ||||
18 | |||||
19 | 2 | 45µs | 2 | 8.39ms | # spent 4.22ms (57µs+4.17) within Bio::Roary::GroupStatistics::BEGIN@19 which was called:
# once (57µs+4.17ms) by Bio::Roary::PostAnalysis::BEGIN@17 at line 19 # spent 4.22ms making 1 call to Bio::Roary::GroupStatistics::BEGIN@19
# spent 4.17ms making 1 call to Moose::import |
20 | 2 | 165µs | 2 | 11.1ms | # spent 7.91ms (3.60+4.30) within Bio::Roary::GroupStatistics::BEGIN@20 which was called:
# once (3.60ms+4.30ms) by Bio::Roary::PostAnalysis::BEGIN@17 at line 20 # spent 7.91ms making 1 call to Bio::Roary::GroupStatistics::BEGIN@20
# spent 3.15ms making 1 call to POSIX::import |
21 | 2 | 133µs | 2 | 8.86ms | # spent 8.85ms (1.09+7.76) within Bio::Roary::GroupStatistics::BEGIN@21 which was called:
# once (1.09ms+7.76ms) by Bio::Roary::PostAnalysis::BEGIN@17 at line 21 # spent 8.85ms making 1 call to Bio::Roary::GroupStatistics::BEGIN@21
# spent 3µs making 1 call to Text::CSV::import |
22 | 2 | 29µs | 1 | 10µs | # spent 10µs within Bio::Roary::GroupStatistics::BEGIN@22 which was called:
# once (10µs+0s) by Bio::Roary::PostAnalysis::BEGIN@17 at line 22 # spent 10µs making 1 call to Bio::Roary::GroupStatistics::BEGIN@22 |
23 | 2 | 26µs | 1 | 7µs | # spent 7µs within Bio::Roary::GroupStatistics::BEGIN@23 which was called:
# once (7µs+0s) by Bio::Roary::PostAnalysis::BEGIN@17 at line 23 # spent 7µs making 1 call to Bio::Roary::GroupStatistics::BEGIN@23 |
24 | 2 | 1.08ms | 1 | 8µs | # spent 8µs within Bio::Roary::GroupStatistics::BEGIN@24 which was called:
# once (8µs+0s) by Bio::Roary::PostAnalysis::BEGIN@17 at line 24 # spent 8µs making 1 call to Bio::Roary::GroupStatistics::BEGIN@24 |
25 | |||||
26 | 1 | 3µs | 1 | 3.39ms | has 'annotate_groups_obj' => ( is => 'ro', isa => 'Bio::Roary::AnnotateGroups', required => 1 ); # spent 3.39ms making 1 call to Moose::has |
27 | 1 | 2µs | 1 | 1.70ms | has 'analyse_groups_obj' => ( is => 'ro', isa => 'Bio::Roary::AnalyseGroups', required => 1 ); # spent 1.70ms making 1 call to Moose::has |
28 | 1 | 2µs | 1 | 1.58ms | has 'output_filename' => ( is => 'ro', isa => 'Str', default => 'group_statitics.csv' ); # spent 1.58ms making 1 call to Moose::has |
29 | 1 | 2µs | 1 | 3.21ms | has 'groups_to_contigs' => ( is => 'ro', isa => 'Maybe[HashRef]'); # spent 3.21ms making 1 call to Moose::has |
30 | |||||
31 | 1 | 3µs | 1 | 1.89ms | has '_output_fh' => ( is => 'ro', lazy => 1, builder => '_build__output_fh' ); # spent 1.89ms making 1 call to Moose::has |
32 | 1 | 3µs | 1 | 2.86ms | has '_text_csv_obj' => ( is => 'ro', isa => 'Text::CSV', lazy => 1, builder => '_build__text_csv_obj' ); # spent 2.86ms making 1 call to Moose::has |
33 | 1 | 3µs | 1 | 2.00ms | has '_sorted_file_names' => ( is => 'ro', isa => 'ArrayRef', lazy => 1, builder => '_build__sorted_file_names' ); # spent 2.00ms making 1 call to Moose::has |
34 | 1 | 2µs | 1 | 1.78ms | has '_groups_to_files' => ( is => 'ro', isa => 'HashRef', lazy => 1, builder => '_build__groups_to_files' ); # spent 1.78ms making 1 call to Moose::has |
35 | 1 | 2µs | 1 | 1.73ms | has '_files_to_groups' => ( is => 'ro', isa => 'HashRef', lazy => 1, builder => '_build__files_to_groups' ); # spent 1.73ms making 1 call to Moose::has |
36 | |||||
37 | 1 | 2µs | 1 | 1.70ms | has '_verbose' => ( is => 'ro', isa => 'Bool', default => 0 ); # spent 1.70ms making 1 call to Moose::has |
38 | |||||
39 | # spent 430µs (34+397) within Bio::Roary::GroupStatistics::_build__output_fh which was called:
# once (34µs+397µs) by Bio::Roary::GroupStatistics::_output_fh at line 11 of (eval 25)[Eval/Closure.pm:125] | ||||
40 | 3 | 421µs | my ($self) = @_; | ||
41 | 2 | 397µs | open( my $fh, '>', $self->output_filename ) # spent 388µs making 1 call to Bio::Roary::GroupStatistics::CORE:open
# spent 8µs making 1 call to Bio::Roary::GroupStatistics::output_filename | ||
42 | or Bio::Roary::Exceptions::CouldntWriteToFile->throw( | ||||
43 | error => "Couldnt write output file:" . $self->output_filename ); | ||||
44 | return $fh; | ||||
45 | } | ||||
46 | |||||
47 | # spent 255µs (34+221) within Bio::Roary::GroupStatistics::_build__text_csv_obj which was called:
# once (34µs+221µs) by Bio::Roary::GroupStatistics::_text_csv_obj at line 12 of (eval 25)[Eval/Closure.pm:125] | ||||
48 | 2 | 35µs | my ($self) = @_; | ||
49 | 1 | 221µs | return Text::CSV->new( { binary => 1, always_quote => 1, eol => "\r\n" } ); # spent 221µs making 1 call to Text::CSV::new | ||
50 | } | ||||
51 | |||||
52 | # spent 9µs within Bio::Roary::GroupStatistics::fixed_headers which was called:
# once (9µs+0s) by Bio::Roary::GroupStatistics::_header at line 61 | ||||
53 | 3 | 12µs | my ($self) = @_; | ||
54 | my @header = | ||||
55 | ( 'Gene', 'Non-unique Gene name', 'Annotation', 'No. isolates', 'No. sequences', 'Avg sequences per isolate', 'Genome Fragment','Order within Fragment', 'Accessory Fragement','Accessory Order with Fragment', 'QC' ); | ||||
56 | return \@header; | ||||
57 | } | ||||
58 | |||||
59 | # spent 161µs (55+106) within Bio::Roary::GroupStatistics::_header which was called:
# once (55µs+106µs) by Bio::Roary::GroupStatistics::create_spreadsheet at line 186 | ||||
60 | 5 | 29µs | my ($self) = @_; | ||
61 | 1 | 9µs | my @header = @{ $self->fixed_headers }; # spent 9µs making 1 call to Bio::Roary::GroupStatistics::fixed_headers | ||
62 | |||||
63 | 1 | 73µs | for my $filename ( @{ $self->_sorted_file_names } ) { # spent 73µs making 1 call to Bio::Roary::GroupStatistics::_sorted_file_names | ||
64 | 24 | 40µs | my $filename_cpy = $filename; | ||
65 | 8 | 15µs | $filename_cpy =~ s!\.gff\.proteome\.faa!!; # spent 15µs making 8 calls to Bio::Roary::GroupStatistics::CORE:subst, avg 2µs/call | ||
66 | push( @header, $filename_cpy ); | ||||
67 | } | ||||
68 | |||||
69 | 1 | 9µs | push( @header, 'Inference' ) if ( $self->_verbose ); # spent 9µs making 1 call to Bio::Roary::GroupStatistics::_verbose | ||
70 | |||||
71 | return \@header; | ||||
72 | } | ||||
73 | |||||
74 | # spent 48µs (22+26) within Bio::Roary::GroupStatistics::_build__sorted_file_names which was called:
# once (22µs+26µs) by Bio::Roary::GroupStatistics::_sorted_file_names at line 12 of (eval 25)[Eval/Closure.pm:125] | ||||
75 | 3 | 28µs | my ($self) = @_; | ||
76 | 3 | 26µs | my @sorted_file_names = sort( @{ $self->analyse_groups_obj->fasta_files } ); # spent 15µs making 1 call to Bio::Roary::AnalyseGroups::fasta_files
# spent 8µs making 1 call to Bio::Roary::GroupStatistics::analyse_groups_obj
# spent 4µs making 1 call to Bio::Roary::GroupStatistics::CORE:sort | ||
77 | return \@sorted_file_names; | ||||
78 | } | ||||
79 | |||||
80 | # spent 2.11s (375ms+1.74) within Bio::Roary::GroupStatistics::_non_unique_name_for_group which was called 18215 times, avg 116µs/call:
# 18215 times (375ms+1.74s) by Bio::Roary::GroupStatistics::_row at line 138, avg 116µs/call | ||||
81 | 91075 | 215ms | my ( $self, $annotated_group_name ) = @_; | ||
82 | my $duplicate_gene_name = ''; | ||||
83 | 36430 | 65.0ms | my $prefix = $self->annotate_groups_obj->_group_default_prefix; # spent 40.2ms making 18215 calls to Bio::Roary::AnnotateGroups::_group_default_prefix, avg 2µs/call
# spent 24.7ms making 18215 calls to Bio::Roary::GroupStatistics::annotate_groups_obj, avg 1µs/call | ||
84 | 29540 | 116ms | 36430 | 24.4ms | if ( $annotated_group_name =~ /$prefix/ ) { # spent 16.4ms making 18215 calls to Bio::Roary::GroupStatistics::CORE:match, avg 899ns/call
# spent 7.99ms making 18215 calls to Bio::Roary::GroupStatistics::CORE:regcomp, avg 438ns/call |
85 | 29540 | 1.64s | my $non_unique_name_for_group = # spent 1.61s making 14770 calls to Bio::Roary::AnnotateGroups::_consensus_gene_name_for_group, avg 109µs/call
# spent 24.5ms making 14770 calls to Bio::Roary::GroupStatistics::annotate_groups_obj, avg 2µs/call | ||
86 | $self->annotate_groups_obj->_consensus_gene_name_for_group($annotated_group_name); | ||||
87 | 29540 | 11.2ms | if ( !( $non_unique_name_for_group =~ /$prefix/ ) ) { # spent 5.74ms making 14770 calls to Bio::Roary::GroupStatistics::CORE:match, avg 389ns/call
# spent 5.48ms making 14770 calls to Bio::Roary::GroupStatistics::CORE:regcomp, avg 371ns/call | ||
88 | $duplicate_gene_name = $non_unique_name_for_group; | ||||
89 | } | ||||
90 | } | ||||
91 | return $duplicate_gene_name; | ||||
92 | } | ||||
93 | |||||
94 | # spent 1.52s (1.05+467ms) within Bio::Roary::GroupStatistics::_build__groups_to_files which was called:
# once (1.05s+467ms) by Bio::Roary::GroupStatistics::_groups_to_files at line 12 of (eval 25)[Eval/Closure.pm:125] | ||||
95 | 4 | 2.52ms | my ($self) = @_; | ||
96 | my %groups_to_files; | ||||
97 | 2 | 8.41ms | for my $group ( @{ $self->annotate_groups_obj->_groups } ) { # spent 8.41ms making 1 call to Bio::Roary::AnnotateGroups::_groups
# spent 2µs making 1 call to Bio::Roary::GroupStatistics::annotate_groups_obj | ||
98 | 72860 | 86.5ms | 36430 | 62.3ms | my $genes = $self->annotate_groups_obj->_groups_to_id_names->{$group}; # spent 32.8ms making 18215 calls to Bio::Roary::AnnotateGroups::_groups_to_id_names, avg 2µs/call
# spent 29.6ms making 18215 calls to Bio::Roary::GroupStatistics::annotate_groups_obj, avg 2µs/call |
99 | my %filenames; | ||||
100 | for my $gene_name ( @{$genes} ) { | ||||
101 | 288584 | 600ms | 288584 | 397ms | my $filename = $self->analyse_groups_obj->_genes_to_file->{$gene_name}; # spent 203ms making 144292 calls to Bio::Roary::GroupStatistics::analyse_groups_obj, avg 1µs/call
# spent 193ms making 144292 calls to Bio::Roary::AnalyseGroups::_genes_to_file, avg 1µs/call |
102 | push( @{ $filenames{$filename} }, $gene_name ); | ||||
103 | } | ||||
104 | $groups_to_files{$group} = \%filenames; | ||||
105 | } | ||||
106 | |||||
107 | return \%groups_to_files; | ||||
108 | } | ||||
109 | |||||
110 | sub _build__files_to_groups | ||||
111 | # spent 200ms (168+31.3) within Bio::Roary::GroupStatistics::_build__files_to_groups which was called:
# once (168ms+31.3ms) by Bio::Roary::GroupStatistics::_files_to_groups at line 12 of (eval 25)[Eval/Closure.pm:125] | ||||
112 | 4 | 5.27ms | my ($self) = @_; | ||
113 | my %files_to_groups; | ||||
114 | |||||
115 | 1 | 4µs | for my $group (keys %{$self->_groups_to_files}) # spent 4µs making 1 call to Bio::Roary::GroupStatistics::_groups_to_files | ||
116 | { | ||||
117 | 18215 | 65.6ms | 18215 | 31.3ms | for my $filename (keys %{$self->_groups_to_files->{$group}}) # spent 31.3ms making 18215 calls to Bio::Roary::GroupStatistics::_groups_to_files, avg 2µs/call |
118 | { | ||||
119 | 144292 | 42.0ms | push(@{$files_to_groups{$filename}}, $group); | ||
120 | } | ||||
121 | } | ||||
122 | |||||
123 | return \%files_to_groups; | ||||
124 | } | ||||
125 | |||||
126 | |||||
127 | # spent 8.87s (1.73+7.14) within Bio::Roary::GroupStatistics::_row which was called 18215 times, avg 487µs/call:
# 18215 times (1.73s+7.14s) by Bio::Roary::GroupStatistics::create_spreadsheet at line 197, avg 487µs/call | ||||
128 | 327870 | 653ms | my ( $self, $group ) = @_; | ||
129 | 36430 | 72.8ms | my $genes = $self->annotate_groups_obj->_groups_to_id_names->{$group}; # spent 41.6ms making 18215 calls to Bio::Roary::AnnotateGroups::_groups_to_id_names, avg 2µs/call
# spent 31.2ms making 18215 calls to Bio::Roary::GroupStatistics::annotate_groups_obj, avg 2µs/call | ||
130 | |||||
131 | 36430 | 1.45s | my $num_isolates_in_group = $self->analyse_groups_obj->_count_num_files_in_group($genes); # spent 1.41s making 18215 calls to Bio::Roary::AnalyseGroups::_count_num_files_in_group, avg 78µs/call
# spent 35.1ms making 18215 calls to Bio::Roary::GroupStatistics::analyse_groups_obj, avg 2µs/call | ||
132 | my $num_sequences_in_group = $#{$genes} + 1; | ||||
133 | 18215 | 29.3ms | my $avg_sequences_per_isolate = ceil( ( $num_sequences_in_group / $num_isolates_in_group ) * 100 ) / 100; # spent 29.3ms making 18215 calls to POSIX::ceil, avg 2µs/call | ||
134 | |||||
135 | 36430 | 1.42s | my $annotation = $self->annotate_groups_obj->consensus_product_for_id_names($genes); # spent 1.38s making 18215 calls to Bio::Roary::AnnotateGroups::consensus_product_for_id_names, avg 76µs/call
# spent 33.8ms making 18215 calls to Bio::Roary::GroupStatistics::annotate_groups_obj, avg 2µs/call | ||
136 | 36430 | 82.0ms | my $annotated_group_name = $self->annotate_groups_obj->_groups_to_consensus_gene_names->{$group}; # spent 46.8ms making 18215 calls to Bio::Roary::AnnotateGroups::_groups_to_consensus_gene_names, avg 3µs/call
# spent 35.3ms making 18215 calls to Bio::Roary::GroupStatistics::annotate_groups_obj, avg 2µs/call | ||
137 | |||||
138 | 18215 | 2.11s | my $duplicate_gene_name = $self->_non_unique_name_for_group($annotated_group_name); # spent 2.11s making 18215 calls to Bio::Roary::GroupStatistics::_non_unique_name_for_group, avg 116µs/call | ||
139 | |||||
140 | my $genome_number = ''; | ||||
141 | my $qc_comment = ''; | ||||
142 | my $order_within_fragement = ''; | ||||
143 | my $accessory_order_within_fragement = ''; | ||||
144 | my $accessory_genome_number = ''; | ||||
145 | 24340 | 46.3ms | 36430 | 65.0ms | if(defined($self->groups_to_contigs) && defined($self->groups_to_contigs->{$annotated_group_name})) # spent 65.0ms making 36430 calls to Bio::Roary::GroupStatistics::groups_to_contigs, avg 2µs/call |
146 | { | ||||
147 | 4868 | 6.63ms | $genome_number = $self->groups_to_contigs->{$annotated_group_name}->{label}; # spent 6.63ms making 4868 calls to Bio::Roary::GroupStatistics::groups_to_contigs, avg 1µs/call | ||
148 | 4868 | 6.60ms | $qc_comment = $self->groups_to_contigs->{$annotated_group_name}->{comment}; # spent 6.60ms making 4868 calls to Bio::Roary::GroupStatistics::groups_to_contigs, avg 1µs/call | ||
149 | 4868 | 6.57ms | $order_within_fragement = $self->groups_to_contigs->{$annotated_group_name}->{order}; # spent 6.57ms making 4868 calls to Bio::Roary::GroupStatistics::groups_to_contigs, avg 1µs/call | ||
150 | |||||
151 | 4868 | 6.50ms | $accessory_genome_number = $self->groups_to_contigs->{$annotated_group_name}->{accessory_label}; # spent 6.50ms making 4868 calls to Bio::Roary::GroupStatistics::groups_to_contigs, avg 1µs/call | ||
152 | 4868 | 6.43ms | $accessory_order_within_fragement = $self->groups_to_contigs->{$annotated_group_name}->{accessory_order}; # spent 6.43ms making 4868 calls to Bio::Roary::GroupStatistics::groups_to_contigs, avg 1µs/call | ||
153 | } | ||||
154 | |||||
155 | my @row = ( | ||||
156 | $annotated_group_name, $duplicate_gene_name, $annotation, | ||||
157 | $num_isolates_in_group, $num_sequences_in_group, $avg_sequences_per_isolate,$genome_number,$order_within_fragement,$accessory_genome_number,$accessory_order_within_fragement,$qc_comment | ||||
158 | ); | ||||
159 | |||||
160 | 18215 | 44.0ms | for my $filename ( @{ $self->_sorted_file_names } ) { # spent 44.0ms making 18215 calls to Bio::Roary::GroupStatistics::_sorted_file_names, avg 2µs/call | ||
161 | 291440 | 342ms | 145720 | 1.79s | my $group_to_file_genes = $self->_groups_to_files->{$group}->{$filename}; # spent 1.79s making 145720 calls to Bio::Roary::GroupStatistics::_groups_to_files, avg 12µs/call |
162 | |||||
163 | 290012 | 166ms | if ( defined($group_to_file_genes) && @{$group_to_file_genes} > 0 ) { | ||
164 | |||||
165 | push( @row, join( "\t", @{$group_to_file_genes} ) ); | ||||
166 | next; | ||||
167 | } | ||||
168 | else { | ||||
169 | push( @row, '' ); | ||||
170 | } | ||||
171 | } | ||||
172 | |||||
173 | ## ADD INFERENCE AND FULL ANNOTATION IF VERBOSE REQUESTED ## | ||||
174 | 18215 | 41.8ms | if ( $self->_verbose ){ # spent 41.8ms making 18215 calls to Bio::Roary::GroupStatistics::_verbose, avg 2µs/call | ||
175 | my ( $full_annotation, $inference ); | ||||
176 | $row[2] = $self->annotate_groups_obj->full_annotation($group); | ||||
177 | push( @row, $self->annotate_groups_obj->inference($group) ); | ||||
178 | } | ||||
179 | |||||
180 | return \@row; | ||||
181 | } | ||||
182 | |||||
183 | # spent 17.9s (452ms+17.5) within Bio::Roary::GroupStatistics::create_spreadsheet which was called:
# once (452ms+17.5s) by Bio::Roary::PostAnalysis::run at line 76 of lib/Bio/Roary/PostAnalysis.pm | ||||
184 | 6 | 91.0ms | my ($self) = @_; | ||
185 | |||||
186 | 4 | 1.38ms | $self->_text_csv_obj->print( $self->_output_fh, $self->_header ); # spent 459µs making 1 call to Bio::Roary::GroupStatistics::_output_fh
# spent 456µs making 1 call to Text::CSV_PP::print
# spent 301µs making 1 call to Bio::Roary::GroupStatistics::_text_csv_obj
# spent 161µs making 1 call to Bio::Roary::GroupStatistics::_header | ||
187 | |||||
188 | #for each group count the nubmer of files | ||||
189 | my %num_files_in_groups; | ||||
190 | 2 | 7.83ms | for my $group (@{ $self->annotate_groups_obj->_groups }) # spent 7.83ms making 1 call to Bio::Roary::AnnotateGroups::_groups
# spent 8µs making 1 call to Bio::Roary::GroupStatistics::annotate_groups_obj | ||
191 | { | ||||
192 | 36430 | 106ms | 72860 | 1.38s | my $num_files = $self->analyse_groups_obj->_count_num_files_in_group( $self->annotate_groups_obj->_groups_to_id_names->{$group}); # spent 1.29s making 18215 calls to Bio::Roary::AnalyseGroups::_count_num_files_in_group, avg 71µs/call
# spent 31.8ms making 18215 calls to Bio::Roary::AnnotateGroups::_groups_to_id_names, avg 2µs/call
# spent 30.5ms making 18215 calls to Bio::Roary::GroupStatistics::analyse_groups_obj, avg 2µs/call
# spent 25.9ms making 18215 calls to Bio::Roary::GroupStatistics::annotate_groups_obj, avg 1µs/call |
193 | $num_files_in_groups{$group} = $num_files; | ||||
194 | } | ||||
195 | |||||
196 | 1 | 80.3ms | for my $group (sort {$num_files_in_groups{$b}<=>$num_files_in_groups{$a} || $a cmp $b} keys %num_files_in_groups){ # spent 80.3ms making 1 call to Bio::Roary::GroupStatistics::CORE:sort | ||
197 | 18215 | 177ms | 72860 | 16.0s | $self->_text_csv_obj->print( $self->_output_fh, $self->_row($group) ); # spent 8.87s making 18215 calls to Bio::Roary::GroupStatistics::_row, avg 487µs/call
# spent 7.02s making 18215 calls to Text::CSV_PP::print, avg 385µs/call
# spent 50.7ms making 18215 calls to Bio::Roary::GroupStatistics::_text_csv_obj, avg 3µs/call
# spent 42.5ms making 18215 calls to Bio::Roary::GroupStatistics::_output_fh, avg 2µs/call |
198 | } | ||||
199 | 2 | 386µs | close( $self->_output_fh ); # spent 362µs making 1 call to Bio::Roary::GroupStatistics::CORE:close
# spent 24µs making 1 call to Bio::Roary::GroupStatistics::_output_fh | ||
200 | } | ||||
201 | |||||
202 | 2 | 56µs | 2 | 290µs | # spent 151µs (13+138) within Bio::Roary::GroupStatistics::BEGIN@202 which was called:
# once (13µs+138µs) by Bio::Roary::PostAnalysis::BEGIN@17 at line 202 # spent 151µs making 1 call to Bio::Roary::GroupStatistics::BEGIN@202
# spent 138µs making 1 call to Moose::unimport |
203 | 1 | 9µs | 2 | 8.87ms | __PACKAGE__->meta->make_immutable; # spent 8.83ms making 1 call to Class::MOP::Class::make_immutable
# spent 40µs making 1 call to Bio::Roary::GroupStatistics::meta |
204 | |||||
205 | 1 | 68µs | 1; | ||
# spent 362µs within Bio::Roary::GroupStatistics::CORE:close which was called:
# once (362µs+0s) by Bio::Roary::GroupStatistics::create_spreadsheet at line 199 | |||||
# spent 22.1ms within Bio::Roary::GroupStatistics::CORE:match which was called 32985 times, avg 671ns/call:
# 18215 times (16.4ms+0s) by Bio::Roary::GroupStatistics::_non_unique_name_for_group at line 84, avg 899ns/call
# 14770 times (5.74ms+0s) by Bio::Roary::GroupStatistics::_non_unique_name_for_group at line 87, avg 389ns/call | |||||
# spent 388µs within Bio::Roary::GroupStatistics::CORE:open which was called:
# once (388µs+0s) by Bio::Roary::GroupStatistics::_build__output_fh at line 41 | |||||
# spent 13.5ms within Bio::Roary::GroupStatistics::CORE:regcomp which was called 32985 times, avg 408ns/call:
# 18215 times (7.99ms+0s) by Bio::Roary::GroupStatistics::_non_unique_name_for_group at line 84, avg 438ns/call
# 14770 times (5.48ms+0s) by Bio::Roary::GroupStatistics::_non_unique_name_for_group at line 87, avg 371ns/call | |||||
sub Bio::Roary::GroupStatistics::CORE:sort; # opcode | |||||
# spent 15µs within Bio::Roary::GroupStatistics::CORE:subst which was called 8 times, avg 2µs/call:
# 8 times (15µs+0s) by Bio::Roary::GroupStatistics::_header at line 65, avg 2µs/call |