lib/App/Sandy/Types.pm

filter: Statementstmt 41.1% 30 / 73 Branchbran 0.0% 0 / 22 Conditioncond 0.0% 0 / 27 MC/DCmcdc 0.0% 0 / 15 Subroutinesub 2.2% 1 / 44 Podpod n/a totaltotal 17.1% 31 / 181 CC 21 SCAR 20.1
CC
21
Cov
25%
__ANON__
30.0
__ANON__
20.0
__ANON__
12.0
CRAP 7.5
« lib/App/Sandy/Base.pm ↑ Summary xs/RNG.xs »
1 package App::Sandy::Types;
2 # ABSTRACT: Moose type constraints for App::Sandy project
3  
4 1 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '0.25'; # VERSION
7  
8 subtype 'My:IntGt0'
9 => as 'Int'
10 0 ▶ => where { $_ > 0 }
Subroutine __ANON__: not called CC=1 SCAR=6.9
11 0 ▶ => message { "Value must be an integer greater than zero, not '$_'" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
12  
13 subtype 'My:IntGe0'
14 => as 'Int'
15 0 ▶ => where { $_ >= 0 }
Subroutine __ANON__: not called CC=1 SCAR=6.9
16 0 ▶ => message { "Value must be an integer greater or equal to zero, not '$_'" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
17  
18 subtype 'My:NumGt0'
19 => as 'Num'
20 0 ▶ => where { $_ > 0 }
Subroutine __ANON__: not called CC=1 SCAR=6.9
21 0 ▶ => message { "Value must be a number greater than zero, not '$_'" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
22  
23 subtype 'My:NumGe0'
24 => as 'Num'
25 0 ▶ => where { $_ >= 0 }
Subroutine __ANON__: not called CC=1 SCAR=6.9
26 0 ▶ => message { "Value must be a number greater or equal to zero, not '$_'" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
27  
28 subtype 'My:NumHS'
29 => as 'Num'
30 0 ▶ => where { $_ >= 0 && $_ <= 1 }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_ >= 0 and $_ <= 1 0 0 0
31 0 ▶ => message { "Value must be a number between zero and one, not '$_'" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
32  
33 subtype 'My:File'
34 => as 'Str'
35 0 ▶ => where { -f $_ }
Subroutine __ANON__: not called CC=1 SCAR=6.9
36 0 ▶ => message { "'$_' must be a file" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
37  
38 subtype 'My:Fasta'
39 => as 'My:File'
40 0 ▶ => where { $_ =~ /.+\.(fasta|fa|fna|ffn)(\.gz)*$/ }
Subroutine __ANON__: not called CC=1 SCAR=6.9
41 0 ▶ => message { "'$_' must be a fasta file: Check the extension (.fasta, .fa, .fna, .ffn - compressed, or not, by gzip, as in .fasta.gz etc)" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
42  
43 subtype 'My:Weight'
44 => as 'HashRef'
45 0 ▶ => where { exists $_->{down} && exists $_->{up} }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
exists $_->{"down"} and exists $_->{"up"} 0 0 0
46 0 ▶ => message { "'$_' is not a Weight object" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
47  
48 subtype 'My:Weights'
49 => as 'ArrayRef[My:Weight]'
50 0 ▶ => message { "'$_' is not a Weight object array" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
51  
52 1 subtype 'My:QualityP'
53 => as 'Str';
54  
55 coerce 'My:QualityP'
56 => from 'Str'
57 0 ▶ => via { lc $_ };
Subroutine __ANON__: not called CC=1 SCAR=1.2
58  
59 subtype 'My:QualityH'
60 => as 'HashRef'
61 0 ▶ => where { exists $_->{matrix} && exists $_->{deepth} && exists $_->{partil} }
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 1 branch
BranchTrueFalseTotal
exists $_->{"matrix"} and exists $_->{"deepth"} and exists $_->{"partil"} 0 0 0
Condition0%0/3
exists $_->{"matrix"} and exists $_->{"deepth"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $_->{"matrix"} and exists $_->{"deepth"}
exists $_->{"matrix"} exists $_->{"deepth"}
Truth table0%0/3
A and B
A= exists $_->{"matrix"}B= exists $_->{"deepth"}
ABresult
0X0
100
111
62 0 ▶ => message { "'$_' is not a valid quality hash" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
63  
64 subtype 'My:IdFa'
65 => as 'HashRef'
66 0 ▶ => where { exists $_->{seq} && exists $_->{size} }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
exists $_->{"seq"} and exists $_->{"size"} 0 0 0
67 0 ▶ => message { "'$_' is not a valid fasta id" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
68  
69 subtype 'My:IdxFasta'
70 => as 'HashRef[My:IdFa]'
71 0 ▶ => message { "'$_' is not a valid indexed fasta" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
72  
73 subtype 'My:StrandBias'
74 => as 'Str'
75 0 ▶ => where { $_ eq 'plus' || $_ eq 'minus' || $_ eq 'random' }
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 1 branch
BranchTrueFalseTotal
$_ eq "plus" or $_ eq "minus" or $_ eq "random" 0 0 0
Condition0%0/3
$_ eq "plus" or $_ eq "minus"
l!l&&r!l&&!r
000
MC/DC0%0/2
$_ eq "plus" or $_ eq "minus"
$_ eq "plus" $_ eq "minus"
Truth table0%0/3
A or B
A= $_ eq "plus"B= $_ eq "minus"
ABresult
1X1
011
000
76 0 ▶ => message { "'$_' is not a valid strand-bias: 'plus', 'minus' or 'random'" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
77  
78 subtype 'My:SeqIdWeight'
79 => as 'Str'
80 0 ▶ => where { $_ eq 'length' || $_ eq 'same' || $_ eq 'count' }
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 1 branch
BranchTrueFalseTotal
$_ eq "length" or $_ eq "same" or $_ eq "count" 0 0 0
Condition0%0/3
$_ eq "length" or $_ eq "same"
l!l&&r!l&&!r
000
MC/DC0%0/2
$_ eq "length" or $_ eq "same"
$_ eq "length" $_ eq "same"
Truth table0%0/3
A or B
A= $_ eq "length"B= $_ eq "same"
ABresult
1X1
011
000
81 0 ▶ => message { "'$_' is not a valid seqid-weight: 'length', 'same' or 'count'" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
82  
83 subtype 'My:SeqType'
84 => as 'Str'
85 0 ▶ => where { $_ eq 'single-end' || $_ eq 'paired-end' }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_ eq "single-end" or $_ eq "paired-end" 0 0 0
86 0 ▶ => message { "'$_' is not a valid sequencing-type: 'single-end' or 'paired-end'" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
87  
88 subtype 'My:CountLoopBy'
89 => as 'Str'
90 0 ▶ => where { $_ eq 'coverage' || $_ eq 'number-of-reads' }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_ eq "coverage" or $_ eq "number-of-reads" 0 0 0
91 0 ▶ => message { "'$_' is not a valid count_loops_by: 'coverage' or 'number-of-reads'" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
92  
93 subtype 'My:Piece'
94 => as 'HashRef'
95 0 ▶ => where { exists $_->{ref} && exists $_->{start} && exists $_->{len} && exists $_->{pos} && exists $_->{offset} }
Subroutine __ANON__: not called CC=5 SCAR=34.0
Branch: 1 branch
BranchTrueFalseTotal
exists $_->{"ref"} and exists $_->{"start"} and exists $_->{"len"} and exists $_->{"pos"} and exists $_->{"offset"} 0 0 0
Condition0%0/9
exists $_->{"ref"} and exists $_->{"start"} and exists $_->{"len"} and exists $_->{"pos"}
!ll&&!rl&&r
000
exists $_->{"ref"} and exists $_->{"start"} and exists $_->{"len"}
!ll&&!rl&&r
000
exists $_->{"ref"} and exists $_->{"start"}
!ll&&!rl&&r
000
MC/DC0%0/4
exists $_->{"ref"} and exists $_->{"start"} and exists $_->{"len"} and exists $_->{"pos"}
exists $_->{"ref"} exists $_->{"start"} exists $_->{"len"} exists $_->{"pos"}
Truth table0%0/5
A and B and C and D
A= exists $_->{"ref"}B= exists $_->{"start"}C= exists $_->{"len"}D= exists $_->{"pos"}
ABCDresult
0XXX0
10XX0
110X0
11100
11111
96 0 ▶ => message { "Invalid piece inserted to piece_table" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
97  
98 subtype 'My:PieceTable'
99 => as 'HashRef'
100 0 ▶ => where { exists $_->{size} && exists $_->{table} && ref $_->{table} eq 'App::Sandy::PieceTable' }
Subroutine __ANON__: not called CC=3 SCAR=24.8
Branch: 1 branch
BranchTrueFalseTotal
exists $_->{"size"} and exists $_->{"table"} and ref $_->{"table"} eq "App::Sandy::PieceTable" 0 0 0
Condition0%0/3
exists $_->{"size"} and exists $_->{"table"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $_->{"size"} and exists $_->{"table"}
exists $_->{"size"} exists $_->{"table"}
Truth table0%0/3
A and B
A= exists $_->{"size"}B= exists $_->{"table"}
ABresult
0X0
100
111
101 0 ▶ => message { "Invalid piece table entry" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
102  
103 subtype 'My:Format'
104 => as 'Str'
105 0 ▶ => where { $_ eq 'fastq' || $_ eq 'fastq.gz' || $_ eq 'bam' || $_ eq 'sam' }
Subroutine __ANON__: not called CC=4 SCAR=30.0
Branch: 1 branch
BranchTrueFalseTotal
$_ eq "fastq" or $_ eq "fastq.gz" or $_ eq "bam" or $_ eq "sam" 0 0 0
Condition0%0/6
$_ eq "fastq" or $_ eq "fastq.gz" or $_ eq "bam"
l!l&&r!l&&!r
000
$_ eq "fastq" or $_ eq "fastq.gz"
l!l&&r!l&&!r
000
MC/DC0%0/3
$_ eq "fastq" or $_ eq "fastq.gz" or $_ eq "bam"
$_ eq "fastq" $_ eq "fastq.gz" $_ eq "bam"
Truth table0%0/4
A or B or C
A= $_ eq "fastq"B= $_ eq "fastq.gz"C= $_ eq "bam"
ABCresult
1XX1
01X1
0011
0000
106 0 ▶ => message { "Invalid output format: '$_': 'fastq', 'fastq.gz', 'bam', 'sam'" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
107  
108 subtype 'My:Level'
109 => as 'Int'
110 0 ▶ => where { /^[1-9]$/ }
Subroutine __ANON__: not called CC=1 SCAR=6.9
111 0 ▶ => message { "Invalid compression level: '$_': 1-9"};
Subroutine __ANON__: not called CC=1 SCAR=1.2
112  
113  
114 subtype 'My:TupleElem'
115 => as 'ArrayRef[Int]'
116 0 ▶ => where { @$_ == 2 }
Subroutine __ANON__: not called CC=1 SCAR=6.9
117 0 ▶ => message { "Invalid tuple element" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
118  
119 subtype 'My:Tuple'
120 => as 'ArrayRef[My:TupleElem]'
121 0 ▶ => message { "Invalid tuple" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
122  
123 subtype 'My:FastaBlackList'
124 => as 'HashRef[My:Tuple]'
125 0 ▶ => message { "Fasta blacklist is chr => Tuple" };
Subroutine __ANON__: not called CC=1 SCAR=1.2
126  
127 1 1; ## --- end class App::Sandy::Types
128  
129 __END__
« lib/App/Sandy/Base.pm ↑ Summary xs/RNG.xs »