Skip to content
Snippets Groups Projects
Commit e47da607 authored by Ian Longden's avatar Ian Longden
Browse files

fix for the same component bits being used in more than one assembly

parent 1b62dfe9
No related branches found
No related tags found
No related merge requests found
......@@ -163,7 +163,9 @@ sub map_coordinates{
defined($strand) && defined($type) ) {
throw("Must start,end,strand,id,type as coordinates");
}
# special case for handling inserts:
if($start == $end + 1) {
return $self->map_insert($id, $start, $end, $strand, $type);
......@@ -220,11 +222,32 @@ sub map_coordinates{
my $orig_start = $start;
my $last_target_coord = undef;
for( my $i = $start_idx; $i<=$#$lr; $i++ ) {
$pair = $lr->[$i];
my $self_coord = $pair->{$from};
my $target_coord = $pair->{$to};
if(defined($last_target_coord) and $target_coord->{'id'} != $last_target_coord){
if($self_coord->{'start'} < $start){ # i.e. the same bit is being mapped to another assembled bit
$start = $orig_start;
}
# else{
# #not a multi mapped component;
# }
}
else{
$last_target_coord = $target_coord->{'id'};
}
# if we haven't even reached the start, move on
if( $self_coord->{'end'} < $orig_start ) {
next;
......@@ -298,6 +321,7 @@ sub map_coordinates{
$target_end,
$pair->{'ori'} * $strand,
$cs);
}
push(@result,$res);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment