Commit 0fa29252 authored by Monika Komorowska's avatar Monika Komorowska
Browse files

fix for ChainedAssemblyMapper to map using the destination slice if one is...

fix for ChainedAssemblyMapper to map using the destination slice if one is provided http://www.ebi.ac.uk/panda/jira/browse/ENSCORESW-108
parent ad2b0516
......@@ -404,8 +404,16 @@ sub _objs_from_sth {
my $len = $seq_region_end - $seq_region_start + 1;
my @coords =
$mapper->map($sr_name, $seq_region_start, $seq_region_end,1, $sr_cs);
my @coords;
if (defined $dest_slice && $mapper->isa('Bio::EnsEMBL::ChainedAssemblyMapper') ) {
@coords = $mapper->map( $sr_name, $seq_region_start, $seq_region_end,
1, $sr_cs, 0, $dest_slice);
} else {
@coords = $mapper->map($sr_name, $seq_region_start, $seq_region_end,1, $sr_cs);
}
#filter out gaps
@coords = grep {!$_->isa('Bio::EnsEMBL::Mapper::Gap')} @coords;
......
......@@ -466,11 +466,22 @@ FEATURE:
# Remap the feature coordinates to another coord system
# if a mapper was provided.
if ( defined($mapper) ) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->fastmap( $sr_name, $seq_region_start, $seq_region_end,
if (defined $dest_slice && $mapper->isa('Bio::EnsEMBL::ChainedAssemblyMapper') ) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->map( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs, 1, $dest_slice);
} else {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->fastmap( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs );
}
# Skip features that map to gaps or coord system boundaries.
if ( !defined($seq_region_id) ) { next FEATURE }
......
......@@ -617,11 +617,22 @@ FEATURE: while ( $sth->fetch() ) {
# was provided.
#
if ( defined($dest_mapper) ) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
= $dest_mapper->fastmap( $sr_name, $seq_region_start,
if (defined $dest_slice && $dest_mapper->isa('Bio::EnsEMBL::ChainedAssemblyMapper') ) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$dest_mapper->map( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs, 1, $dest_slice);
} else {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
= $dest_mapper->fastmap( $sr_name, $seq_region_start,
$seq_region_end, $seq_region_strand,
$sr_cs );
}
# Skip features that map to gaps or coord system boundaries.
if ( !defined($seq_region_id) ) { next FEATURE }
......
......@@ -1681,9 +1681,21 @@ sub _objs_from_sth {
#
if($mapper) {
($seq_region_id,$seq_region_start,$seq_region_end,$seq_region_strand) =
$mapper->fastmap($sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs);
if (defined $dest_slice && $mapper->isa('Bio::EnsEMBL::ChainedAssemblyMapper') ) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->map( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs, 1, $dest_slice);
} else {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->fastmap( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs );
}
#skip features that map to gaps or coord system boundaries
next FEATURE if(!defined($seq_region_id));
......
......@@ -437,9 +437,17 @@ sub _objs_from_sth {
#
if ($mapper) {
($seq_region_id,$seq_region_start,$seq_region_end,$seq_region_strand) =
$mapper->fastmap($sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs);
if (defined $dest_slice && $mapper->isa('Bio::EnsEMBL::ChainedAssemblyMapper') ) {
( $seq_region_id, $seq_region_start,$seq_region_end, $seq_region_strand ) =
$mapper->map( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs, 1, $dest_slice);
} else {
( $seq_region_id, $seq_region_start,$seq_region_end, $seq_region_strand ) =
$mapper->fastmap( $sr_name, $seq_region_start, $seq_region_end,$seq_region_strand, $sr_cs );
}
#skip features that map to gaps or coord system boundaries
if(!defined($seq_region_id)) {
......
......@@ -708,10 +708,22 @@ sub _objs_from_sth {
#
if ($mapper) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
= $mapper->fastmap( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs );
if (defined $dest_slice && $mapper->isa('Bio::EnsEMBL::ChainedAssemblyMapper') ) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->map( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs, 1, $dest_slice);
} else {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->fastmap( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs );
}
#skip features that map to gaps or coord system boundaries
next OPERON if ( !defined($seq_region_id) );
......
......@@ -790,11 +790,23 @@ sub _objs_from_sth {
#
if ($mapper) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
= $mapper->fastmap( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs );
if (defined $dest_slice && $mapper->isa('Bio::EnsEMBL::ChainedAssemblyMapper') ) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->map( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs, 1, $dest_slice);
} else {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->fastmap( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs );
}
#skip features that map to gaps or coord system boundaries
next OPERON if ( !defined($seq_region_id) );
......
......@@ -389,9 +389,21 @@ sub _objs_from_sth {
#
if($dest_mapper) {
($seq_region_id,$seq_region_start,$seq_region_end,$seq_region_strand) =
$dest_mapper->fastmap($sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs);
if (defined $dest_slice && $dest_mapper->isa('Bio::EnsEMBL::ChainedAssemblyMapper') ) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$dest_mapper->map( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs, 1, $dest_slice);
} else {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
= $dest_mapper->fastmap( $sr_name, $seq_region_start,
$seq_region_end, $seq_region_strand,
$sr_cs );
}
#skip features that map to gaps or coord system boundaries
next FEATURE if(!defined($seq_region_id));
......
......@@ -351,9 +351,21 @@ sub _objs_from_sth {
#
if($mapper) {
($seq_region_id,$seq_region_start,$seq_region_end,$seq_region_strand) =
$mapper->fastmap($sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs);
if (defined $dest_slice && $mapper->isa('Bio::EnsEMBL::ChainedAssemblyMapper') ) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->map( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs, 1, $dest_slice);
} else {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->fastmap( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs );
}
#skip features that map to gaps or coord system boundaries
next FEATURE if(!defined($seq_region_id));
......
......@@ -255,9 +255,21 @@ sub _objs_from_sth {
#
if($mapper) {
($seq_region_id,$seq_region_start,$seq_region_end,$seq_region_strand) =
$mapper->fastmap($sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs);
if (defined $dest_slice && $mapper->isa('Bio::EnsEMBL::ChainedAssemblyMapper') ) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->map( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs, 1, $dest_slice);
} else {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->fastmap( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs );
}
#skip features that map to gaps or coord system boundaries
next FEATURE if(!defined($seq_region_id));
......
......@@ -273,9 +273,21 @@ sub _objs_from_sth {
#
if($mapper) {
($seq_region_id,$seq_region_start,$seq_region_end,$seq_region_strand) =
$mapper->fastmap($sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs);
if (defined $dest_slice && $mapper->isa('Bio::EnsEMBL::ChainedAssemblyMapper') ) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->map( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs, 1, $dest_slice);
} else {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->fastmap( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs );
}
#skip features that map to gaps or coord system boundaries
next FEATURE if(!defined($seq_region_id));
......
......@@ -260,9 +260,21 @@ sub _objs_from_sth {
#
if($mapper) {
($seq_region_id,$seq_region_start,$seq_region_end,$seq_region_strand) =
$mapper->fastmap($sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs);
if (defined $dest_slice && $mapper->isa('Bio::EnsEMBL::ChainedAssemblyMapper') ) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->map( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs, 1, $dest_slice);
} else {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$mapper->fastmap( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs );
}
#skip features that map to gaps or coord system boundaries
next FEATURE if(!defined($seq_region_id));
......
......@@ -459,11 +459,22 @@ FEATURE:
# Remap the feature coordinates to another coord system if a mapper
# was provided.
if ( defined($dest_mapper) ) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
= $dest_mapper->fastmap( $sr_name, $seq_region_start,
if (defined $dest_slice && $dest_mapper->isa('Bio::EnsEMBL::ChainedAssemblyMapper') ) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$dest_mapper->map( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs, 1, $dest_slice);
} else {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
= $dest_mapper->fastmap( $sr_name, $seq_region_start,
$seq_region_end, $seq_region_strand,
$sr_cs );
}
# Skip features that map to gaps or coord system boundaries.
if ( !defined($seq_region_id) ) { next FEATURE }
......
......@@ -1539,9 +1539,21 @@ sub _objs_from_sth {
#
if($dest_mapper) {
($seq_region_id,$seq_region_start,$seq_region_end,$seq_region_strand) =
$dest_mapper->fastmap($sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs);
if (defined $dest_slice && $dest_mapper->isa('Bio::EnsEMBL::ChainedAssemblyMapper') ) {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
=
$dest_mapper->map( $sr_name, $seq_region_start, $seq_region_end,
$seq_region_strand, $sr_cs, 1, $dest_slice);
} else {
( $seq_region_id, $seq_region_start,
$seq_region_end, $seq_region_strand )
= $dest_mapper->fastmap( $sr_name, $seq_region_start,
$seq_region_end, $seq_region_strand,
$sr_cs );
}
#skip features that map to gaps or coord system boundaries
next FEATURE if(!defined($seq_region_id));
......
Markdown is supported
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