« lib/BioX/Workflow/Command/run/Rules/Directives/Types/Stash.pm
↑ Summary
lib/BioX/Workflow/Command/inspect.pm »
| 1 | package BioX::Workflow::Command::run; | ||
| 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 File::Path qw(make_path); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | extends 'BioX::Workflow::Command'; | ||
| 10 | 1 | ▶ | use BioSAILs::Utils::Traits qw(ArrayRefOfStrs); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 0 | ▶ | use BioX::Workflow::Command::run::Rules::Directives; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 12 | |||
| 13 | with 'BioX::Workflow::Command::run::Utils::Samples'; | ||
| 14 | with 'BioX::Workflow::Command::run::Utils::Attributes'; | ||
| 15 | with 'BioX::Workflow::Command::run::Rules::Rules'; | ||
| 16 | with 'BioX::Workflow::Command::run::Utils::WriteMeta'; | ||
| 17 | with 'BioX::Workflow::Command::run::Utils::Files::TrackChanges'; | ||
| 18 | with 'BioX::Workflow::Command::run::Utils::Files::ResolveDeps'; | ||
| 19 | with 'BioX::Workflow::Command::Utils::Files'; | ||
| 20 | with 'BioSAILs::Utils::Files::CacheDir'; | ||
| 21 | with 'BioSAILs::Utils::CacheUtils'; | ||
| 22 | |||
| 23 | command_short_description 'Run your workflow.'; | ||
| 24 | command_long_description | ||
| 25 | 'Run your workflow, process the variables, and create all your directories.'; | ||
| 26 | |||
| 27 | =head1 BioX::Workflow::Command::run | ||
| 28 | |||
| 29 | biox run -h | ||
| 30 | biox run -w variant_calling.yml | ||
| 31 | |||
| 32 | =cut | ||
| 33 | |||
| 34 | =head2 Attributes | ||
| 35 | |||
| 36 | =cut | ||
| 37 | |||
| 38 | =head2 Subroutines | ||
| 39 | |||
| 40 | =cut | ||
| 41 | |||
| 42 | sub execute { | ||
| 43 | my $self = shift; | ||
| 44 | |||
| 45 | if ( !$self->load_yaml_workflow ) { | ||
| 46 | $self->app_log->warn('Exiting now.'); | ||
| 47 | return; | ||
| 48 | } | ||
| 49 | |||
| 50 | $self->print_opts; | ||
| 51 | |||
| 52 | $self->app_log->info("Your cached workflow is available at\n\t".$self->cached_workflow."\n"); | ||
| 53 | $self->apply_global_attributes; | ||
| 54 | $self->get_global_keys; | ||
| 55 | $self->get_samples; | ||
| 56 | |||
| 57 | $self->write_workflow_meta('start'); | ||
| 58 | |||
| 59 | $self->iterate_rules; | ||
| 60 | |||
| 61 | $self->post_process_rules; | ||
| 62 | $self->fh->close(); | ||
| 63 | } | ||
| 64 | |||
| 65 | |||
| 66 | before 'BUILD' => sub { | ||
| 67 | my $self = shift; | ||
| 68 | |||
| 69 | make_path( $self->cache_dir ); | ||
| 70 | make_path( File::Spec->catdir( $self->cache_dir, '.biox-cache', 'logs' ) ); | ||
| 71 | make_path( File::Spec->catdir( $self->cache_dir, '.biox-cache', 'workflows' ) ); | ||
| 72 | }; | ||
| 73 | |||
| 74 | __PACKAGE__->meta->make_immutable; | ||
| 75 | |||
| 76 | 1; | ||