lib/App/Sandy/Command/Expression/Dump.pm

filter: Statementstmt 100% 3 / 3 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 1 / 1 Podpod n/a totaltotal 100% 4 / 4 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
CRAP 1.0
« lib/App/Sandy/Command/Expression/Add.pm ↑ Summary lib/App/Sandy/Command/Expression/Remove.pm »
1 package App::Sandy::Command::Expression::Dump;
2 # ABSTRACT: expression subcommand class. Dump an expression-matrix from database.
3  
4 1 ▶use App::Sandy::Base 'class';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 extends 'App::Sandy::Command::Expression';
7  
8 our $VERSION = '0.25'; # VERSION
9  
10 sub validate_args {
11 my ($self, $args) = @_;
12 my $expression_matrix = shift @$args;
13  
14 # Mandatory file
15 if (not defined $expression_matrix) {
16 die "Missing expression-matrix\n";
17 }
18  
19 die "Too many arguments: '@$args'\n" if @$args;
20 }
21  
22 sub execute {
23 my ($self, $opts, $args) = @_;
24 my $expression_matrix = shift @$args;
25  
26 my $matrix = $self->retrievedb($expression_matrix);
27 print "#feature\tcount\n";
28  
29 for my $feature (sort keys %$matrix) {
30 print "$feature\t$matrix->{$feature}\n";
31 }
32 }
33  
34 __END__
« lib/App/Sandy/Command/Expression/Add.pm ↑ Summary lib/App/Sandy/Command/Expression/Remove.pm »