Branch Coverage

blib/lib/Shatterproof.pm
Criterion Covered Total %
branch 174 490 35.5


line true false branch
263 0 0 if (load_config_file($config_file_path) != 1)
270 0 0 if (defined $insertion_directory)
274 0 0 if (defined $loh_directory)
286 0 0 if (scalar @cnv_files == 0 or scalar @trans_files == 0)
290 0 0 if (defined $insertion_directory)
294 0 0 if (defined $loh_directory)
303 0 0 if (scalar @insertion_files == 0) { }
310 0 0 if (scalar @loh_files == 0) { }
319 0 0 unless -d "$output_directory"
322 0 0 unless (-e $output_directory)
335 0 0 if (defined $insertion_directory)
346 0 0 if (defined $loh_directory)
357 0 0 if ($size % 2 != 0)
433 0 0 if ($argv[0] eq '--help') { }
443 0 0 if ($argv[$pos] eq '--cnv') { }
446 0 0 unless (substr($$cnv_directory_ref, -1, 1) eq '/')
456 0 0 if ($argv[$pos] eq '--trans') { }
459 0 0 unless (substr($$trans_directory_ref, -1, 1) eq '/')
468 0 0 if ($argv[$pos] eq '--insrt')
471 0 0 unless (substr($$insertion_directory_ref, -1, 1) eq '/')
478 0 0 if ($argv[$pos] eq '--loh')
481 0 0 unless (substr($$loh_directory_ref, -1, 1) eq '/')
488 0 0 if ($argv[$pos] eq '--tp53')
493 0 0 if ($argv[$pos] eq '--config') { }
502 0 0 if ($argv[$pos] eq '--output') { }
505 0 0 unless (substr($$output_directory_ref, -1, 1) eq '/')
514 0 0 if ($pos != $ARGC - 1)
595 1 10 if ($#cnv_files == -1)
601 1 15 unless open $CURRENT_FILE, '<', $file
604 0 15 if (eof $CURRENT_FILE)
614 1 14 unless ($line =~ /^#chr\tstart\tend\tnumber\tquality$/)
626 1 835 unless ($line =~ /^(chr)?(1[0-9]|2[0-2]|X|Y|[1-9])\t[0-9]+\t[0-9]+\t[0-9]+\t([0-9]+|\.)$/)
645 6 1 unless -d "$output_directory" . 'TP53'
646 0 7 unless (-e "$output_directory" . 'TP53')
651 0 7 unless open $TP53_FILE, '>', "$output_directory" . 'TP53/TP53.spc'
665 0 739 unless ($file_data[$n][0] =~ /^(chr)?(1[0-9]|2[0-2]|X|Y|[1-9])$/)
692 0 0 if (not defined @{$genome_hash{$source_chr};}[$index]) { }
705 739 0 if (not defined @{$genome_cnv_data{$chr};}[$start_index]) { }
719 738 1 if (not defined @{$genome_cnv_data{$chr};}[$end_index]) { }
731 37 672 if ($chr ne 'X' and $chr ne 'Y' and $chr == 17)
735 1 36 if ($file_data[$n][3] != 2 and $file_data[$n][1] >= $TP53_start && $file_data[$n][1] <= $TP53_end || $file_data[$n][2] >= $TP53_start && $file_data[$n][2] <= $TP53_end)
746 4 1 if ($i != scalar(@{$file_data[$n];}) - 1)
794 2862 52794 if ($file_data[$n][0] eq $file_data[$k][0])
797 96 2766 if ($file_data[$n][2] >= $file_data[$k][1] and $file_data[$n][2] <= $file_data[$k][2])
802 78 2784 if ($file_data[$n][1] >= $file_data[$k][1] and $file_data[$n][1] <= $file_data[$k][2])
807 96 2766 if ($start_overlap == 1 or $end_overlap == 1) { }
0 3252 elsif ($file_data[$n][1] <= $file_data[$k][1] and $file_data[$n][2] >= $file_data[$k][2]) { }
810 0 96 if ($type eq 'trans')
815 0 96 if ($type eq 'loh')
821 0 96 if ($type eq 'cnv' and $file_data[$n][3] != $file_data[$k][3]) { }
0 96 elsif ($collapse_regions == 0) { }
96 0 elsif ($collapse_regions == 1) { }
838 78 18 if ($start_overlap == 1 and $end_overlap == 1) { }
0 18 elsif ($start_overlap == 1) { }
18 0 elsif ($end_overlap == 1) { }
853 96 0 if ($start_overlap == 1 or $end_overlap == 1)
867 0 0 if ($type eq 'trans')
871 0 0 if ($type eq 'loh')
876 0 0 if ($type eq 'cnv' and $file_data[$n][3] != $file_data[$k][3]) { }
0 0 elsif ($collapse_regions == 0) { }
0 0 elsif ($collapse_regions == 1) { }
980 1 9 if ($#trans_files == -1)
986 0 14 unless open $CURRENT_FILE, '<', $file
989 1 13 if (eof $CURRENT_FILE)
999 1 12 unless ($line =~ /^#chr1\tstart\tend\tchr2\tstart\tend\tquality$/)
1011 1 741 unless ($line =~ /^(chr)?(1[0-9]|2[0-2]|X|Y|[1-9])\t[0-9]+\t[0-9]+\t(chr)?(1[0-9]|2[0-2]|X|Y|[1-9])\t[0-9]+\t[0-9]+\t([0-9]+|\.)$/)
1020 240 501 if ($line_data[1] >= $line_data[2] or $line_data[4] >= $line_data[5])
1040 2 4 unless -d "$output_directory" . 'TP53'
1041 0 6 unless (-e "$output_directory" . 'TP53')
1046 0 6 unless open $TP53_FILE, '>', "$output_directory" . 'TP53/TP53.spt'
1061 0 741 unless ($file_data[$n][0] =~ /^(chr)?(1[0-9]|2[0-2]|X|Y|[1-9])$/)
1069 0 741 unless ($file_data[$n][3] =~ /^(chr)?(1[0-9]|2[0-2]|X|Y|[1-9])$/)
1095 0 0 if (not defined @{$genome_hash{$source_chr};}[$index]) { }
1109 516 225 if (not defined @{$genome_trans_data{$chr1};}[$start_index1]) { }
1120 275 466 if (not defined @{$genome_trans_data{$chr1};}[$end_index1]) { }
1131 361 380 if (not defined @{$genome_trans_data{$chr2};}[$start_index2]) { }
1142 160 581 if (not defined @{$genome_trans_data{$chr2};}[$end_index2]) { }
1155 316 425 if ($chr1 ne $chr2)
1167 1 735 if ($chr1 ne 'X' and $chr1 ne 'Y' and $chr1 == 17)
1171 1 0 if ($file_data[$n][1] >= $TP53_start and $file_data[$n][1] <= $TP53_end or $file_data[$n][2] >= $TP53_start and $file_data[$n][2] <= $TP53_end)
1180 6 1 if ($i != scalar(@{$file_data[$n];}) - 1)
1188 0 741 if ($chr2 ne 'X' and $chr2 ne 'Y' and $chr2 == 17)
1192 0 0 if ($file_data[$n][4] >= $TP53_start and $file_data[$n][4] <= $TP53_end or $file_data[$n][5] >= $TP53_start and $file_data[$n][5] <= $TP53_end)
1199 0 0 if ($i != scalar(@{$file_data[$n];}) - 1)
1301 0 0 unless -d "$output_directory" . 'TP53'
1302 0 0 unless (-e "$output_directory" . 'TP53')
1313 0 0 unless open $CURRENT_FILE, '<', $file
1316 0 0 if (eof $CURRENT_FILE)
1321 0 0 unless open $TP53_FILE, '>', "$output_directory" . "TP53/$file_name" . "$suffix"
1339 0 0 if (not $line_data[1] =~ /^[0-9]+$/ && $line_data[0] =~ /^(chr)?(1[0-9]|2[0-2]|X|Y|x|y|[1-9])/ or length $line_data[4] <= length $line_data[3])
1346 0 0 unless ($line)
1355 0 0 if ($chr eq 'x')
1358 0 0 if ($chr eq 'y')
1367 0 0 if (not defined @{$genome_insertion_data{$chr};}[int $line_data[1] / $bin_size]) { }
1378 0 0 if ($line_data[1] < $bp + 10 and $line_data[1] > $bp - 10)
1384 0 0 if ($chr ne 'X' and $chr ne 'Y' and $chr == 17)
1388 0 0 if ($line_data[1] >= $TP53_start and $line_data[1] <= $TP53_end)
1399 0 0 unless ($line)
1408 0 0 if ($insertion_found != 1)
1484 0 0 unless open $CURRENT_FILE, '<', $file
1487 0 0 if (eof $CURRENT_FILE)
1497 0 0 unless ($line =~ /^#chr\tstart\tend\tquality$/)
1510 0 0 unless ($line =~ /^(chr)?(1[0-9]|2[0-2]|X|Y|[1-9])\t[0-9]+\t[0-9]+\t([0-9]+|\.)$/)
1527 0 0 unless -d "$output_directory" . 'TP53'
1528 0 0 unless (-e "$output_directory" . 'TP53')
1533 0 0 unless open $TP53_FILE, '>', "$output_directory" . 'TP53/TP53.spl'
1541 0 0 unless ($file_data[$n][0] =~ /^(chr)?(1[0-9]|2[0-2]|X|Y|[1-9])$/)
1553 0 0 if ($chr ne 'X' and $chr ne 'Y' and $chr == 17)
1557 0 0 if ($file_data[$n][1] >= $TP53_start and $file_data[$n][1] <= $TP53_end or $file_data[$n][2] >= $TP53_start and $file_data[$n][2] <= $TP53_end)
1567 0 0 if ($i != scalar(@{$file_data[$n];}) - 1)
1638 0 2 unless open $OUTPUT_FILE, '>', "$output_directory/genome_localization.log"
1806 2 0 unless -d "$output_directory"
1807 0 2 unless (-e "$output_directory")
1811 2 0 unless -d "$output_directory/cnv"
1812 0 2 unless (-e "$output_directory")
1816 2 0 unless -d "$output_directory/translocations"
1817 0 2 unless (-e "$output_directory")
1821 2 0 unless -d "$output_directory/all_types"
1822 0 2 unless (-e "$output_directory")
1832 40 0 if (scalar @current_chr_data > 0)
1835 0 40 unless open $OUTPUT_FILE, '>', "$output_directory/cnv/chr$cnv_key" . '_cnv_localization.log'
1844 399924 76 unless (defined $current_chr_data[$chr_pos])
1861 0 40 if (not defined @{$genome_cnv_data_windows{$cnv_key};}[0]) { }
1875 24 4391040 if (($chr_pos + ($window_size - 1)) * $bin_size > $chromosome_length{$cnv_key})
1888 392 4390648 if (defined $current_chr_data[$chr_pos - 1])
1894 392 4390648 if (defined $current_chr_data[$chr_pos + ($window_size - 1)])
1911 0 4391040 if (not defined @{$genome_cnv_data_windows{$cnv_key};}[$chr_pos]) { }
1935 26 0 if (scalar @current_chr_data > 0)
1938 0 26 unless open $OUTPUT_FILE, '>', "$output_directory/translocations/chr$trans_key" . '_translocation_localization.log'
1948 259970 30 unless (defined $current_chr_data[$chr_pos])
1958 20 10 if (defined $region_hash{'in'})
1969 18 12 if (defined $region_hash{'out'})
1973 18 0 if ($key eq $trans_key)
1993 0 26 if (not defined @{$genome_trans_data_windows{$trans_key};}[0]) { }
2006 10 2520282 if (($chr_pos + ($window_size - 1)) * $bin_size > $chromosome_length{$trans_key})
2018 428 2519854 if (defined $current_chr_data[$chr_pos - 1])
2025 234 194 if (defined $prev_region_hash{'in'})
2035 278 150 if (defined $prev_region_hash{'out'})
2039 184 100 if ($key eq $trans_key)
2051 456 2519826 if (defined $current_chr_data[$chr_pos + ($window_size - 1)])
2058 238 218 if (defined $next_region_hash{'in'})
2068 306 150 if (defined $next_region_hash{'out'})
2072 192 120 if ($key eq $trans_key)
2096 0 2520282 if (not defined @{$genome_trans_data_windows{$trans_key};}[$chr_pos]) { }
2116 42 6 if (scalar @{$genome_mutation_data_windows{$mutation_key};} > 0)
2119 0 42 unless open $OUTPUT_FILE, '>', "$output_directory/all_types/chr$mutation_key" . '_mutation_localization.log'
2130 0 4775978 if (not defined @{$genome_mutation_data_windows{$mutation_key};}[$chr_pos]) { }
2161 42 6 if (scalar @{$genome_mutation_data_windows{$mutation_key};} > 0)
2165 0 4775978 if (not defined @{$genome_mutation_data_windows{$mutation_key};}[$chr_pos]) { }
2184 42 6 if (scalar @{$genome_mutation_data_windows{$mutation_key};} > 0)
2190 0 4775978 if (not defined @{$genome_mutation_data_windows{$mutation_key};}[$chr_pos]) { }
2201 88404 4687574 if ($region_z_score >= $outlier_deviation) { }
8 4687566 elsif ($in_suspect_region == 1) { }
2202 8 88396 if ($in_suspect_region != 1)
2219 66812 4709166 if ($region_z_score < $outlier_deviation and $region_z_score >= $outlier_deviation - 1) { }
24 4709142 elsif ($in_likely_region == 1) { }
2223 26 66786 if ($in_likely_region != 1)
2241 0 42 if ($in_suspect_region == 1)
2249 2 40 if ($in_likely_region == 1)
2289 0 1 unless open $OUTPUT_FILE, '>', "$output_directory/copy_number_count.log"
2339 0 1 unless open $OUTPUT_FILE, '>', "$output_directory/copy_number_switches.log"
2352 80 0 if ($CN != 2)
2395 0 1 unless open $OUTPUT_FILE, '>', "$output_directory/interchromosomal_translocation_rate.log"
2490 0 0 if ($suspect_regions_size % 3 != 0)
2495 0 0 unless -d "$output_directory" . 'suspect_regions'
2496 0 0 unless (-e "$output_directory" . 'suspect_regions')
2501 0 0 unless open $OUTPUT_FILE, '>', "$output_directory" . 'suspect_regions/suspect_regions.yml'
2555 0 0 if (defined $cnv_number_hash_ref) { }
2569 0 0 if (defined $intertranslocation_hash_ref) { }
2580 0 0 if (defined $breakpoint_insertions_array_ref)
2588 0 0 if (defined $loh_size and defined $hz_size)
2621 0 0 if ($num_copy_num > 0)
2635 0 0 if ($num_trans_chr > 0)
2645 0 0 if (defined $breakpoint_insertions_array_ref)
2653 0 0 if ($loh_size != -1)
2661 0 0 if ($tp53_mutated and $tp53_mutation_found) { }
0 0 elsif ($tp53_mutated) { }
0 0 elsif ($tp53_mutation_found) { }
2730 0 1 if ($likely_regions_size % 3 != 0)
2736 1 0 unless -d "$output_directory" . 'suspect_regions'
2737 0 1 unless (-e "$output_directory" . 'suspect_regions')
2742 0 1 unless open $OUTPUT_FILE, '>', "$output_directory" . 'suspect_regions/likely_regions.log'
2860 0 0 if (defined $genome_trans_insertion_breakpoints_hash_ref)
2866 0 0 if (defined $chromosome_loh_breakpoints_hash_ref)
2936 0 0 if (defined $genome_cnv_data_hash{$chr})
2943 0 0 unless (defined $chr_data[$i])
2949 0 0 if ($key eq 'BPcount') { }
2968 0 0 if (scalar keys %cnv_number_hash == 0)
2985 0 0 if ($SD == 0 or ($cnv_number_hash{$key} - $mean) / $SD >= -1 * $outlier_deviation)
3056 0 0 if ($mean_density == 0 or $standard_deviation == 0)
3070 0 0 if ($z_score < 0)
3139 12 1 if (defined $genome_cnv_data_hash{$chr})
3145 145301 34 unless (defined $chr_data[$i])
3157 13 0 if (defined $genome_trans_data_hash{$chr})
3163 163313 93 unless (defined $chr_data[$i])
3258 0 0 if (defined $genome_trans_data_hash{$chr})
3265 0 0 unless (defined $chr_data[$i])
3273 0 0 if (defined $trans_hash{'in'})
3291 0 0 if (defined $trans_hash{'out'})
3297 0 0 if ($key eq $chr)
3299 0 0 if ($val > $start and $val < $end)
3319 0 0 if (keys %trans_number_hash == 0)
3344 0 0 if ($SD == 0 or ($trans_number_hash{$key} - $mean) / $SD > -1 * $outlier_deviation)
3376 0 0 if ($size == 1) { }
3386 0 0 if ($SD == 0 or ($val - $mean) / $SD < $outlier_deviation)
3402 0 0 if ($spread_factor == 0)
3420 0 0 if ($size < $translocation_cut_off_count and $size > 2)
3423 0 0 if ($size >= $translocation_cut_off_count)
3427 0 0 if ($translocation_score >= 1)
3496 0 0 if (defined $genome_trans_data_hash{$chr})
3503 0 0 unless (defined $chr_data[$i])
3520 0 0 if ($breakpoint > $end)
3523 0 0 if ($breakpoint > $start)
3529 0 0 if ($total_breakpoints > 0)
3533 0 0 if ($insertion_breakpoint_score > 1)
3594 0 0 unless (defined $chromosome_cnv_breakpoints_hash{$chr} and defined $chromosome_loh_breakpoints_hash{$chr})
3624 0 0 if ($cnv_breakpoints[$cnv_start] > $end)
3629 0 0 if ($cnv_breakpoints[$cnv_end] >= $start and $cnv_breakpoints[$cnv_end] <= $end)
3634 0 0 if ($cnv_breakpoints[$cnv_start] >= $start and $cnv_breakpoints[$cnv_start] <= $end)
3639 0 0 if ($start_overlap == 1 and $end_overlap == 1) { }
0 0 elsif ($start_overlap == 1) { }
0 0 elsif ($end_overlap == 1) { }
0 0 elsif ($cnv_breakpoints[$cnv_start] < $start and $cnv_breakpoints[$cnv_end] > $end) { }
3655 0 0 if ($remaining_heterozygous_size == 0 or $remaining_heterozygous_size == $original_heterozygous_size)
3685 0 0 if ($loh_breakpoints[$loh_start] > $end)
3690 0 0 if ($loh_breakpoints[$loh_end] >= $start and $loh_breakpoints[$loh_end] <= $end)
3695 0 0 if ($loh_breakpoints[$loh_start] >= $start and $loh_breakpoints[$loh_start] <= $end)
3700 0 0 if ($start_overlap_region_loh == 1 and $end_overlap_region_loh != 1) { }
0 0 elsif ($end_overlap_region_loh == 1 and $start_overlap_region_loh != 1) { }
0 0 elsif ($loh_breakpoints[$loh_start] < $start and $loh_breakpoints[$loh_end] > $end) { }
3712 0 0 if ($start_overlap_region_loh != 1 and $end_overlap_region_loh != 1)
3728 0 0 if ($cnv_breakpoints[$cnv_start] > $loh_end_breakpoint)
3733 0 0 if ($cnv_breakpoints[$cnv_end] >= $loh_start_breakpoint and $cnv_breakpoints[$cnv_end] <= $loh_end_breakpoint)
3738 0 0 if ($cnv_breakpoints[$cnv_start] >= $loh_start_breakpoint and $cnv_breakpoints[$cnv_start] <= $loh_end_breakpoint)
3743 0 0 if ($start_overlap_loh_cnv == 1 and $end_overlap_loh_cnv == 1) { }
0 0 elsif ($start_overlap_loh_cnv == 1) { }
0 0 elsif ($end_overlap_loh_cnv == 1) { }
0 0 elsif ($cnv_breakpoints[$cnv_start] < $loh_start_breakpoint and $cnv_breakpoints[$cnv_end] > $loh_end_breakpoint) { }
3763 0 0 if ($loh_size > $remaining_heterozygous_size)
3798 5 6 if ($type == 0) { }
5 1 elsif ($type == 1) { }
3801 1 2 if (scalar keys %hash == 0)
3825 1 2 if ($size == 0)
3860 0 0 if ($pos == $ARGC)
3972 0 8 unless open $CONFIG, '<', "$path"