BioX-Workflow-Command

 view release on metacpan or  search on metacpan

lib/BioX/Workflow/Command/stats.pm  view on Meta::CPAN

package BioX::Workflow::Command::stats;

use v5.10;
use MooseX::App::Command;
use namespace::autoclean;

use Log::Log4perl qw(:easy);
use DateTime;
use Text::ASCIITable;
use Number::Bytes::Human qw(format_bytes parse_bytes);
use File::Details;
use File::Basename;
use List::Util qw(uniq);
use Try::Tiny;
use Path::Tiny;

extends qw(  BioX::Workflow::Command );

use BioSAILs::Utils::Traits qw(ArrayRefOfStrs);

use BioX::Workflow::Command::run::Rules::Directives;

with 'BioX::Workflow::Command::Utils::Log';
with 'BioX::Workflow::Command::run::Utils::Samples';
with 'BioX::Workflow::Command::run::Utils::Attributes';
with 'BioX::Workflow::Command::run::Rules::Rules';
with 'BioX::Workflow::Command::run::Utils::WriteMeta';
with 'BioX::Workflow::Command::run::Utils::Files::TrackChanges';
with 'BioX::Workflow::Command::run::Utils::Files::ResolveDeps';
with 'BioX::Workflow::Command::Utils::Files';
with 'BioX::Workflow::Command::Utils::Log';

command_short_description 'Get the status of INPUT/OUTPUT for your workflow';
command_long_description
  'If you are unsure on where you are in your workflow, run this step. '
  . 'It will give you a breakdown of rules with associated files, '
  . 'and whether or not they have been created or modified. ';

has 'table_log' => (
    is      => 'rw',
    default => sub {
        my $self = shift;
        my $t    = Text::ASCIITable->new();
        $t->setCols( [ 'Rule', 'Sample', 'I/O', 'File', 'Exists', 'Size' ] );
        return $t;
    }
);

option 'use_abs' => (
    is            => 'rw',
    isa           => 'Bool',
    default       => 0,
    documentation => 'Use the absolute path name instead of the basename'
);

our $human = Number::Bytes::Human->new(
    bs          => 1024,
    round_style => 'round',
    precision   => 2
);

has 'add_row' => (
    is      => 'rw',
    default => 0,
);

sub execute {
    my $self = shift;

    $self->stdout(1);
    if ( !$self->load_yaml_workflow ) {
        $self->app_log->warn('Exiting now.');
        return;
    }



( run in 0.569 second using v1.01-cache-2.11-cpan-39bf76dae61 )