← 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/ClustersRole.pm
StatementsExecuted 16454 statements in 28.2ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11122.5ms30.0msBio::Roary::ClustersRole::::_build__clustered_genesBio::Roary::ClustersRole::_build__clustered_genes
5250215.88ms5.88msBio::Roary::ClustersRole::::CORE:matchBio::Roary::ClustersRole::CORE:match (opcode)
2626211.59ms1.59msBio::Roary::ClustersRole::::CORE:readlineBio::Roary::ClustersRole::CORE:readline (opcode)
1111.07ms12.0msBio::Roary::ClustersRole::::BEGIN@11Bio::Roary::ClustersRole::BEGIN@11
11115µs15µsBio::Roary::ClustersRole::::CORE:openBio::Roary::ClustersRole::CORE:open (opcode)
11114µs32µsBio::Roary::ClustersRole::::_build__clusters_fhBio::Roary::ClustersRole::_build__clusters_fh
1118µs8µsBio::Roary::ClustersRole::::BEGIN@12Bio::Roary::ClustersRole::BEGIN@12
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::ClustersRole;
2# ABSTRACT: A role to read a clusters file from CD hit
3
4=head1 SYNOPSIS
5
6A role to read a clusters file from CD hit
7 with 'Bio::Roary::ClustersRole';
8
9=cut
10
112145µs215.2ms
# spent 12.0ms (1.07+10.9) within Bio::Roary::ClustersRole::BEGIN@11 which was called: # once (1.07ms+10.9ms) by Module::Runtime::require_module at line 11
use Moose::Role;
# spent 12.0ms making 1 call to Bio::Roary::ClustersRole::BEGIN@11 # spent 3.22ms making 1 call to Moose::Role::import
122326µs18µs
# spent 8µs within Bio::Roary::ClustersRole::BEGIN@12 which was called: # once (8µs+0s) by Module::Runtime::require_module at line 12
use Bio::Roary::Exceptions;
# spent 8µs making 1 call to Bio::Roary::ClustersRole::BEGIN@12
13
1413µs1220µshas 'clusters_filename' => ( is => 'ro', isa => 'Str', required => 1 );
# spent 220µs making 1 call to Moose::Role::has
1511µs191µshas '_clustered_genes' => ( is => 'ro',lazy => 1, builder => '_build__clustered_genes' );
# spent 91µs making 1 call to Moose::Role::has
1611µs186µshas '_clusters_fh' => ( is => 'ro',lazy => 1, builder => '_build__clusters_fh' );
# spent 86µs making 1 call to Moose::Role::has
17
18sub _build__clusters_fh
19
# spent 32µs (14+19) within Bio::Roary::ClustersRole::_build__clusters_fh which was called: # once (14µs+19µs) by Bio::Roary::InflateClusters::_clusters_fh at line 11 of (eval 25)[Eval/Closure.pm:125]
{
20328µs my($self) = @_;
21218µs open(my $fh, $self->clusters_filename) or Bio::Roary::Exceptions::FileNotFound->throw( error => 'Cant open file: ' . $self->clusters_filename );
# spent 15µs making 1 call to Bio::Roary::ClustersRole::CORE:open # spent 4µs making 1 call to Bio::Roary::InflateClusters::clusters_filename
22 return $fh;
23}
24
25sub _build__clustered_genes
26
# spent 30.0ms (22.5+7.51) within Bio::Roary::ClustersRole::_build__clustered_genes which was called: # once (22.5ms+7.51ms) by Bio::Roary::InflateClusters::_clustered_genes at line 11 of (eval 25)[Eval/Closure.pm:125]
{
271644327.7ms my($self) = @_;
28148µs my $fh = $self->_clusters_fh;
# spent 48µs making 1 call to Bio::Roary::InflateClusters::_clusters_fh
29 my %clustered_genes ;
30
31 my %raw_clusters;
32 my $current_cluster_name;
33111µs while(<$fh>)
# spent 11µs making 1 call to Bio::Roary::ClustersRole::CORE:readline
34 {
35 my $line = $_;
3626251.15ms if($line =~ /^>(.+)$/)
# spent 1.15ms making 2625 calls to Bio::Roary::ClustersRole::CORE:match, avg 437ns/call
37 {
38 $current_cluster_name = $1;
39 }
40
41 #>Cluster 5
42 #0 4201aa, >6630_4#9_00008... *
43 #1 4201aa, >6631_1#23_00379... at 100.00%
44
4552506.30ms if($line =~ /[\d]+\t[\w]+, >(.+)\.\.\. (.+)$/)
# spent 4.73ms making 2625 calls to Bio::Roary::ClustersRole::CORE:match, avg 2µs/call # spent 1.58ms making 2625 calls to Bio::Roary::ClustersRole::CORE:readline, avg 600ns/call
46 {
47 my $gene_name = $1;
48 my $identity = $2;
49
50 if($identity eq '*')
51 {
52 $raw_clusters{$current_cluster_name}{representative_gene_name} = $gene_name;
53 }
54 else
55 {
56 push(@{$raw_clusters{$current_cluster_name}{gene_names}}, $gene_name);
57 }
58 }
59 }
60
61 # iterate over the raw clusters and convert to a simple hash
62 for my $cluster_name (keys %raw_clusters)
63 {
64 $clustered_genes{$raw_clusters{$cluster_name}{representative_gene_name}} = $raw_clusters{$cluster_name}{gene_names};
65 }
66
67 return \%clustered_genes;
68}
69
70110µs1;
 
# spent 5.88ms within Bio::Roary::ClustersRole::CORE:match which was called 5250 times, avg 1µs/call: # 2625 times (4.73ms+0s) by Bio::Roary::ClustersRole::_build__clustered_genes at line 45, avg 2µs/call # 2625 times (1.15ms+0s) by Bio::Roary::ClustersRole::_build__clustered_genes at line 36, avg 437ns/call
sub Bio::Roary::ClustersRole::CORE:match; # opcode
# spent 15µs within Bio::Roary::ClustersRole::CORE:open which was called: # once (15µs+0s) by Bio::Roary::ClustersRole::_build__clusters_fh at line 21
sub Bio::Roary::ClustersRole::CORE:open; # opcode
# spent 1.59ms within Bio::Roary::ClustersRole::CORE:readline which was called 2626 times, avg 604ns/call: # 2625 times (1.58ms+0s) by Bio::Roary::ClustersRole::_build__clustered_genes at line 45, avg 600ns/call # once (11µs+0s) by Bio::Roary::ClustersRole::_build__clustered_genes at line 33
sub Bio::Roary::ClustersRole::CORE:readline; # opcode