| Filename | /Users/ap13/pathogens/Roary/lib/Bio/Roary/Output/GroupsMultifastasNucleotide.pm |
| Statements | Executed 21 statements in 739µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1.29ms | 35.6ms | Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@23 |
| 1 | 1 | 1 | 49µs | 5.16ms | Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@19 |
| 1 | 1 | 1 | 14µs | 54µs | Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@20 |
| 1 | 1 | 1 | 10µs | 116µs | Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@75 |
| 1 | 1 | 1 | 8µs | 8µs | Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@21 |
| 1 | 1 | 1 | 7µs | 7µs | Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@22 |
| 0 | 0 | 0 | 0s | 0s | Bio::Roary::Output::GroupsMultifastasNucleotide::_build__number_of_groups |
| 0 | 0 | 0 | 0s | 0s | Bio::Roary::Output::GroupsMultifastasNucleotide::_build_output_directory |
| 0 | 0 | 0 | 0s | 0s | Bio::Roary::Output::GroupsMultifastasNucleotide::create_files |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | |||||
| 2 | package Bio::Roary::Output::GroupsMultifastasNucleotide; | ||||
| 3 | |||||
| 4 | # ABSTRACT: Take in a set of GFF files and a groups file and output one multifasta file per group with nucleotide sequences. | ||||
| 5 | |||||
| 6 | =head1 SYNOPSIS | ||||
| 7 | |||||
| 8 | Take in a set of GFF files and a groups file and output one multifasta file per group with nucleotide sequences. | ||||
| 9 | use Bio::Roary::Output::GroupsMultifastasNucleotide; | ||||
| 10 | |||||
| 11 | my $obj = Bio::Roary::Output::GroupsMultifastasNucleotide->new( | ||||
| 12 | group_names => ['aaa','bbb'], | ||||
| 13 | analyse_groups => $analyse_groups | ||||
| 14 | ); | ||||
| 15 | $obj->create_files(); | ||||
| 16 | |||||
| 17 | =cut | ||||
| 18 | |||||
| 19 | 2 | 67µs | 2 | 10.3ms | # spent 5.16ms (49µs+5.11) within Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@19 which was called:
# once (49µs+5.11ms) by Bio::Roary::PostAnalysis::BEGIN@18 at line 19 # spent 5.16ms making 1 call to Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@19
# spent 5.11ms making 1 call to Moose::import |
| 20 | 2 | 35µs | 2 | 93µs | # spent 54µs (14+39) within Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@20 which was called:
# once (14µs+39µs) by Bio::Roary::PostAnalysis::BEGIN@18 at line 20 # spent 54µs making 1 call to Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@20
# spent 39µs making 1 call to Exporter::import |
| 21 | 2 | 28µs | 1 | 8µs | # spent 8µs within Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@21 which was called:
# once (8µs+0s) by Bio::Roary::PostAnalysis::BEGIN@18 at line 21 # spent 8µs making 1 call to Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@21 |
| 22 | 2 | 34µs | 1 | 7µs | # spent 7µs within Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@22 which was called:
# once (7µs+0s) by Bio::Roary::PostAnalysis::BEGIN@18 at line 22 # spent 7µs making 1 call to Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@22 |
| 23 | 2 | 444µs | 1 | 35.6ms | # spent 35.6ms (1.29+34.3) within Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@23 which was called:
# once (1.29ms+34.3ms) by Bio::Roary::PostAnalysis::BEGIN@18 at line 23 # spent 35.6ms making 1 call to Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@23 |
| 24 | |||||
| 25 | 1 | 2µs | 1 | 1.89ms | has 'gff_files' => ( is => 'ro', isa => 'ArrayRef', required => 1 ); # spent 1.89ms making 1 call to Moose::has |
| 26 | 1 | 2µs | 1 | 1.58ms | has 'group_names' => ( is => 'ro', isa => 'ArrayRef', required => 0 ); # spent 1.58ms making 1 call to Moose::has |
| 27 | 1 | 2µs | 1 | 1.55ms | has 'annotate_groups' => ( is => 'ro', isa => 'Bio::Roary::AnnotateGroups', required => 1 ); # spent 1.55ms making 1 call to Moose::has |
| 28 | 1 | 2µs | 1 | 1.74ms | has 'output_multifasta_files' => ( is => 'ro', isa => 'Bool', default => 0 ); # spent 1.74ms making 1 call to Moose::has |
| 29 | |||||
| 30 | 1 | 2µs | 1 | 2.05ms | has 'output_directory' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build_output_directory'); # spent 2.05ms making 1 call to Moose::has |
| 31 | |||||
| 32 | 1 | 2µs | 1 | 3.88ms | has '_number_of_groups' => ( is => 'rw', isa => 'Num', lazy_build => 1 ); # spent 3.88ms making 1 call to Moose::has |
| 33 | 1 | 2µs | 1 | 1.91ms | has 'group_limit' => ( is => 'rw', isa => 'Num', default => 50000 ); # spent 1.91ms making 1 call to Moose::has |
| 34 | |||||
| 35 | sub _build_output_directory | ||||
| 36 | { | ||||
| 37 | my ($self) = @_; | ||||
| 38 | my $output_directory = 'pan_genome_sequences'; | ||||
| 39 | return $output_directory; | ||||
| 40 | } | ||||
| 41 | |||||
| 42 | sub _build__number_of_groups { | ||||
| 43 | my $self = shift; | ||||
| 44 | |||||
| 45 | return $self->annotate_groups->_group_counter; | ||||
| 46 | } | ||||
| 47 | |||||
| 48 | sub create_files { | ||||
| 49 | my ($self) = @_; | ||||
| 50 | |||||
| 51 | my $num_groups = $self->_number_of_groups; | ||||
| 52 | my $limit = $self->group_limit; | ||||
| 53 | if ( $num_groups > $limit ){ | ||||
| 54 | print STDERR "Number of clusters ($num_groups) exceeds limit ($limit). Multifastas not created. Please check the spreadsheet for contamination from different species.\n"; | ||||
| 55 | return 1; | ||||
| 56 | } | ||||
| 57 | |||||
| 58 | make_path($self->output_directory); | ||||
| 59 | |||||
| 60 | # if its output_multifasta_files == false then you want to create the core genome and delete all intermediate multifasta files | ||||
| 61 | for my $gff_file ( @{ $self->gff_files } ) | ||||
| 62 | { | ||||
| 63 | my $gff_multifasta = Bio::Roary::Output::GroupsMultifastaNucleotide->new( | ||||
| 64 | gff_file => $gff_file, | ||||
| 65 | group_names => $self->group_names, | ||||
| 66 | output_directory => $self->output_directory, | ||||
| 67 | annotate_groups => $self->annotate_groups, | ||||
| 68 | output_multifasta_files => $self->output_multifasta_files | ||||
| 69 | ); | ||||
| 70 | $gff_multifasta->populate_files; | ||||
| 71 | } | ||||
| 72 | 1; | ||||
| 73 | } | ||||
| 74 | |||||
| 75 | 2 | 53µs | 2 | 221µs | # spent 116µs (10+105) within Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@75 which was called:
# once (10µs+105µs) by Bio::Roary::PostAnalysis::BEGIN@18 at line 75 # spent 116µs making 1 call to Bio::Roary::Output::GroupsMultifastasNucleotide::BEGIN@75
# spent 105µs making 1 call to Moose::unimport |
| 76 | 1 | 6µs | 2 | 7.15ms | __PACKAGE__->meta->make_immutable; # spent 7.14ms making 1 call to Class::MOP::Class::make_immutable
# spent 15µs making 1 call to Bio::Roary::Output::GroupsMultifastasNucleotide::meta |
| 77 | |||||
| 78 | 1 | 58µs | 1; | ||
| 79 |