Skip to content

Commit 065ecb1

Browse files
committed
Merge branch 'develop'
2 parents 6d2b216 + e246a11 commit 065ecb1

File tree

4 files changed

+31
-29
lines changed

4 files changed

+31
-29
lines changed

lib/BioX/Workflow/Command.pm

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ use File::Path qw(make_path);
1111

1212
app_strict 0;
1313

14+
with 'BioX::Workflow::Command::Utils::Log';
15+
with 'BioX::Workflow::Command::Utils::Plugin';
16+
with 'HPC::Runner::Command::Utils::ManyConfigs';
17+
18+
option 'config_base' => (
19+
is => 'rw',
20+
default => '.bioxworkflow',
21+
);
22+
1423
option 'cache_dir' => (
1524
is => 'rw',
1625
isa => Path,
@@ -21,19 +30,19 @@ option 'cache_dir' => (
2130
documentation =>
2231
'BioX-Workflow will cache some information during your runs. '
2332
. 'Delete with caution! '
24-
. '[Default: '.getcwd().'/biox-cache. ]'
33+
. '[Default: '
34+
. getcwd()
35+
. '/biox-cache. ]'
2536
);
2637

27-
sub BUILD {
28-
my $self = shift;
29-
}
38+
sub BUILD {}
3039

3140
before 'BUILD' => sub {
3241
my $self = shift;
3342

3443
make_path( $self->cache_dir );
35-
make_path(File::Spec->catdir($self->cache_dir, 'logs'));
36-
make_path(File::Spec->catdir($self->cache_dir, 'workflows'));
44+
make_path( File::Spec->catdir( $self->cache_dir, 'logs' ) );
45+
make_path( File::Spec->catdir( $self->cache_dir, 'workflows' ) );
3746
};
3847

3948
no Moose;

lib/BioX/Workflow/Command/Utils/Plugin.pm

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package BioX::Workflow::Command::Utils::Plugin;
33
use MooseX::App::Role;
44

55
#TODO make this into a general Plugin Loader
6+
with 'BioX::Workflow::Command::Utils::Log';
67

78
use Cwd qw(getcwd);
89
use Try::Tiny;
@@ -49,25 +50,16 @@ option 'plugins_opts' => (
4950
5051
=cut
5152

52-
sub BUILD {}
53+
sub BUILD { }
5354

5455
after 'BUILD' => sub {
55-
my $self = shift;
56-
57-
return unless $self->plugins;
58-
59-
$self->app_load_plugins( $self->plugins );
60-
$self->parse_plugin_opts( $self->plugins_opts );
61-
};
62-
63-
sub gen_load_plugins {
6456
my $self = shift;
6557

6658
return unless $self->plugins;
6759

6860
$self->app_load_plugins( $self->plugins );
6961
$self->parse_plugin_opts( $self->plugins_opts );
70-
}
62+
};
7163

7264
=head3 app_load_plugin
7365
@@ -85,7 +77,8 @@ sub app_load_plugins {
8577
}
8678
catch {
8779
$self->app_log->warn("Could not load plugin $plugin!\n$_");
88-
}
80+
};
81+
$self->app_log->info( 'Loaded plugin ' . $plugin );
8982
}
9083

9184
}

lib/BioX/Workflow/Command/run.pm

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ with 'BioX::Workflow::Command::run::Utils::Rules';
1515
with 'BioX::Workflow::Command::run::Utils::WriteMeta';
1616
with 'BioX::Workflow::Command::run::Utils::Files::TrackChanges';
1717
with 'BioX::Workflow::Command::run::Utils::Files::ResolveDeps';
18-
with 'BioX::Workflow::Command::Utils::Log';
1918
with 'BioX::Workflow::Command::Utils::Files';
20-
with 'BioX::Workflow::Command::Utils::Plugin';
19+
20+
# with 'BioX::Workflow::Command::Utils::Plugin';
21+
# with 'BioX::Workflow::Command::Utils::Log';
2122

2223
command_short_description 'Run your workflow';
2324
command_long_description
@@ -29,7 +30,6 @@ This is the main class of the `biox-workflow.pl run` command.
2930
3031
=cut
3132

32-
3333
=head2 Attributes
3434
3535
=cut
@@ -41,15 +41,14 @@ This is the main class of the `biox-workflow.pl run` command.
4141
sub execute {
4242
my $self = shift;
4343

44-
$self->app_log->info('Printing out file info for '.$self->workflow);
44+
$self->app_log->info( 'Printing out file info for ' . $self->workflow );
4545
$self->print_opts;
46-
if(! $self->load_yaml_workflow){
47-
$self->app_log->warn('Exiting now.');
48-
return;
46+
if ( !$self->load_yaml_workflow ) {
47+
$self->app_log->warn('Exiting now.');
48+
return;
4949
}
5050

51-
52-
copy($self->workflow, $self->cached_workflow );
51+
copy( $self->workflow, $self->cached_workflow );
5352
$self->apply_global_attributes;
5453
$self->get_global_keys;
5554
$self->get_samples;
@@ -60,6 +59,7 @@ sub execute {
6059
}
6160

6261
no Moose;
62+
6363
__PACKAGE__->meta->make_immutable;
6464

6565
1;

lib/BioX/Workflow/Command/stats.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ sub gen_row {
140140
my $sample = shift;
141141
my $sample_files = shift;
142142

143-
my @uniq = uniq(@{$sample_files});
144-
foreach my $file (@uniq) {
143+
foreach my $file (@{$sample_files}) {
145144

146145
my @trow = ();
147146

@@ -195,6 +194,7 @@ sub iter_file_samples {
195194
else {
196195
push( @sample_files, $new_file );
197196
}
197+
@sample_files = uniq(@sample_files);
198198
$self->gen_row( $file, $cond, $sample, \@sample_files );
199199
}
200200
}

0 commit comments

Comments
 (0)