Filename | /Users/ap13/pathogens/Roary/lib/Bio/Roary/Output/EmblGroups.pm |
Statements | Executed 1520758 statements in 3.05s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
2 | 1 | 1 | 2.24s | 3.25s | _build__groups_to_files | Bio::Roary::Output::EmblGroups::
36430 | 1 | 1 | 811ms | 4.46s | _block | Bio::Roary::Output::EmblGroups::
36430 | 1 | 1 | 559ms | 872ms | _header_block | Bio::Roary::Output::EmblGroups::
2 | 2 | 1 | 469ms | 6.50s | create_files | Bio::Roary::Output::EmblGroups::
2 | 1 | 1 | 314ms | 505ms | _fragment_blocks | Bio::Roary::Output::EmblGroups::
4967 | 1 | 1 | 23.7ms | 27.5ms | _annotation_type | Bio::Roary::Output::EmblGroups::
4975 | 2 | 1 | 11.5ms | 11.5ms | _block_colour | Bio::Roary::Output::EmblGroups::
2 | 1 | 1 | 67µs | 503µs | _build__output_header_fh | Bio::Roary::Output::EmblGroups::
1 | 1 | 1 | 59µs | 4.52ms | BEGIN@19 | Bio::Roary::Output::EmblGroups::
2 | 1 | 1 | 56µs | 88µs | _build__sorted_file_names | Bio::Roary::Output::EmblGroups::
2 | 1 | 1 | 47µs | 90µs | _build_output_header_filename | Bio::Roary::Output::EmblGroups::
2 | 1 | 1 | 43µs | 341µs | _build__output_fh | Bio::Roary::Output::EmblGroups::
2 | 1 | 1 | 20µs | 20µs | _header_top | Bio::Roary::Output::EmblGroups::
1 | 1 | 1 | 12µs | 2.56ms | BEGIN@20 | Bio::Roary::Output::EmblGroups::
2 | 1 | 1 | 11µs | 11µs | _header_bottom | Bio::Roary::Output::EmblGroups::
1 | 1 | 1 | 11µs | 112µs | BEGIN@239 | Bio::Roary::Output::EmblGroups::
1 | 1 | 1 | 10µs | 10µs | BEGIN@22 | Bio::Roary::Output::EmblGroups::
1 | 1 | 1 | 8µs | 8µs | BEGIN@21 | Bio::Roary::Output::EmblGroups::
1 | 1 | 1 | 7µs | 7µs | BEGIN@23 | Bio::Roary::Output::EmblGroups::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Bio::Roary::Output::EmblGroups; | ||||
2 | |||||
3 | # ABSTRACT: Create a tab/embl file with the features for drawing pretty pictures | ||||
4 | |||||
5 | =head1 SYNOPSIS | ||||
6 | |||||
7 | reate a tab/embl file with the features for drawing pretty pictures | ||||
8 | use Bio::Roary::Output::EmblGroups; | ||||
9 | |||||
10 | my $obj = Bio::Roary::Output::EmblGroups->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_file; | ||||
16 | |||||
17 | =cut | ||||
18 | |||||
19 | 2 | 56µs | 2 | 8.98ms | # spent 4.52ms (59µs+4.46) within Bio::Roary::Output::EmblGroups::BEGIN@19 which was called:
# once (59µs+4.46ms) by Bio::Roary::PostAnalysis::BEGIN@21 at line 19 # spent 4.52ms making 1 call to Bio::Roary::Output::EmblGroups::BEGIN@19
# spent 4.46ms making 1 call to Moose::import |
20 | 2 | 32µs | 2 | 5.12ms | # spent 2.56ms (12µs+2.55) within Bio::Roary::Output::EmblGroups::BEGIN@20 which was called:
# once (12µs+2.55ms) by Bio::Roary::PostAnalysis::BEGIN@21 at line 20 # spent 2.56ms making 1 call to Bio::Roary::Output::EmblGroups::BEGIN@20
# spent 2.55ms making 1 call to POSIX::import |
21 | 2 | 23µs | 1 | 8µs | # spent 8µs within Bio::Roary::Output::EmblGroups::BEGIN@21 which was called:
# once (8µs+0s) by Bio::Roary::PostAnalysis::BEGIN@21 at line 21 # spent 8µs making 1 call to Bio::Roary::Output::EmblGroups::BEGIN@21 |
22 | 2 | 26µs | 1 | 10µs | # spent 10µs within Bio::Roary::Output::EmblGroups::BEGIN@22 which was called:
# once (10µs+0s) by Bio::Roary::PostAnalysis::BEGIN@21 at line 22 # spent 10µs making 1 call to Bio::Roary::Output::EmblGroups::BEGIN@22 |
23 | 2 | 1.23ms | 1 | 7µs | # spent 7µs within Bio::Roary::Output::EmblGroups::BEGIN@23 which was called:
# once (7µs+0s) by Bio::Roary::PostAnalysis::BEGIN@21 at line 23 # spent 7µs making 1 call to Bio::Roary::Output::EmblGroups::BEGIN@23 |
24 | |||||
25 | 1 | 2µs | 1 | 2.65ms | has 'annotate_groups_obj' => ( is => 'ro', isa => 'Bio::Roary::AnnotateGroups', required => 1 ); # spent 2.65ms making 1 call to Moose::has |
26 | 1 | 2µs | 1 | 1.57ms | has 'analyse_groups_obj' => ( is => 'ro', isa => 'Bio::Roary::AnalyseGroups', required => 1 ); # spent 1.57ms making 1 call to Moose::has |
27 | 1 | 2µs | 1 | 1.57ms | has 'output_filename' => ( is => 'ro', isa => 'Str', default => 'core_accessory.tab' ); # spent 1.57ms making 1 call to Moose::has |
28 | 1 | 3µs | 1 | 2.39ms | has 'output_header_filename' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build_output_header_filename'); # spent 2.39ms making 1 call to Moose::has |
29 | 1 | 3µs | 1 | 2.00ms | has 'groups_to_contigs' => ( is => 'ro', isa => 'Maybe[HashRef]'); # spent 2.00ms making 1 call to Moose::has |
30 | 1 | 3µs | 1 | 3.04ms | has 'ordering_key' => ( is => 'ro', isa => 'Str', default => 'core_accessory_overall_order' ); # spent 3.04ms making 1 call to Moose::has |
31 | |||||
32 | 1 | 3µs | 1 | 1.97ms | has '_output_fh' => ( is => 'ro', lazy => 1, builder => '_build__output_fh' ); # spent 1.97ms making 1 call to Moose::has |
33 | 1 | 2µs | 1 | 1.78ms | has '_output_header_fh' => ( is => 'ro', lazy => 1, builder => '_build__output_header_fh' ); # spent 1.78ms making 1 call to Moose::has |
34 | 1 | 2µs | 1 | 1.90ms | has '_sorted_file_names' => ( is => 'ro', isa => 'ArrayRef', lazy => 1, builder => '_build__sorted_file_names' ); # spent 1.90ms making 1 call to Moose::has |
35 | 1 | 3µs | 1 | 1.81ms | has '_groups_to_files' => ( is => 'ro', isa => 'HashRef', lazy => 1, builder => '_build__groups_to_files' ); # spent 1.81ms making 1 call to Moose::has |
36 | |||||
37 | # spent 341µs (43+298) within Bio::Roary::Output::EmblGroups::_build__output_fh which was called 2 times, avg 171µs/call:
# 2 times (43µs+298µs) by Bio::Roary::Output::EmblGroups::_output_fh at line 11 of (eval 25)[Eval/Closure.pm:125], avg 171µs/call | ||||
38 | 2 | 3µs | my ($self) = @_; | ||
39 | 2 | 314µs | 4 | 298µs | open( my $fh, '>', $self->output_filename ) # spent 287µs making 2 calls to Bio::Roary::Output::EmblGroups::CORE:open, avg 144µs/call
# spent 10µs making 2 calls to Bio::Roary::Output::EmblGroups::output_filename, avg 5µs/call |
40 | or Bio::Roary::Exceptions::CouldntWriteToFile->throw( | ||||
41 | error => "Couldnt write output file:" . $self->output_filename ); | ||||
42 | 2 | 17µs | return $fh; | ||
43 | } | ||||
44 | |||||
45 | sub _build__output_header_fh | ||||
46 | # spent 503µs (67+436) within Bio::Roary::Output::EmblGroups::_build__output_header_fh which was called 2 times, avg 252µs/call:
# 2 times (67µs+436µs) by Bio::Roary::Output::EmblGroups::_output_header_fh at line 11 of (eval 25)[Eval/Closure.pm:125], avg 252µs/call | ||||
47 | 2 | 2µs | my ($self) = @_; | ||
48 | 2 | 301µs | 4 | 437µs | open( my $fh, '>', $self->output_header_filename ) # spent 252µs making 2 calls to Bio::Roary::Output::EmblGroups::CORE:open, avg 126µs/call
# spent 184µs making 2 calls to Bio::Roary::Output::EmblGroups::output_header_filename, avg 92µs/call |
49 | or Bio::Roary::Exceptions::CouldntWriteToFile->throw( | ||||
50 | error => "Couldnt write output file:" . $self->output_filename ); | ||||
51 | 2 | 13µs | return $fh; | ||
52 | } | ||||
53 | |||||
54 | sub _build_output_header_filename | ||||
55 | # spent 90µs (47+44) within Bio::Roary::Output::EmblGroups::_build_output_header_filename which was called 2 times, avg 45µs/call:
# 2 times (47µs+44µs) by Bio::Roary::Output::EmblGroups::output_header_filename at line 12 of (eval 25)[Eval/Closure.pm:125], avg 45µs/call | ||||
56 | 2 | 2µs | my ($self) = @_; | ||
57 | 2 | 12µs | 2 | 14µs | my $base_name = $self->output_filename; # spent 14µs making 2 calls to Bio::Roary::Output::EmblGroups::output_filename, avg 7µs/call |
58 | 2 | 46µs | 2 | 29µs | $base_name =~ s/\.tab/.header.embl/i; # spent 29µs making 2 calls to Bio::Roary::Output::EmblGroups::CORE:subst, avg 15µs/call |
59 | 2 | 18µs | return $base_name; | ||
60 | } | ||||
61 | |||||
62 | # spent 88µs (56+33) within Bio::Roary::Output::EmblGroups::_build__sorted_file_names which was called 2 times, avg 44µs/call:
# 2 times (56µs+33µs) by Bio::Roary::Output::EmblGroups::_sorted_file_names at line 12 of (eval 25)[Eval/Closure.pm:125], avg 44µs/call | ||||
63 | 2 | 1µs | my ($self) = @_; | ||
64 | 2 | 47µs | 6 | 33µs | my @sorted_file_names = sort( @{ $self->analyse_groups_obj->fasta_files } ); # spent 17µs making 2 calls to Bio::Roary::Output::EmblGroups::analyse_groups_obj, avg 8µs/call
# spent 8µs making 2 calls to Bio::Roary::Output::EmblGroups::CORE:sort, avg 4µs/call
# spent 8µs making 2 calls to Bio::Roary::AnalyseGroups::fasta_files, avg 4µs/call |
65 | 2 | 17µs | return \@sorted_file_names; | ||
66 | } | ||||
67 | |||||
68 | # spent 3.25s (2.24+1.01) within Bio::Roary::Output::EmblGroups::_build__groups_to_files which was called 2 times, avg 1.62s/call:
# 2 times (2.24s+1.01s) by Bio::Roary::Output::EmblGroups::_groups_to_files at line 12 of (eval 25)[Eval/Closure.pm:125], avg 1.62s/call | ||||
69 | 2 | 2µs | my ($self) = @_; | ||
70 | 2 | 1µs | my %groups_to_files; | ||
71 | 2 | 3.73ms | 4 | 26.4ms | for my $group ( @{ $self->annotate_groups_obj->_groups } ) { # spent 26.4ms making 2 calls to Bio::Roary::AnnotateGroups::_groups, avg 13.2ms/call
# spent 4µs making 2 calls to Bio::Roary::Output::EmblGroups::annotate_groups_obj, avg 2µs/call |
72 | 36430 | 110ms | 72860 | 134ms | my $genes = $self->annotate_groups_obj->_groups_to_id_names->{$group}; # spent 70.6ms making 36430 calls to Bio::Roary::AnnotateGroups::_groups_to_id_names, avg 2µs/call
# spent 63.9ms making 36430 calls to Bio::Roary::Output::EmblGroups::annotate_groups_obj, avg 2µs/call |
73 | 36430 | 1.20ms | my %filenames; | ||
74 | 36430 | 28.2ms | for my $gene_name ( @{$genes} ) { | ||
75 | 288584 | 869ms | 577168 | 846ms | my $filename = $self->analyse_groups_obj->_genes_to_file->{$gene_name}; # spent 436ms making 288584 calls to Bio::Roary::Output::EmblGroups::analyse_groups_obj, avg 2µs/call
# spent 410ms making 288584 calls to Bio::Roary::AnalyseGroups::_genes_to_file, avg 1µs/call |
76 | 288584 | 419ms | push( @{ $filenames{$filename} }, $gene_name ); | ||
77 | } | ||||
78 | 36430 | 45.4ms | $groups_to_files{$group} = \%filenames; | ||
79 | } | ||||
80 | 2 | 52µs | return \%groups_to_files; | ||
81 | } | ||||
82 | |||||
83 | # spent 4.46s (811ms+3.65) within Bio::Roary::Output::EmblGroups::_block which was called 36430 times, avg 122µs/call:
# 36430 times (811ms+3.65s) by Bio::Roary::Output::EmblGroups::create_files at line 229, avg 122µs/call | ||||
84 | 36430 | 23.9ms | my ( $self, $group ) = @_; | ||
85 | 36430 | 4.08ms | my @taxon_names_array; | ||
86 | 36430 | 90.3ms | 72860 | 114ms | my $annotated_group_name = $self->annotate_groups_obj->_groups_to_consensus_gene_names->{$group}; # spent 64.6ms making 36430 calls to Bio::Roary::AnnotateGroups::_groups_to_consensus_gene_names, avg 2µs/call
# spent 49.7ms making 36430 calls to Bio::Roary::Output::EmblGroups::annotate_groups_obj, avg 1µs/call |
87 | |||||
88 | 36430 | 184ms | 82596 | 121ms | return '' if(!(defined($self->groups_to_contigs->{$annotated_group_name}) && defined($self->groups_to_contigs->{$annotated_group_name}->{$self->ordering_key}) )); # spent 82.8ms making 59513 calls to Bio::Roary::Output::EmblGroups::groups_to_contigs, avg 1µs/call
# spent 38.1ms making 23083 calls to Bio::Roary::Output::EmblGroups::ordering_key, avg 2µs/call |
89 | |||||
90 | 4967 | 15.9ms | 9934 | 14.2ms | return '' if(defined($self->groups_to_contigs->{$annotated_group_name}->{comment}) && $self->groups_to_contigs->{$annotated_group_name}->{comment} ne ''); # spent 14.2ms making 9934 calls to Bio::Roary::Output::EmblGroups::groups_to_contigs, avg 1µs/call |
91 | |||||
92 | 4967 | 13.5ms | 9934 | 15.4ms | my $coordindates = $self->groups_to_contigs->{$annotated_group_name}->{$self->ordering_key}; # spent 8.38ms making 4967 calls to Bio::Roary::Output::EmblGroups::ordering_key, avg 2µs/call
# spent 6.98ms making 4967 calls to Bio::Roary::Output::EmblGroups::groups_to_contigs, avg 1µs/call |
93 | |||||
94 | 4967 | 18.3ms | 4967 | 10.9ms | for my $filename ( @{ $self->_sorted_file_names } ) { # spent 10.9ms making 4967 calls to Bio::Roary::Output::EmblGroups::_sorted_file_names, avg 2µs/call |
95 | 39736 | 69.4ms | 39736 | 3.32s | my $group_to_file_genes = $self->_groups_to_files->{$group}->{$filename}; # spent 3.32s making 39736 calls to Bio::Roary::Output::EmblGroups::_groups_to_files, avg 84µs/call |
96 | |||||
97 | 39736 | 13.3ms | if ( defined($group_to_file_genes) && @{$group_to_file_genes} > 0 ) { | ||
98 | 37681 | 5.16ms | my $filename_cpy = $filename; | ||
99 | 37681 | 105ms | 37681 | 44.9ms | $filename_cpy =~ s!\.gff\.proteome\.faa!!; # spent 44.9ms making 37681 calls to Bio::Roary::Output::EmblGroups::CORE:subst, avg 1µs/call |
100 | 37681 | 23.3ms | push( @taxon_names_array, $filename_cpy ); | ||
101 | 37681 | 14.7ms | next; | ||
102 | } | ||||
103 | } | ||||
104 | |||||
105 | 4967 | 802µs | my $colour = 4; | ||
106 | |||||
107 | 4967 | 4.65ms | my $taxon_names = join(" ",@taxon_names_array); | ||
108 | |||||
109 | 4967 | 2.51ms | my $tab_file_entry = "FT variation $coordindates\n"; | ||
110 | 4967 | 1.63ms | $tab_file_entry .= "FT /colour=$colour\n"; | ||
111 | 4967 | 1.29ms | $tab_file_entry .= "FT /gene=$annotated_group_name\n"; | ||
112 | 4967 | 1.40ms | $tab_file_entry .= "FT /taxa=\"$taxon_names\"\n"; | ||
113 | |||||
114 | 4967 | 21.3ms | return $tab_file_entry; | ||
115 | } | ||||
116 | |||||
117 | sub _block_colour | ||||
118 | # spent 11.5ms within Bio::Roary::Output::EmblGroups::_block_colour which was called 4975 times, avg 2µs/call:
# 4967 times (11.5ms+0s) by Bio::Roary::Output::EmblGroups::_header_block at line 158, avg 2µs/call
# 8 times (46µs+0s) by Bio::Roary::Output::EmblGroups::_fragment_blocks at line 216, avg 6µs/call | ||||
119 | 4975 | 3.76ms | my ( $self, $accessory_label ) = @_; | ||
120 | 4975 | 755µs | my $colour = 2; | ||
121 | 4975 | 10.2ms | return $colour unless(defined($accessory_label) ); | ||
122 | |||||
123 | 238 | 193µs | $colour += $accessory_label % 6; | ||
124 | 238 | 552µs | return $colour; | ||
125 | } | ||||
126 | |||||
127 | |||||
128 | sub _header_top | ||||
129 | # spent 20µs within Bio::Roary::Output::EmblGroups::_header_top which was called 2 times, avg 10µs/call:
# 2 times (20µs+0s) by Bio::Roary::Output::EmblGroups::create_files at line 226, avg 10µs/call | ||||
130 | 2 | 2µs | my ( $self) = @_; | ||
131 | 2 | 2µs | my $header_lines = 'ID Genome standard; DNA; PRO; 1234 BP.'."\n"; | ||
132 | 2 | 2µs | $header_lines .= 'XX'."\n"; | ||
133 | 2 | 3µs | $header_lines .= 'FH Key Location/Qualifiers'."\n"; | ||
134 | 2 | 400ns | $header_lines .= 'FH'."\n"; | ||
135 | 2 | 14µs | return $header_lines; | ||
136 | } | ||||
137 | |||||
138 | sub _header_bottom | ||||
139 | # spent 11µs within Bio::Roary::Output::EmblGroups::_header_bottom which was called 2 times, avg 6µs/call:
# 2 times (11µs+0s) by Bio::Roary::Output::EmblGroups::create_files at line 233, avg 6µs/call | ||||
140 | 2 | 2µs | my ( $self) = @_; | ||
141 | 2 | 2µs | my $header_lines = 'XX'."\n"; | ||
142 | 2 | 2µs | $header_lines .= 'SQ Sequence 1234 BP; 789 A; 1717 C; 1693 G; 691 T; 0 other;'."\n"; | ||
143 | 2 | 400ns | $header_lines .= '//'."\n"; | ||
144 | 2 | 17µs | return $header_lines; | ||
145 | } | ||||
146 | |||||
147 | sub _header_block | ||||
148 | # spent 872ms (559+313) within Bio::Roary::Output::EmblGroups::_header_block which was called 36430 times, avg 24µs/call:
# 36430 times (559ms+313ms) by Bio::Roary::Output::EmblGroups::create_files at line 230, avg 24µs/call | ||||
149 | 36430 | 22.7ms | my ( $self, $group ) = @_; | ||
150 | 36430 | 92.9ms | 72860 | 115ms | my $annotated_group_name = $self->annotate_groups_obj->_groups_to_consensus_gene_names->{$group}; # spent 65.7ms making 36430 calls to Bio::Roary::AnnotateGroups::_groups_to_consensus_gene_names, avg 2µs/call
# spent 49.3ms making 36430 calls to Bio::Roary::Output::EmblGroups::annotate_groups_obj, avg 1µs/call |
151 | 36430 | 4.25ms | my $colour = 1; | ||
152 | |||||
153 | 36430 | 177ms | 82596 | 122ms | return '' if(!(defined($self->groups_to_contigs->{$annotated_group_name}) && defined($self->groups_to_contigs->{$annotated_group_name}->{$self->ordering_key}) )); # spent 83.7ms making 59513 calls to Bio::Roary::Output::EmblGroups::groups_to_contigs, avg 1µs/call
# spent 37.9ms making 23083 calls to Bio::Roary::Output::EmblGroups::ordering_key, avg 2µs/call |
154 | 4967 | 14.1ms | 9934 | 14.3ms | return '' if(defined($self->groups_to_contigs->{$annotated_group_name}->{comment}) && $self->groups_to_contigs->{$annotated_group_name}->{comment} ne ''); # spent 14.3ms making 9934 calls to Bio::Roary::Output::EmblGroups::groups_to_contigs, avg 1µs/call |
155 | 4967 | 13.3ms | 9934 | 15.3ms | my $coordindates = $self->groups_to_contigs->{$annotated_group_name}->{$self->ordering_key}; # spent 8.34ms making 4967 calls to Bio::Roary::Output::EmblGroups::ordering_key, avg 2µs/call
# spent 6.95ms making 4967 calls to Bio::Roary::Output::EmblGroups::groups_to_contigs, avg 1µs/call |
156 | 4967 | 7.80ms | 4967 | 27.5ms | my $annotation_type = $self->_annotation_type($annotated_group_name); # spent 27.5ms making 4967 calls to Bio::Roary::Output::EmblGroups::_annotation_type, avg 6µs/call |
157 | |||||
158 | 4967 | 20.0ms | 9934 | 19.6ms | $colour = $self->_block_colour($self->groups_to_contigs->{$annotated_group_name}->{accessory_label}); # spent 11.5ms making 4967 calls to Bio::Roary::Output::EmblGroups::_block_colour, avg 2µs/call
# spent 8.14ms making 4967 calls to Bio::Roary::Output::EmblGroups::groups_to_contigs, avg 2µs/call |
159 | |||||
160 | 4967 | 3.22ms | my $tab_file_entry = "FT$annotation_type$coordindates\n"; | ||
161 | 4967 | 1.44ms | $tab_file_entry .= "FT /label=$annotated_group_name\n"; | ||
162 | 4967 | 1.42ms | $tab_file_entry .= "FT /locus_tag=$annotated_group_name\n"; | ||
163 | 4967 | 1.46ms | $tab_file_entry .= "FT /colour=$colour\n"; | ||
164 | |||||
165 | 4967 | 16.0ms | return $tab_file_entry; | ||
166 | } | ||||
167 | |||||
168 | sub _annotation_type | ||||
169 | # spent 27.5ms (23.7+3.86) within Bio::Roary::Output::EmblGroups::_annotation_type which was called 4967 times, avg 6µs/call:
# 4967 times (23.7ms+3.86ms) by Bio::Roary::Output::EmblGroups::_header_block at line 156, avg 6µs/call | ||||
170 | 4967 | 3.22ms | my ( $self, $annotated_group_name ) = @_; | ||
171 | 4967 | 939µs | my $annotation_type = " feature "; | ||
172 | 4967 | 13.6ms | 4967 | 3.86ms | if($annotated_group_name =~ /group_/) # spent 3.86ms making 4967 calls to Bio::Roary::Output::EmblGroups::CORE:match, avg 778ns/call |
173 | { | ||||
174 | $annotation_type = " misc_feature "; | ||||
175 | } | ||||
176 | 4967 | 11.3ms | return $annotation_type; | ||
177 | } | ||||
178 | |||||
179 | sub _fragment_blocks | ||||
180 | # spent 505ms (314+191) within Bio::Roary::Output::EmblGroups::_fragment_blocks which was called 2 times, avg 252ms/call:
# 2 times (314ms+191ms) by Bio::Roary::Output::EmblGroups::create_files at line 232, avg 252ms/call | ||||
181 | 2 | 2µs | my ( $self, $fh ) = @_; | ||
182 | 2 | 1µs | my %fragment_numbers; | ||
183 | 2 | 7.61ms | 4 | 14.8ms | for my $group ( @{ $self->annotate_groups_obj->_groups }) # spent 14.8ms making 2 calls to Bio::Roary::AnnotateGroups::_groups, avg 7.40ms/call
# spent 6µs making 2 calls to Bio::Roary::Output::EmblGroups::annotate_groups_obj, avg 3µs/call |
184 | { | ||||
185 | 36430 | 102ms | 72860 | 120ms | my $annotated_group_name = $self->annotate_groups_obj->_groups_to_consensus_gene_names->{$group}; # spent 65.4ms making 36430 calls to Bio::Roary::AnnotateGroups::_groups_to_consensus_gene_names, avg 2µs/call
# spent 54.8ms making 36430 calls to Bio::Roary::Output::EmblGroups::annotate_groups_obj, avg 2µs/call |
186 | |||||
187 | 36430 | 82.3ms | 36430 | 52.8ms | next unless(defined($self->groups_to_contigs->{$annotated_group_name}->{accessory_label})); # spent 52.8ms making 36430 calls to Bio::Roary::Output::EmblGroups::groups_to_contigs, avg 1µs/call |
188 | 232 | 865µs | 464 | 1.11ms | next unless(defined($self->groups_to_contigs->{$annotated_group_name}->{$self->ordering_key})); # spent 784µs making 232 calls to Bio::Roary::Output::EmblGroups::ordering_key, avg 3µs/call
# spent 329µs making 232 calls to Bio::Roary::Output::EmblGroups::groups_to_contigs, avg 1µs/call |
189 | 230 | 859µs | 460 | 757µs | next if($self->groups_to_contigs->{$annotated_group_name}->{$self->ordering_key} eq ''); # spent 411µs making 230 calls to Bio::Roary::Output::EmblGroups::ordering_key, avg 2µs/call
# spent 346µs making 230 calls to Bio::Roary::Output::EmblGroups::groups_to_contigs, avg 2µs/call |
190 | 230 | 1.50ms | 690 | 1.09ms | push(@{$fragment_numbers{$self->groups_to_contigs->{$annotated_group_name}->{accessory_label}} }, $self->groups_to_contigs->{$annotated_group_name}->{$self->ordering_key}); # spent 675µs making 460 calls to Bio::Roary::Output::EmblGroups::groups_to_contigs, avg 1µs/call
# spent 412µs making 230 calls to Bio::Roary::Output::EmblGroups::ordering_key, avg 2µs/call |
191 | } | ||||
192 | |||||
193 | 2 | 61µs | for my $accessory_label (keys %fragment_numbers) | ||
194 | { | ||||
195 | 8 | 6µs | next unless(defined($fragment_numbers{$accessory_label})); | ||
196 | 8 | 173µs | 8 | 56µs | my @sorted_fragment = sort {$a <=> $b} @{$fragment_numbers{$accessory_label} }; # spent 56µs making 8 calls to Bio::Roary::Output::EmblGroups::CORE:sort, avg 7µs/call |
197 | 8 | 4µs | my $tab_file_entry = ''; | ||
198 | 8 | 8µs | if(@sorted_fragment > 1) | ||
199 | { | ||||
200 | 6 | 2µs | my $min = $sorted_fragment[0]; | ||
201 | 6 | 4µs | my $max = $sorted_fragment[-1]; | ||
202 | |||||
203 | 6 | 6µs | next if(!defined($min) || !defined($max) || $min eq '' || $max eq ''); | ||
204 | 6 | 12µs | $tab_file_entry = "FT feature $min".'..'."$max\n"; | ||
205 | } | ||||
206 | elsif(@sorted_fragment == 1) | ||||
207 | { | ||||
208 | 2 | 900ns | my $min = $sorted_fragment[0]; | ||
209 | 2 | 1µs | next if(!defined($min) || $min eq ''); | ||
210 | 2 | 1µs | $tab_file_entry = "FT feature $min\n"; | ||
211 | } | ||||
212 | else | ||||
213 | { | ||||
214 | next; | ||||
215 | } | ||||
216 | 8 | 33µs | 8 | 46µs | $tab_file_entry .= "FT /colour=".$self->_block_colour($accessory_label)."\n"; # spent 46µs making 8 calls to Bio::Roary::Output::EmblGroups::_block_colour, avg 6µs/call |
217 | |||||
218 | 8 | 96µs | 8 | 12µs | print {$fh} $tab_file_entry; # spent 12µs making 8 calls to Bio::Roary::Output::EmblGroups::CORE:print, avg 2µs/call |
219 | } | ||||
220 | |||||
221 | } | ||||
222 | |||||
223 | # spent 6.50s (469ms+6.03) within Bio::Roary::Output::EmblGroups::create_files which was called 2 times, avg 3.25s/call:
# once (246ms+3.40s) by Bio::Roary::PostAnalysis::_create_embl_files at line 193 of lib/Bio/Roary/PostAnalysis.pm
# once (223ms+2.63s) by Bio::Roary::PostAnalysis::_create_embl_files at line 202 of lib/Bio/Roary/PostAnalysis.pm | ||||
224 | 2 | 3µs | my ($self) = @_; | ||
225 | |||||
226 | 2 | 46µs | 6 | 600µs | print { $self->_output_header_fh } $self->_header_top(); # spent 569µs making 2 calls to Bio::Roary::Output::EmblGroups::_output_header_fh, avg 284µs/call
# spent 20µs making 2 calls to Bio::Roary::Output::EmblGroups::_header_top, avg 10µs/call
# spent 11µs making 2 calls to Bio::Roary::Output::EmblGroups::CORE:print, avg 5µs/call |
227 | 2 | 2.71ms | 4 | 20.4ms | for my $group ( @{ $self->annotate_groups_obj->_groups }) # spent 20.3ms making 2 calls to Bio::Roary::AnnotateGroups::_groups, avg 10.2ms/call
# spent 13µs making 2 calls to Bio::Roary::Output::EmblGroups::annotate_groups_obj, avg 7µs/call |
228 | { | ||||
229 | 36430 | 165ms | 109290 | 4.55s | print { $self->_output_fh } $self->_block($group); # spent 4.46s making 36430 calls to Bio::Roary::Output::EmblGroups::_block, avg 122µs/call
# spent 72.4ms making 36430 calls to Bio::Roary::Output::EmblGroups::_output_fh, avg 2µs/call
# spent 17.3ms making 36430 calls to Bio::Roary::Output::EmblGroups::CORE:print, avg 475ns/call |
230 | 36430 | 177ms | 109290 | 960ms | print { $self->_output_header_fh } $self->_header_block($group); # spent 872ms making 36430 calls to Bio::Roary::Output::EmblGroups::_header_block, avg 24µs/call
# spent 73.5ms making 36430 calls to Bio::Roary::Output::EmblGroups::_output_header_fh, avg 2µs/call
# spent 14.8ms making 36430 calls to Bio::Roary::Output::EmblGroups::CORE:print, avg 407ns/call |
231 | } | ||||
232 | 2 | 37µs | 4 | 505ms | $self->_fragment_blocks($self->_output_header_fh); # spent 505ms making 2 calls to Bio::Roary::Output::EmblGroups::_fragment_blocks, avg 252ms/call
# spent 26µs making 2 calls to Bio::Roary::Output::EmblGroups::_output_header_fh, avg 13µs/call |
233 | 2 | 20µs | 6 | 24µs | print { $self->_output_header_fh } $self->_header_bottom(); # spent 11µs making 2 calls to Bio::Roary::Output::EmblGroups::_header_bottom, avg 6µs/call
# spent 11µs making 2 calls to Bio::Roary::Output::EmblGroups::_output_header_fh, avg 6µs/call
# spent 2µs making 2 calls to Bio::Roary::Output::EmblGroups::CORE:print, avg 900ns/call |
234 | 2 | 342µs | 4 | 310µs | close( $self->_output_header_fh); # spent 305µs making 2 calls to Bio::Roary::Output::EmblGroups::CORE:close, avg 152µs/call
# spent 5µs making 2 calls to Bio::Roary::Output::EmblGroups::_output_header_fh, avg 2µs/call |
235 | 2 | 240µs | 4 | 219µs | close( $self->_output_fh ); # spent 204µs making 2 calls to Bio::Roary::Output::EmblGroups::CORE:close, avg 102µs/call
# spent 15µs making 2 calls to Bio::Roary::Output::EmblGroups::_output_fh, avg 7µs/call |
236 | } | ||||
237 | |||||
238 | |||||
239 | 2 | 50µs | 2 | 213µs | # spent 112µs (11+101) within Bio::Roary::Output::EmblGroups::BEGIN@239 which was called:
# once (11µs+101µs) by Bio::Roary::PostAnalysis::BEGIN@21 at line 239 # spent 112µs making 1 call to Bio::Roary::Output::EmblGroups::BEGIN@239
# spent 101µs making 1 call to Moose::unimport |
240 | 1 | 7µs | 2 | 7.22ms | __PACKAGE__->meta->make_immutable; # spent 7.21ms making 1 call to Class::MOP::Class::make_immutable
# spent 15µs making 1 call to Bio::Roary::Output::EmblGroups::meta |
241 | |||||
242 | 1 | 62µs | 1; |