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

Filename/Users/ap13/pathogens/Roary/lib/Bio/Roary/External/ProteinMuscleAlignmentFromNucleotides.pm
StatementsExecuted 15 statements in 514µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11148µs4.42msBio::Roary::External::ProteinMuscleAlignmentFromNucleotides::::BEGIN@23Bio::Roary::External::ProteinMuscleAlignmentFromNucleotides::BEGIN@23
11111µs110µsBio::Roary::External::ProteinMuscleAlignmentFromNucleotides::::BEGIN@88Bio::Roary::External::ProteinMuscleAlignmentFromNucleotides::BEGIN@88
0000s0sBio::Roary::External::ProteinMuscleAlignmentFromNucleotides::::_build__core_alignment_cmdBio::Roary::External::ProteinMuscleAlignmentFromNucleotides::_build__core_alignment_cmd
0000s0sBio::Roary::External::ProteinMuscleAlignmentFromNucleotides::::_build__memory_required_in_mbBio::Roary::External::ProteinMuscleAlignmentFromNucleotides::_build__memory_required_in_mb
0000s0sBio::Roary::External::ProteinMuscleAlignmentFromNucleotides::::_command_to_runBio::Roary::External::ProteinMuscleAlignmentFromNucleotides::_command_to_run
0000s0sBio::Roary::External::ProteinMuscleAlignmentFromNucleotides::::runBio::Roary::External::ProteinMuscleAlignmentFromNucleotides::run
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::External::ProteinMuscleAlignmentFromNucleotides;
2
3# ABSTRACT: Take in a multifasta file of nucleotides, convert to proteins and align with muscle
4
5=head1 SYNOPSIS
6
7Take in a multifasta file of nucleotides, convert to proteins and align with muscle
8
9 use Bio::Roary::External::ProteinMuscleAlignmentFromNucleotides;
10
11 my $seg = Bio::Roary::External::ProteinMuscleAlignmentFromNucleotides->new(
12 fasta_files => [],
13 );
14
15 $seg->run();
16
17=method output_file
18
19Returns the path to the results file
20
21=cut
22
232385µs28.79ms
# spent 4.42ms (48µs+4.37) within Bio::Roary::External::ProteinMuscleAlignmentFromNucleotides::BEGIN@23 which was called: # once (48µs+4.37ms) by Bio::Roary::CommandLine::RoaryPostAnalysis::BEGIN@15 at line 23
use Moose;
# spent 4.42ms making 1 call to Bio::Roary::External::ProteinMuscleAlignmentFromNucleotides::BEGIN@23 # spent 4.37ms making 1 call to Moose::import
2413µs116.9mswith 'Bio::Roary::JobRunner::Role';
# spent 16.9ms making 1 call to Moose::with
25
2614µs11.72mshas 'fasta_files' => ( is => 'ro', isa => 'ArrayRef', required => 1 );
# spent 1.72ms making 1 call to Moose::has
2712µs11.53mshas 'exec' => ( is => 'ro', isa => 'Str', default => 'protein_muscle_alignment_from_nucleotides' );
# spent 1.53ms making 1 call to Moose::has
2812µs12.72mshas 'translation_table' => ( is => 'rw', isa => 'Int', default => 11 );
# spent 2.72ms making 1 call to Moose::has
2912µs11.72mshas 'core_definition' => ( is => 'ro', isa => 'Num', default => 1 );
# spent 1.72ms making 1 call to Moose::has
30
31# Overload Role
3212µs12.23mshas '_memory_required_in_mb' => ( is => 'ro', isa => 'Int', lazy => 1, builder => '_build__memory_required_in_mb' );
# spent 2.23ms making 1 call to Moose::has
3312µs12.17mshas '_queue' => ( is => 'rw', isa => 'Str', default => 'normal' );
# spent 2.17ms making 1 call to Moose::has
3412µs11.59mshas '_files_per_chunk' => ( is => 'ro', isa => 'Int', default => 25 );
# spent 1.59ms making 1 call to Moose::has
3512µs14.22mshas '_core_alignment_cmd' => ( is => 'rw', isa => 'Str', lazy_build => 1 );
# spent 4.22ms making 1 call to Moose::has
36
37sub _build__memory_required_in_mb {
38 my ($self) = @_;
39 my $memory_required = 5000;
40 return $memory_required;
41}
42
43sub _command_to_run {
44 my ( $self, $fasta_files, ) = @_;
45 return $self->exec. " -t ".$self->translation_table." ". join( " ", @{$fasta_files} );
46}
47
48sub _build__core_alignment_cmd {
49 my ( $self ) = @_;
50
51 my $core_cmd = "pan_genome_core_alignment";
52 $core_cmd .= " -cd " . ($self->core_definition*100) if ( defined $self->core_definition );
53 return $core_cmd;
54}
55
56sub run {
57 my ($self) = @_;
58 my @commands_to_run;
59
60 my @files_chunk;
61 for my $fasta_file ( @{ $self->fasta_files } ) {
62 push(@files_chunk,$fasta_file);
63 if(@files_chunk == $self->_files_per_chunk )
64 {
65 push(@commands_to_run, $self->_command_to_run(\@files_chunk));
66 @files_chunk = ();
67 }
68 }
69
70 if(@files_chunk > 0)
71 {
72 push(@commands_to_run, $self->_command_to_run(\@files_chunk));
73 }
74
75 my $job_runner_obj = $self->_job_runner_class->new(
76 commands_to_run => \@commands_to_run,
77 memory_in_mb => $self->_memory_required_in_mb,
78 queue => $self->_queue,
79 dont_wait => 1,
80 cpus => $self->cpus
81 );
82 $job_runner_obj->run();
83
84 $job_runner_obj->submit_dependancy_job($self->_core_alignment_cmd);
85 1;
86}
87
88249µs2209µs
# spent 110µs (11+99) within Bio::Roary::External::ProteinMuscleAlignmentFromNucleotides::BEGIN@88 which was called: # once (11µs+99µs) by Bio::Roary::CommandLine::RoaryPostAnalysis::BEGIN@15 at line 88
no Moose;
# spent 110µs making 1 call to Bio::Roary::External::ProteinMuscleAlignmentFromNucleotides::BEGIN@88 # spent 99µs making 1 call to Moose::unimport
8918µs29.23ms__PACKAGE__->meta->make_immutable;
90149µs1;