| 1 | package Bio::Coordinate::Pair; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 7 | our $AUTHORITY = 'cpan:BIOPERLML'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 7 | $Bio::Coordinate::Pair::VERSION = '1.007001'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 7 | ▶ | use utf8; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 7 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 7 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 7 | ▶ | use Bio::Coordinate::Result; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 7 | ▶ | use Bio::Coordinate::Result::Match; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 7 | ▶ | use Bio::Coordinate::Result::Gap; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 7 | ▶ | use parent qw(Bio::Root::Root Bio::Coordinate::MapperI); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | # ABSTRACT: Continuous match between two coordinate sets. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | # AUTHOR: Heikki Lehvaslaiho <heikki@bioperl.org> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | # OWNER: Heikki Lehvaslaiho | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | # LICENSE: Perl_5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 245 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 245 | my($class,@args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 245 | my $self = $class->SUPER::new(@args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 245 | my($in, $out) = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | $self->_rearrange([qw(IN | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | OUT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | )], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | @args); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 245 | ▶ | $in && $self->in($in); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 245 | ▶ | $out && $self->out($out); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 245 | return $self; # success - we hope! | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 2182 | ▶ | sub in { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
in: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 2182 | my ($self,$value) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 2182 | ▶ | if( defined $value) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 245 | ▶ | $self->throw("Not a valid input Bio::Location [$value] ") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | unless $value->isa('Bio::LocationI'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 245 | $self->{'_in'} = $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 2182 | return $self->{'_in'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 2362 | ▶ | sub out { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
out: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 2362 | my ($self,$value) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 2362 | ▶ | if( defined $value) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 245 | ▶ | $self->throw("Not a valid output coordinate Bio::Location [$value] ") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | unless $value->isa('Bio::LocationI'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 245 | $self->{'_out'} = $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 2362 | return $self->{'_out'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 147 | ▶ | sub swap { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
swap: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 147 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 147 | ($self->{'_in'}, $self->{'_out'}) = ($self->{'_out'}, $self->{'_in'}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 147 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 220 | ▶ | sub strand { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
strand: called CC=5 SCAR=16.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 220 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 220 | ▶ | $self->warn("Outgoing coordinates are not defined") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | unless $self->out; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 220 | ▶ | $self->warn("Incoming coordinates are not defined") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | unless $self->in; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 220 | ▶ | return ($self->in->strand || 0) * ($self->out->strand || 0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%4/4
$self->in->strand || 0
$self->out->strand || 0
MC/DC100%1/1
$self->in->strand || 0
$self->in->strand
MC/DC100%1/1
$self->out->strand || 0
$self->out->strand
Truth table100%2/2
A
A= $self->in->strand
Truth table100%2/2
A
A= $self->out->strand
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 208 | ▶ | sub test { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
test: called CC=3 SCAR=11.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 208 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 208 | ▶ | $self->warn("Outgoing coordinates are not defined") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | unless $self->out; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 208 | ▶ | $self->warn("Incoming coordinates are not defined") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | unless $self->in; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 208 | return ($self->in->end - $self->in->start) == ($self->out->end - $self->out->start); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 73 | ▶ | sub map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
map: called CC=7 SCAR=19.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 73 | my ($self,$value) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 73 | ▶ | $self->throw("Need to pass me a value.") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | unless defined $value; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 73 | ▶ | $self->throw("I need a Bio::Location, not [$value]") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | unless $value->isa('Bio::LocationI'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 73 | ▶ | $self->throw("Input coordinate system not set") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | unless $self->in; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 73 | ▶ | $self->throw("Output coordinate system not set") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | unless $self->out; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 73 | ▶ | if ($value->isa("Bio::Location::SplitLocationI")) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 2 | my $result = Bio::Coordinate::Result->new(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 2 | foreach my $loc ( $value->sub_Location(1) ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 4 | my $res = $self->_map($loc); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 4 | map { $result->add_sub_Location($_) } $res->each_Location; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 2 | return $result; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 71 | return $self->_map($value); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 75 | ▶ | sub _map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_map: called CC=21 SCAR=30.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 75 | my ($self,$value) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 75 | my $result = Bio::Coordinate::Result->new(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 75 | my $offset = $self->in->start - $self->out->start; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 75 | my $start = $value->start - $offset; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 75 | my $end = $value->end - $offset; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 75 | my $match = Bio::Location::Simple->new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 75 | $match->location_type($value->location_type); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 75 | $match->strand($self->strand); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | #within | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | # |-------------------------| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | # |-| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 75 | ▶ | if ($start >= $self->out->start and $end <= $self->out->end) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
Condition100%3/3
$start >= $self->out->start and $end <= $self->out->end
MC/DC100%2/2
$start >= $self->out->start and $end <= $self->out->end
$start >= $self->out->start
$end <= $self->out->end
Truth table100%3/3
A and B
A= $start >= $self->out->startB= $end <= $self->out->end
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 29 | $match->seq_id($self->out->seq_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 29 | $result->seq_id($self->out->seq_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 29 | ▶ | if ($self->strand >= 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 19 | $match->start($start); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 19 | $match->end($end); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 10 | $match->start($self->out->end - $end + $self->out->start); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 10 | $match->end($self->out->end - $start + $self->out->start); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 29 | ▶ | if ($value->strand) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 27 | $match->strand($match->strand * $value->strand); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 27 | $result->strand($match->strand); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 29 | bless $match, 'Bio::Coordinate::Result::Match'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 29 | $result->add_sub_Location($match); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | #out | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | # |-------------------------| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | # |-| or |-| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | ▶ | elsif ( ($end < $self->out->start or $start > $self->out->end ) or | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition75%9/12
$end < $self->out->start or $start > $self->out->end or $value->location_type eq "IN-BETWEEN" and ($end = $self->out->start) || ($start = $self->out->end)
$end < $self->out->start or $start > $self->out->end
$value->location_type eq "IN-BETWEEN" and ($end = $self->out->start) || ($start = $self->out->end)
$end = $self->out->start or $start = $self->out->end
MC/DC60%3/5
$end < $self->out->start or $start > $self->out->end or $value->location_type eq "IN-BETWEEN" and ($end = $self->out->start) || ($start = $self->out->end)
$end < $self->out->start
$start > $self->out->end
$value->location_type eq "IN-BETWEEN"
$end = $self->out->start
$start = $self->out->end
Truth table66%4/6
A or B or C and D or E
A= $end < $self->out->startB= $start > $self->out->endC= $value->location_type eq "IN-BETWEEN"D= $end = $self->out->startE= $start = $self->out->end
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | #insertions just outside the range need special settings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | ($value->location_type eq 'IN-BETWEEN' and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | ($end = $self->out->start or $start = $self->out->end))) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 6 | $match->seq_id($self->in->seq_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 6 | $result->seq_id($self->in->seq_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 6 | $match->start($value->start); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 6 | $match->end($value->end); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 6 | $match->strand($value->strand); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 6 | bless $match, 'Bio::Coordinate::Result::Gap'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 6 | $result->add_sub_Location($match); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | #partial I | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | # |-------------------------| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | # |-----| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | ▶ | elsif ($start < $self->out->start and $end <= $self->out->end ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$start < $self->out->start and $end <= $self->out->end
MC/DC100%2/2
$start < $self->out->start and $end <= $self->out->end
$start < $self->out->start
$end <= $self->out->end
Truth table100%3/3
A and B
A= $start < $self->out->startB= $end <= $self->out->end
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 13 | $result->seq_id($self->out->seq_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 13 | ▶ | if ($value->strand) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 10 | $match->strand($match->strand * $value->strand); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 10 | $result->strand($match->strand); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 13 | my $gap = Bio::Location::Simple->new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 13 | $gap->start($value->start); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 13 | $gap->end($self->in->start - 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 13 | $gap->strand($value->strand); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 13 | $gap->seq_id($self->in->seq_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 13 | bless $gap, 'Bio::Coordinate::Result::Gap'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 13 | $result->add_sub_Location($gap); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | # match | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 13 | $match->seq_id($self->out->seq_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 13 | ▶ | if ($self->strand >= 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 12 | $match->start($self->out->start); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 12 | $match->end($end); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 1 | $match->start($self->out->end - $end + $self->out->start); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 1 | $match->end($self->out->end); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 13 | bless $match, 'Bio::Coordinate::Result::Match'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 13 | $result->add_sub_Location($match); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | #partial II | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | # |-------------------------| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | # |------| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | ▶ | elsif ($start >= $self->out->start and $end > $self->out->end ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$start >= $self->out->start and $end > $self->out->end
MC/DC50%1/2
$start >= $self->out->start and $end > $self->out->end
$start >= $self->out->start
$end > $self->out->end
Truth table66%2/3
A and B
A= $start >= $self->out->startB= $end > $self->out->end
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 21 | $match->seq_id($self->out->seq_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 21 | $result->seq_id($self->out->seq_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 21 | ▶ | if ($value->strand) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 18 | $match->strand($match->strand * $value->strand); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 18 | $result->strand($match->strand); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 21 | ▶ | if ($self->strand >= 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 15 | $match->start($start); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 15 | $match->end($self->out->end); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 6 | $match->start($self->out->start); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 6 | $match->end($self->out->end - $start + $self->out->start); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 21 | bless $match, 'Bio::Coordinate::Result::Match'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 21 | $result->add_sub_Location($match); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 21 | my $gap = Bio::Location::Simple->new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 21 | $gap->start($self->in->end + 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 21 | $gap->end($value->end); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 21 | $gap->strand($value->strand); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 21 | $gap->seq_id($self->in->seq_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 21 | bless $gap, 'Bio::Coordinate::Result::Gap'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 21 | $result->add_sub_Location($gap); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | #enveloping | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | # |-------------------------| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | # |---------------------------------| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | ▶ | elsif ($start < $self->out->start and $end > $self->out->end ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$start < $self->out->start and $end > $self->out->end
MC/DC0%0/2
$start < $self->out->start and $end > $self->out->end
$start < $self->out->start
$end > $self->out->end
Truth table33%1/3
A and B
A= $start < $self->out->startB= $end > $self->out->end
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 6 | $result->seq_id($self->out->seq_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 6 | ▶ | if ($value->strand) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 6 | $match->strand($match->strand * $value->strand); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 6 | $result->strand($match->strand); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | # gap1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 6 | my $gap1 = Bio::Location::Simple->new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 6 | $gap1->start($value->start); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 6 | $gap1->end($self->in->start - 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 6 | $gap1->strand($value->strand); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 6 | $gap1->seq_id($self->in->seq_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 6 | bless $gap1, 'Bio::Coordinate::Result::Gap'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 6 | $result->add_sub_Location($gap1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | # match | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 6 | $match->seq_id($self->out->seq_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 6 | $match->start($self->out->start); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 6 | $match->end($self->out->end); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 6 | bless $match, 'Bio::Coordinate::Result::Match'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 6 | $result->add_sub_Location($match); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | # gap2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 6 | my $gap2 = Bio::Location::Simple->new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 6 | $gap2->start($self->in->end + 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 6 | $gap2->end($value->end); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 6 | $gap2->strand($value->strand); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 6 | $gap2->seq_id($self->in->seq_id); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 6 | bless $gap2, 'Bio::Coordinate::Result::Gap'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 6 | $result->add_sub_Location($gap2); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 0 | $self->throw("Should not be here!"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 75 | return $result; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 7 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||