| 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__ | ||