| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package App::Sandy::Types; |
|
2
|
|
|
|
|
|
|
# ABSTRACT: Moose type constraints for App::Sandy project |
|
3
|
|
|
|
|
|
|
|
|
4
|
6
|
|
|
6
|
|
47
|
use Moose::Util::TypeConstraints; |
|
|
6
|
|
|
|
|
14
|
|
|
|
6
|
|
|
|
|
54
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.25'; # VERSION |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
subtype 'My:IntGt0' |
|
9
|
|
|
|
|
|
|
=> as 'Int' |
|
10
|
|
|
|
|
|
|
=> where { $_ > 0 } |
|
11
|
|
|
|
|
|
|
=> message { "Value must be an integer greater than zero, not '$_'" }; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
subtype 'My:IntGe0' |
|
14
|
|
|
|
|
|
|
=> as 'Int' |
|
15
|
|
|
|
|
|
|
=> where { $_ >= 0 } |
|
16
|
|
|
|
|
|
|
=> message { "Value must be an integer greater or equal to zero, not '$_'" }; |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
subtype 'My:NumGt0' |
|
19
|
|
|
|
|
|
|
=> as 'Num' |
|
20
|
|
|
|
|
|
|
=> where { $_ > 0 } |
|
21
|
|
|
|
|
|
|
=> message { "Value must be a number greater than zero, not '$_'" }; |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
subtype 'My:NumGe0' |
|
24
|
|
|
|
|
|
|
=> as 'Num' |
|
25
|
|
|
|
|
|
|
=> where { $_ >= 0 } |
|
26
|
|
|
|
|
|
|
=> message { "Value must be a number greater or equal to zero, not '$_'" }; |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
subtype 'My:NumHS' |
|
29
|
|
|
|
|
|
|
=> as 'Num' |
|
30
|
|
|
|
|
|
|
=> where { $_ >= 0 && $_ <= 1 } |
|
31
|
|
|
|
|
|
|
=> message { "Value must be a number between zero and one, not '$_'" }; |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
subtype 'My:File' |
|
34
|
|
|
|
|
|
|
=> as 'Str' |
|
35
|
|
|
|
|
|
|
=> where { -f $_ } |
|
36
|
|
|
|
|
|
|
=> message { "'$_' must be a file" }; |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
subtype 'My:Fasta' |
|
39
|
|
|
|
|
|
|
=> as 'My:File' |
|
40
|
|
|
|
|
|
|
=> where { $_ =~ /.+\.(fasta|fa|fna|ffn)(\.gz)*$/ } |
|
41
|
|
|
|
|
|
|
=> message { "'$_' must be a fasta file: Check the extension (.fasta, .fa, .fna, .ffn - compressed, or not, by gzip, as in .fasta.gz etc)" }; |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
subtype 'My:Weight' |
|
44
|
|
|
|
|
|
|
=> as 'HashRef' |
|
45
|
|
|
|
|
|
|
=> where { exists $_->{down} && exists $_->{up} } |
|
46
|
|
|
|
|
|
|
=> message { "'$_' is not a Weight object" }; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
subtype 'My:Weights' |
|
49
|
|
|
|
|
|
|
=> as 'ArrayRef[My:Weight]' |
|
50
|
|
|
|
|
|
|
=> message { "'$_' is not a Weight object array" }; |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
subtype 'My:QualityP' |
|
53
|
|
|
|
|
|
|
=> as 'Str'; |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
coerce 'My:QualityP' |
|
56
|
|
|
|
|
|
|
=> from 'Str' |
|
57
|
|
|
|
|
|
|
=> via { lc $_ }; |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
subtype 'My:QualityH' |
|
60
|
|
|
|
|
|
|
=> as 'HashRef' |
|
61
|
|
|
|
|
|
|
=> where { exists $_->{matrix} && exists $_->{deepth} && exists $_->{partil} } |
|
62
|
|
|
|
|
|
|
=> message { "'$_' is not a valid quality hash" }; |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
subtype 'My:IdFa' |
|
65
|
|
|
|
|
|
|
=> as 'HashRef' |
|
66
|
|
|
|
|
|
|
=> where { exists $_->{seq} && exists $_->{size} } |
|
67
|
|
|
|
|
|
|
=> message { "'$_' is not a valid fasta id" }; |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
subtype 'My:IdxFasta' |
|
70
|
|
|
|
|
|
|
=> as 'HashRef[My:IdFa]' |
|
71
|
|
|
|
|
|
|
=> message { "'$_' is not a valid indexed fasta" }; |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
subtype 'My:StrandBias' |
|
74
|
|
|
|
|
|
|
=> as 'Str' |
|
75
|
|
|
|
|
|
|
=> where { $_ eq 'plus' || $_ eq 'minus' || $_ eq 'random' } |
|
76
|
|
|
|
|
|
|
=> message { "'$_' is not a valid strand-bias: 'plus', 'minus' or 'random'" }; |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
subtype 'My:SeqIdWeight' |
|
79
|
|
|
|
|
|
|
=> as 'Str' |
|
80
|
|
|
|
|
|
|
=> where { $_ eq 'length' || $_ eq 'same' || $_ eq 'count' } |
|
81
|
|
|
|
|
|
|
=> message { "'$_' is not a valid seqid-weight: 'length', 'same' or 'count'" }; |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
subtype 'My:SeqType' |
|
84
|
|
|
|
|
|
|
=> as 'Str' |
|
85
|
|
|
|
|
|
|
=> where { $_ eq 'single-end' || $_ eq 'paired-end' } |
|
86
|
|
|
|
|
|
|
=> message { "'$_' is not a valid sequencing-type: 'single-end' or 'paired-end'" }; |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
subtype 'My:CountLoopBy' |
|
89
|
|
|
|
|
|
|
=> as 'Str' |
|
90
|
|
|
|
|
|
|
=> where { $_ eq 'coverage' || $_ eq 'number-of-reads' } |
|
91
|
|
|
|
|
|
|
=> message { "'$_' is not a valid count_loops_by: 'coverage' or 'number-of-reads'" }; |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
subtype 'My:Piece' |
|
94
|
|
|
|
|
|
|
=> as 'HashRef' |
|
95
|
|
|
|
|
|
|
=> where { exists $_->{ref} && exists $_->{start} && exists $_->{len} && exists $_->{pos} && exists $_->{offset} } |
|
96
|
|
|
|
|
|
|
=> message { "Invalid piece inserted to piece_table" }; |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
subtype 'My:PieceTable' |
|
99
|
|
|
|
|
|
|
=> as 'HashRef' |
|
100
|
|
|
|
|
|
|
=> where { exists $_->{size} && exists $_->{table} && ref $_->{table} eq 'App::Sandy::PieceTable' } |
|
101
|
|
|
|
|
|
|
=> message { "Invalid piece table entry" }; |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
subtype 'My:Format' |
|
104
|
|
|
|
|
|
|
=> as 'Str' |
|
105
|
|
|
|
|
|
|
=> where { $_ eq 'fastq' || $_ eq 'fastq.gz' || $_ eq 'bam' || $_ eq 'sam' } |
|
106
|
|
|
|
|
|
|
=> message { "Invalid output format: '$_': 'fastq', 'fastq.gz', 'bam', 'sam'" }; |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
subtype 'My:Level' |
|
109
|
|
|
|
|
|
|
=> as 'Int' |
|
110
|
|
|
|
|
|
|
=> where { /^[1-9]$/ } |
|
111
|
|
|
|
|
|
|
=> message { "Invalid compression level: '$_': 1-9"}; |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
subtype 'My:TupleElem' |
|
115
|
|
|
|
|
|
|
=> as 'ArrayRef[Int]' |
|
116
|
|
|
|
|
|
|
=> where { @$_ == 2 } |
|
117
|
|
|
|
|
|
|
=> message { "Invalid tuple element" }; |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
subtype 'My:Tuple' |
|
120
|
|
|
|
|
|
|
=> as 'ArrayRef[My:TupleElem]' |
|
121
|
|
|
|
|
|
|
=> message { "Invalid tuple" }; |
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
subtype 'My:FastaBlackList' |
|
124
|
|
|
|
|
|
|
=> as 'HashRef[My:Tuple]' |
|
125
|
|
|
|
|
|
|
=> message { "Fasta blacklist is chr => Tuple" }; |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
1; ## --- end class App::Sandy::Types |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
__END__ |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=pod |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=encoding UTF-8 |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=head1 NAME |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
App::Sandy::Types - Moose type constraints for App::Sandy project |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head1 VERSION |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
version 0.25 |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=head1 AUTHORS |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=over 4 |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=item * |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
Thiago L. A. Miller <tmiller@mochsl.org.br> |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=item * |
|
152
|
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
J. Leonel Buzzo <lbuzzo@mochsl.org.br> |
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=item * |
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
Felipe R. C. dos Santos <fsantos@mochsl.org.br> |
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=item * |
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
Helena B. Conceição <hconceicao@mochsl.org.br> |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=item * |
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
Rodrigo Barreiro <rbarreiro@mochsl.org.br> |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=item * |
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
Gabriela Guardia <gguardia@mochsl.org.br> |
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=item * |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
Fernanda Orpinelli <forpinelli@mochsl.org.br> |
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=item * |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
Rafael Mercuri <rmercuri@mochsl.org.br> |
|
178
|
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=item * |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
Rodrigo Barreiro <rbarreiro@mochsl.org.br> |
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=item * |
|
184
|
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
Pedro A. F. Galante <pgalante@mochsl.org.br> |
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=back |
|
188
|
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
190
|
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
This software is Copyright (c) 2023 by Teaching and Research Institute from Sírio-Libanês Hospital. |
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
This is free software, licensed under: |
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
The GNU General Public License, Version 3, June 2007 |
|
196
|
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=cut |