line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Sandy::Command::Expression::Add; |
2
|
|
|
|
|
|
|
# ABSTRACT: expression subcommand class. Add an expression-matrix to the database. |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
79820
|
use App::Sandy::Base 'class'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
extends 'App::Sandy::Command::Expression'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.22'; # VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
override 'opt_spec' => sub { |
11
|
|
|
|
|
|
|
super, |
12
|
|
|
|
|
|
|
'verbose|v', |
13
|
|
|
|
|
|
|
'expression-matrix|f=s', |
14
|
|
|
|
|
|
|
'source|s=s' |
15
|
|
|
|
|
|
|
}; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _default_opt { |
18
|
0
|
|
|
0
|
|
|
'verbose' => 0, |
19
|
|
|
|
|
|
|
'source' => 'not defined' |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub validate_args { |
23
|
0
|
|
|
0
|
1
|
|
my ($self, $args) = @_; |
24
|
0
|
|
|
|
|
|
my $file = shift @$args; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# Mandatory file |
27
|
0
|
0
|
|
|
|
|
if (not defined $file) { |
28
|
0
|
|
|
|
|
|
die "Missing an expression-matrix file\n"; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# Is it really a file? |
32
|
0
|
0
|
|
|
|
|
if (not -f $file) { |
33
|
0
|
|
|
|
|
|
die "'$file' is not a file. Please, give me a valid expression-matrix file\n"; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
0
|
0
|
|
|
|
|
die "Too many arguments: '@$args'\n" if @$args; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub validate_opts { |
40
|
0
|
|
|
0
|
1
|
|
my ($self, $opts) = @_; |
41
|
0
|
|
|
|
|
|
my %default_opt = $self->_default_opt; |
42
|
0
|
|
|
|
|
|
$self->fill_opts($opts, \%default_opt); |
43
|
|
|
|
|
|
|
|
44
|
0
|
0
|
|
|
|
|
if (not exists $opts->{'expression-matrix'}) { |
45
|
0
|
|
|
|
|
|
die "Mandatory option 'expression-matrix' not defined\n"; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub execute { |
50
|
0
|
|
|
0
|
1
|
|
my ($self, $opts, $args) = @_; |
51
|
0
|
|
|
|
|
|
my $file = shift @$args; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
my %default_opt = $self->_default_opt; |
54
|
0
|
|
|
|
|
|
$self->fill_opts($opts, \%default_opt); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# Set if user wants a verbose log |
57
|
0
|
|
|
|
|
|
$LOG_VERBOSE = $opts->{verbose}; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# Go go go |
60
|
0
|
|
|
|
|
|
log_msg ":: Inserting $opts->{'expression-matrix'} from $file ..."; |
61
|
|
|
|
|
|
|
$self->insertdb( |
62
|
|
|
|
|
|
|
$file, |
63
|
|
|
|
|
|
|
$opts->{'expression-matrix'}, |
64
|
0
|
|
|
|
|
|
$opts->{'source'}, |
65
|
|
|
|
|
|
|
1 |
66
|
|
|
|
|
|
|
); |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
log_msg ":: Done!"; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=pod |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=encoding UTF-8 |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 NAME |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
App::Sandy::Command::Expression::Add - expression subcommand class. Add an expression-matrix to the database. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 VERSION |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
version 0.22 |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 SYNOPSIS |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sandy expression add -f <entry name> [-s <source>] FILE |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Arguments: |
90
|
|
|
|
|
|
|
an expression-matrix file |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Mandatory options: |
93
|
|
|
|
|
|
|
-f, --expression-matrix an expression-matrix name |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Options: |
96
|
|
|
|
|
|
|
-h, --help brief help message |
97
|
|
|
|
|
|
|
-u, --man full documentation |
98
|
|
|
|
|
|
|
-v, --verbose print log messages |
99
|
|
|
|
|
|
|
-s, --source expression-matrix source detail for database |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 DESCRIPTION |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Add an expression-matrix to the database. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 OPTIONS |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=over 8 |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=item B<--expression-matrix> |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
A valid expression-matrix is a file with 2 columns. The first column is for the seqid |
112
|
|
|
|
|
|
|
and the second column is for the count. The counts will be treated as weights |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=back |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 AUTHORS |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=over 4 |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=item * |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Thiago L. A. Miller <tmiller@mochsl.org.br> |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=item * |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
J. Leonel Buzzo <lbuzzo@mochsl.org.br> |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item * |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Felipe R. C. dos Santos <fsantos@mochsl.org.br> |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=item * |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
Helena B. Conceição <hconceicao@mochsl.org.br> |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=item * |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
Gabriela Guardia <gguardia@mochsl.org.br> |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=item * |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
Fernanda Orpinelli <forpinelli@mochsl.org.br> |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=item * |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
Pedro A. F. Galante <pgalante@mochsl.org.br> |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=back |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
This software is Copyright (c) 2018 by Teaching and Research Institute from SÃrio-Libanês Hospital. |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
This is free software, licensed under: |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
The GNU General Public License, Version 3, June 2007 |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=cut |