← Index
NYTProf Performance Profile   « block view • line view • sub view »
For bin/pan_genome_post_analysis
  Run on Fri Mar 27 10:01:31 2015
Reported on Fri Mar 27 10:03:35 2015

Filename/Users/ap13/pathogens/Roary/lib/Bio/Roary/External/ProteinMuscleAlignmentFromNucleotides.pm
StatementsExecuted 15 statements in 570µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11148µs5.18msBio::Roary::External::ProteinMuscleAlignmentFromNucleotides::::BEGIN@23Bio::Roary::External::ProteinMuscleAlignmentFromNucleotides::BEGIN@23
11112µs124µ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
232438µs210.3ms
# spent 5.18ms (48µs+5.14) within Bio::Roary::External::ProteinMuscleAlignmentFromNucleotides::BEGIN@23 which was called: # once (48µs+5.14ms) by Bio::Roary::CommandLine::RoaryPostAnalysis::BEGIN@15 at line 23
use Moose;
# spent 5.18ms making 1 call to Bio::Roary::External::ProteinMuscleAlignmentFromNucleotides::BEGIN@23 # spent 5.14ms making 1 call to Moose::import
2413µs116.8mswith 'Bio::Roary::JobRunner::Role';
# spent 16.8ms making 1 call to Moose::with
25
2614µs11.63mshas 'fasta_files' => ( is => 'ro', isa => 'ArrayRef', required => 1 );
# spent 1.63ms making 1 call to Moose::has
2712µs11.52mshas 'exec' => ( is => 'ro', isa => 'Str', default => 'protein_muscle_alignment_from_nucleotides' );
# spent 1.52ms making 1 call to Moose::has
2812µs11.85mshas 'translation_table' => ( is => 'rw', isa => 'Int', default => 11 );
# spent 1.85ms making 1 call to Moose::has
2912µs11.51mshas 'core_definition' => ( is => 'ro', isa => 'Num', default => 1 );
# spent 1.51ms making 1 call to Moose::has
30
31# Overload Role
3212µs12.19mshas '_memory_required_in_mb' => ( is => 'ro', isa => 'Int', lazy => 1, builder => '_build__memory_required_in_mb' );
# spent 2.19ms making 1 call to Moose::has
3312µs12.00mshas '_queue' => ( is => 'rw', isa => 'Str', default => 'normal' );
# spent 2.00ms making 1 call to Moose::has
3412µs11.51mshas '_files_per_chunk' => ( is => 'ro', isa => 'Int', default => 25 );
# spent 1.51ms making 1 call to Moose::has
3512µs13.97mshas '_core_alignment_cmd' => ( is => 'rw', isa => 'Str', lazy_build => 1 );
# spent 3.97ms 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
88258µs2236µs
# spent 124µs (12+112) within Bio::Roary::External::ProteinMuscleAlignmentFromNucleotides::BEGIN@88 which was called: # once (12µs+112µs) by Bio::Roary::CommandLine::RoaryPostAnalysis::BEGIN@15 at line 88
no Moose;
# spent 124µs making 1 call to Bio::Roary::External::ProteinMuscleAlignmentFromNucleotides::BEGIN@88 # spent 112µs making 1 call to Moose::unimport
8917µs29.35ms__PACKAGE__->meta->make_immutable;
90148µs1;