« lib/BioX/Workflow/Command/run/Rules/Directives/Types/HPC.pm
↑ Summary
lib/BioX/Workflow/Command/Utils/Log.pm »
| 1 | package BioX::Workflow::Command::new; | ||
| 2 | |||
| 3 | 1 | ▶ | use v5.10; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use MooseX::App::Command; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | ▶ | use Storable qw(dclone); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use YAML; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | ▶ | use MooseX::Types::Path::Tiny qw/Path/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 1 | ▶ | use BioSAILs::Utils::Traits qw(ArrayRefOfStrs); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 1 | extends 'BioX::Workflow::Command'; | |
| 15 | |||
| 16 | 1 | with 'BioX::Workflow::Command::Utils::Create'; | |
| 17 | 1 | with 'BioX::Workflow::Command::Utils::Files'; | |
| 18 | |||
| 19 | 1 | command_short_description 'Create a new workflow.'; | |
| 20 | 1 | command_long_description 'Create a new workflow.'; | |
| 21 | |||
| 22 | =head1 BioX::Workflow::Command::new | ||
| 23 | |||
| 24 | Create a new workflow | ||
| 25 | |||
| 26 | biox new -h | ||
| 27 | biox new -w my_new_workflow.yml | ||
| 28 | |||
| 29 | =cut | ||
| 30 | |||
| 31 | =head2 Command Line Options | ||
| 32 | |||
| 33 | =cut | ||
| 34 | |||
| 35 | 1 | option '+workflow' => ( | |
| 36 | isa => Path, | ||
| 37 | ); | ||
| 38 | |||
| 39 | option '+outfile' => ( | ||
| 40 | 0 | ▶ | default => sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 41 | 0 | my $self = shift; | |
| 42 | 0 | my $workflow = $self->workflow; | |
| 43 | 0 | return "$workflow"; | |
| 44 | }, | ||
| 45 | 1 | ); | |
| 46 | |||
| 47 | 0 | ▶ | sub execute { |
|
Subroutine
execute: not called CC=1 SCAR=6.9
| |||
| 48 | 0 | my $self = shift; | |
| 49 | |||
| 50 | 0 | my $global = { | |
| 51 | global => | ||
| 52 | [ | ||
| 53 | { sample_rule => "(Sample_.*)" }, | ||
| 54 | { indir => 'data/raw' }, | ||
| 55 | { outdir => 'data/processed' }, | ||
| 56 | { root_dir => 'data' }, | ||
| 57 | { find_sample_bydir => 1 }, | ||
| 58 | { by_sample_outdir => 1 }, | ||
| 59 | ] | ||
| 60 | }; | ||
| 61 | |||
| 62 | 0 | my $rules = $self->add_rules; | |
| 63 | 0 | $global->{rules} = $rules; | |
| 64 | |||
| 65 | 0 | $self->fh->print(Dump($global)); | |
| 66 | 0 | $self->fh->close; | |
| 67 | } | ||
| 68 | |||
| 69 | 1 | __PACKAGE__->meta->make_immutable; | |
| 70 | |||
| 71 | 1 | 1; | |