Branch Coverage

blib/lib/Bio/ToolBox/db_helper.pm
Criterion Covered Total %
branch 70 550 12.7


line true false branch
893 0 0 if $a
900 0 0 if $a
908 0 6 unless ($database)
915 1 5 if ($db_ref =~ /DB|big::BigWigSet/)
922 4 1 if (exists $OPENED_DB{$database} and not $no_cache)
930 0 1 if $database =~ /^Parsed:/
941 0 1 if ($database =~ /^(?:https?|ftp)/i) { }
1 0 elsif ($database =~ /gff|bw|bb|bam|useq|db|sqlite|fa|fasta|bigbed|bigwig|cram/i) { }
0 0 elsif (-d $database) { }
0 0 elsif (-e $database) { }
944 0 0 if ($database =~ /\.bam$/i) { }
0 0 elsif ($database =~ /\.(?:bb|bigbed)$/i) { }
0 0 elsif ($database =~ /\.(?:bw|bigwig)$/i) { }
0 0 elsif ($database =~ /\.useq$/) { }
0 0 elsif ($database =~ /\.fa(?:sta)?$/i) { }
946 0 0 unless $BAM_OK
947 0 0 if ($BAM_OK) { }
949 0 0 unless ($db)
963 0 0 unless $BIGBED_OK
964 0 0 if ($BIGBED_OK) { }
966 0 0 unless ($db)
980 0 0 unless $BIGWIG_OK
981 0 0 if ($BIGWIG_OK) { }
983 0 0 unless ($db)
1009 0 0 unless $BIGWIG_OK
1011 0 0 if ($BIGWIG_OK) { }
1013 0 0 unless ($db)
1033 1 0 if (-e $database) { }
1036 0 1 if ($database =~ /\.bam$/i) { }
0 1 elsif ($database =~ /\.(?:bb|bigbed)$/i) { }
0 1 elsif ($database =~ /\.(?:bw|bigwig)$/i) { }
1 0 elsif ($database =~ /\.useq$/i) { }
0 0 elsif ($database =~ /\.fa(?:sta)?$/i) { }
0 0 elsif ($database =~ /\.(?:gff3?|gff3?\.gz|db|sqlite)$/) { }
0 0 elsif ($database =~ /\.cram$/i) { }
1038 0 0 unless $BAM_OK
1039 0 0 if ($BAM_OK) { }
1042 0 0 unless ($db)
1056 0 0 unless $BIGBED_OK
1057 0 0 if ($BIGBED_OK) { }
1060 0 0 unless ($db)
1074 0 0 unless $BIGWIG_OK
1075 0 0 if ($BIGWIG_OK) { }
1078 0 0 unless ($db)
1092 1 0 unless $USEQ_OK
1094 1 0 if ($USEQ_OK) { }
1096 0 1 unless ($db)
1110 0 0 unless $BAM_OK
1111 0 0 if ($BAM_OK) { }
1113 0 0 unless ($db)
1119 0 0 unless $SEQFASTA_OK
1121 0 0 if ($SEQFASTA_OK) { }
1123 0 0 unless ($db)
1125 0 0 if (-e "$database.index")
1139 0 0 unless $SEQFASTA_OK
1141 0 0 if ($SEQFASTA_OK) { }
1143 0 0 unless ($db)
1157 0 0 if ($BAM_ADAPTER eq 'sam')
1160 0 0 unless $BAM_OK
1161 0 0 if ($BAM_OK) { }
1164 0 0 unless ($db)
1191 0 0 unless $BIGWIG_OK
1192 0 0 if ($BIGWIG_OK) { }
1194 0 0 unless ($db)
1206 0 0 unless ($db)
1207 0 0 unless $SEQFASTA_OK
1209 0 0 if ($SEQFASTA_OK) { }
1211 0 0 unless ($db)
1235 0 0 unless $SEQFASTA_OK
1237 0 0 if ($SEQFASTA_OK) { }
1239 0 0 unless ($db)
1250 1 0 if ($db) { }
1252 1 0 unless $no_cache
1267 0 0 unless $db
1269 0 0 unless $db_ref
1271 0 0 if ($db_ref =~ /^Bio::DB::SeqFeature::Store/) { }
0 0 elsif ($db_ref eq 'Bio::DB::Sam') { }
0 0 elsif ($db_ref eq 'Bio::DB::HTS') { }
1304 0 0 unless ($db)
1314 0 0 if ($db_ref =~ /^Bio::DB::SeqFeature::Store/) { }
0 0 elsif ($db_ref =~ /BigWigSet/i) { }
1320 0 0 unless $Bio::ToolBox::db_helper::a->[0] cmp $Bio::ToolBox::db_helper::b->[0]
1339 0 0 if ($attribute =~ /^primary_tag|method$/i) { }
0 0 elsif ($attribute =~ /^type/i) { }
0 0 elsif ($attribute =~ /^display_name/i) { }
1381 0 1 if (ref $args{'feature'} eq 'ARRAY') { }
1 0 elsif (defined $args{'feature'}) { }
1398 1 0 $args{'db'} ? :
1406 1 0 if (@datasets) { }
1411 0 1 if ($item =~ /,/) { }
1425 0 1 if ($dataset =~ /^(?: http | ftp) .+ \. (?: bam | bw | bb) $/xi) { }
1 0 elsif ($dataset =~ /\.(?:bam|bw|bigwig|bb|bigbed|useq)$/i) { }
1441 1 0 if (-e $file) { }
1451 1 0 if (@files) { }
1464 0 0 unless (%db_features)
1465 0 0 if ($db) { }
1470 0 0 if ($source) { }
1480 0 0 unless (%db_features)
1498 0 0 if (exists $db_features{$d}) { }
1509 0 0 if ($check) { }
1525 0 0 if ($db) { }
1529 0 0 if ($limit)
1532 0 0 unless $p =~ /$limit/i
1539 0 0 unless (%db_features)
1560 0 0 if ($args{'prompt'}) { }
1566 0 0 if ($args{'single'}) { }
1581 0 0 if ($args{'single'})
1582 0 0 unless (scalar @answer_list == 1)
1591 0 0 if ($answer =~ /&/) { }
1598 0 0 unless (exists $db_features{$_})
1604 0 0 if ($check) { }
1617 0 0 if (exists $db_features{$answer}) { }
1628 0 1 if (@bad_datasets)
1636 0 1 if ($args{'single'}) { }
1656 0 0 if (exists $total_read_number{$dataset}) { }
0 0 elsif ($dataset =~ /\.bam$/) { }
0 0 elsif ($dataset =~ /\.bb$/) { }
1665 0 0 unless $BAM_OK
1666 0 0 if ($BAM_OK) { }
1681 0 0 unless $BIGBED_OK
1683 0 0 if ($BIGBED_OK) { }
1714 0 0 unless ($data)
1718 0 0 unless (ref $data eq 'Bio::ToolBox::Data')
1726 0 0 unless ($db)
1733 0 0 unless ($db_ref =~ /^Bio::DB::SeqFeature::Store/)
1740 0 0 unless ($searchFeature)
1756 0 0 scalar @classes ? :
1759 0 0 unless ($iterator)
1771 0 0 if defined $chr_exclude and $feature->seq_id =~ /$chr_exclude/
1800 0 0 unless ($data)
1804 0 0 unless (ref $data eq 'Bio::ToolBox::Data')
1812 0 0 unless ($db)
1832 0 0 unless (@chromosomes)
1846 0 0 if ($end > $length)
1865 0 0 unless ($args{'db'})
1875 0 0 exists $args{'id'} ? :
1877 0 0 if $name and $name eq '.'
1878 0 0 if $args{'id'} and $args{'id'} eq '.'
1879 0 0 if $args{'type'} and $args{'type'} eq '.'
1882 0 0 if (defined $args{'id'} and $db->can('fetch'))
1888 0 0 $feature ? :
1889 0 0 if ($check)
1890 0 0 if defined $name and $feature->display_name ne $name
1891 0 0 if defined $args{'type'} and $feature->type ne $args{'type'}
1895 0 0 if ($check) { }
1900 0 0 unless ($primary_id_warning)
1908 0 0 unless $name
1916 0 0 unless (@features)
1924 0 0 unless (@features and $name =~ /[;,\|]/)
1938 0 0 if (scalar @features > 1) { }
0 0 elsif (not @features) { }
1943 0 0 if ($args{'name'} =~ /;/)
1952 0 0 if ($check eq $f_name)
1958 0 0 if (scalar @candidates == 1) { }
0 0 elsif (scalar @candidates > 1) { }
1988 0 12 unless scalar @_ == 9
1991 3 9 if $_[7] and not ref $_[7]
1994 0 12 if ($_[8] =~ /&/)
2009 5 7 if ($_[6] > 0) { }
2018 7 0 if (ref $scores) { }
2022 0 0 unless (defined $scores)
2023 0 0 if $_[5] =~ /count|sum/
2037 1 6 if ($method eq 'mean') { }
0 6 elsif ($method eq 'sum') { }
3 3 elsif ($method eq 'median') { }
0 3 elsif ($method eq 'min') { }
0 3 elsif ($method eq 'max') { }
2 1 elsif ($method eq 'count' or $method eq 'pcount') { }
1 0 elsif ($method eq 'ncount') { }
0 0 elsif ($method eq 'range') { }
0 0 elsif ($method eq 'stddev') { }
0 0 elsif ($method =~ /rpk?m/) { }
2044 0 3 unless scalar @$scores
2048 0 0 unless scalar @$scores
2052 0 0 unless scalar @$scores
2062 0 437 if (ref $s eq 'ARRAY') { }
2076 0 0 unless scalar @$scores
2082 0 0 unless scalar @$scores
2105 0 1 unless ($db)
2112 0 1 if (ref($db) =~ /BigWigSet/)
2133 0 1 if ($type =~ /^Bio::DB::SeqFeature::Store/) { }
0 1 elsif ($type eq 'Bio::DB::Big::File') { }
0 1 elsif ($type eq 'Bio::DB::BigWig' or $type eq 'Bio::DB::BigBed') { }
0 1 elsif ($type eq 'Bio::DB::Sam' or $type eq 'Bio::DB::HTS') { }
0 1 elsif ($type eq 'Bio::DB::HTS::Faidx') { }
0 1 elsif ($type eq 'Bio::DB::Fasta') { }
1 0 elsif ($db->can('seq_ids')) { }
2137 0 0 if defined $chr_exclude and $chr =~ /$chr_exclude/i
2141 0 0 $seqf ? :
2161 0 0 if defined $chr_exclude and $_->[0] =~ /$chr_exclude/i
2171 0 0 if defined $chr_exclude and $chr =~ /$chr_exclude/
2194 0 0 if defined $chr_exclude and $chr =~ /$chr_exclude/
2205 0 0 if defined $chr_exclude and $chr =~ /$chr_exclude/
2218 0 0 if defined $chr_exclude and $chr =~ /$chr_exclude/
2222 0 0 $seq ? :
2234 0 1 if defined $chr_exclude and $chr =~ /$chr_exclude/
2243 1 0 if $segment->seq_id eq $chr
2247 0 1 unless ($segment)
2266 0 1 unless (@chrom_lengths)
2275 0 0 unless scalar @_ == 6
2278 0 0 unless ($BAM_ADAPTER)
2279 0 0 ref($sam) =~ /hts/i ? :
2281 0 0 if ($BAM_ADAPTER eq 'hts') { }
0 0 elsif ($BAM_ADAPTER eq 'sam') { }
2284 0 0 unless $index
2290 0 0 unless $index
2300 0 0 unless scalar @_ == 4
2303 0 0 unless ($BAM_ADAPTER)
2304 0 0 ref($sam) =~ /hts/i ? :
2306 0 0 if ($BAM_ADAPTER eq 'hts') { }
0 0 elsif ($BAM_ADAPTER eq 'sam') { }
2309 0 0 unless $index
2315 0 0 unless $index
2325 0 0 unless scalar @_ == 4
2330 0 0 unless $type
2333 0 0 if ($type eq 'Bio::DB::HTS::Faidx') { }
0 0 elsif ($type eq 'Bio::DB::Sam::Fai') { }
0 0 elsif ($db->can('seq')) { }
2363 9 0 if ($param->[8] =~ /^file|http|ftp/) { }
0 0 elsif (ref($param->[7]) =~ /BigWigSet/) { }
0 0 elsif (ref($param->[7]) =~ /^Bio::DB/) { }
2367 0 9 if ($param->[8] =~ /\.(?:bw|bigwig)$/i) { }
0 9 elsif ($param->[8] =~ /\.(?:bb|bigbed)$/i) { }
0 9 elsif ($param->[8] =~ /\.bam$/i) { }
9 0 elsif ($param->[8] =~ /\.useq$/i) { }
2373 0 0 unless $BIGWIG_OK
2374 0 0 if ($BIGWIG_OK) { }
2375 0 0 if ($param->[6] == 2) { }
0 0 elsif ($param->[6] == 1) { }
0 0 elsif ($param->[5] =~ /min|max|mean/) { }
0 0 elsif ($param->[5] =~ /sum|count/) { }
2386 0 0 $BIG_ADAPTER eq 'ucsc' ? :
2405 0 0 unless $BIGBED_OK
2406 0 0 if ($BIGBED_OK) { }
2407 0 0 if ($param->[6] == 2) { }
2426 0 0 unless $BAM_OK
2427 0 0 if ($BAM_OK) { }
2443 0 9 unless $USEQ_OK
2445 9 0 if ($USEQ_OK) { }
2446 4 5 if ($param->[6] == 2) { }
2474 0 0 unless $BIGWIG_OK
2475 0 0 unless $BIGWIG_OK
2479 0 0 if ($param->[6] == 2) { }
0 0 elsif ($param->[6] == 1) { }
0 0 elsif ($param->[5] =~ /min|max|mean|sum|count/) { }
2489 0 0 $BIG_ADAPTER eq 'ucsc' ? :
2506 0 0 unless $SEQFASTA_OK
2508 0 0 if ($SEQFASTA_OK) { }
2511 0 0 unless ($param->[7]->can('get_seq_stream'))
2526 0 0 unless $param->[8]
2527 0 0 unless $param->[7]
2552 0 0 if ($BAM_ADAPTER) { }
2553 0 0 if ($BAM_ADAPTER =~ /sam/i) { }
0 0 elsif ($BAM_ADAPTER =~ /hts/i) { }
0 0 elsif ($BAM_ADAPTER =~ /none/i) { }
2569 0 0 unless ($BAM_OK)
2577 0 0 if ($BAM_OK) { }
2582 0 0 if $BAM_OK
2590 0 0 if ($BIG_ADAPTER) { }
2591 0 0 if ($BIG_ADAPTER =~ /ucsc|kent/i) { }
0 0 elsif ($BIG_ADAPTER =~ /big/i) { }
0 0 elsif ($BIG_ADAPTER =~ /none/i) { }
2608 0 0 unless ($BIGWIG_OK)
2616 0 0 if ($BIGWIG_OK) { }
2619 0 0 if $BIGWIG_OK
2623 0 0 if $BIGWIG_OK
2630 0 0 if ($BIG_ADAPTER) { }
2631 0 0 if ($BIG_ADAPTER =~ /ucsc|kent/i) { }
0 0 elsif ($BIG_ADAPTER =~ /big/i) { }
0 0 elsif ($BIG_ADAPTER =~ /none/i) { }
0 0 elsif ($BAM_ADAPTER =~ /\w+/) { }
2648 0 0 unless ($BIGWIG_OK)
2656 0 0 if ($BIGBED_OK) { }
2659 0 0 if $BIGBED_OK
2663 0 0 if $BIGBED_OK