Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
275378ff
Commit
275378ff
authored
May 10, 2006
by
Ian Longden
Browse files
fixes and STDERR prints added
parent
189f9507
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
229 additions
and
174 deletions
+229
-174
modules/Bio/EnsEMBL/DBSQL/AssemblyMapperAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/AssemblyMapperAdaptor.pm
+3
-2
modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm
+25
-5
modules/Bio/EnsEMBL/DBSQL/DensityFeatureAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/DensityFeatureAdaptor.pm
+12
-11
modules/Bio/EnsEMBL/DBSQL/DnaAlignFeatureAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/DnaAlignFeatureAdaptor.pm
+9
-9
modules/Bio/EnsEMBL/DBSQL/ExonAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/ExonAdaptor.pm
+17
-12
modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm
+14
-12
modules/Bio/EnsEMBL/DBSQL/MiscFeatureAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/MiscFeatureAdaptor.pm
+14
-14
modules/Bio/EnsEMBL/DBSQL/OligoFeatureAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/OligoFeatureAdaptor.pm
+12
-10
modules/Bio/EnsEMBL/DBSQL/PredictionExonAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/PredictionExonAdaptor.pm
+13
-12
modules/Bio/EnsEMBL/DBSQL/PredictionTranscriptAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/PredictionTranscriptAdaptor.pm
+13
-12
modules/Bio/EnsEMBL/DBSQL/ProteinAlignFeatureAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/ProteinAlignFeatureAdaptor.pm
+15
-14
modules/Bio/EnsEMBL/DBSQL/RegulatoryFeatureAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/RegulatoryFeatureAdaptor.pm
+13
-12
modules/Bio/EnsEMBL/DBSQL/RegulatorySearchRegionAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/RegulatorySearchRegionAdaptor.pm
+13
-12
modules/Bio/EnsEMBL/DBSQL/RepeatFeatureAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/RepeatFeatureAdaptor.pm
+13
-12
modules/Bio/EnsEMBL/DBSQL/SimpleFeatureAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/SimpleFeatureAdaptor.pm
+19
-14
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/SliceAdaptor.pm
+9
-1
modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm
+14
-10
modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm
+1
-0
No files found.
modules/Bio/EnsEMBL/DBSQL/AssemblyMapperAdaptor.pm
View file @
275378ff
...
...
@@ -67,7 +67,8 @@ use Bio::EnsEMBL::ChainedAssemblyMapper;
use
Bio::EnsEMBL::
TopLevelAssemblyMapper
;
use
Bio::EnsEMBL::Utils::
Cache
;
#CPAN LRU cache
use
Bio::EnsEMBL::Utils::
Exception
qw(deprecate throw)
;
use
Bio::EnsEMBL::Utils::
Exception
qw(throw deprecate warning stack_trace_dump)
;
#use Bio::EnsEMBL::Utils::Exception qw(deprecate throw);
use
Bio::EnsEMBL::Utils::
SeqRegionCache
;
use
integer
;
#do proper arithmetic bitshifts
...
...
@@ -574,7 +575,7 @@ sub register_component {
# (2) Use locality of reference (if they want something in same general
# region it will already be registered).
$self
->
register_assembled
(
$asm_mapper
,
$asm_seq_region
,
$asm_start
,
$asm_end
);
$self
->
register_assembled
(
$asm_mapper
,
$asm_seq_region
_id
,
$asm_start
,
$asm_end
);
}
...
...
modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm
View file @
275378ff
...
...
@@ -187,7 +187,7 @@ sub fetch_all_by_Slice_constraint {
throw
('
Could not retrieve normalized Slices. Database contains
'
.
'
incorrect assembly_exception information.
');
}
# Want to get features on the FULL original slice
# as well as any symlinked slices
...
...
@@ -195,6 +195,10 @@ sub fetch_all_by_Slice_constraint {
# same seq_region as original slice
my
$sr_id
=
$slice
->
get_seq_region_id
();
print
STDERR
"
sr_id =
$sr_id
\n
";
foreach
my
$pro
(
@proj
){
print
STDERR
"
projected slice ->
"
.
$pro
->
to_Slice
->
get_seq_region_id
()
.
"
\n
";
}
@proj
=
grep
{
$_
->
to_Slice
->
get_seq_region_id
()
!=
$sr_id
}
@proj
;
...
...
@@ -217,7 +221,8 @@ sub fetch_all_by_Slice_constraint {
foreach
my
$seg
(
@proj
)
{
my
$offset
=
$seg
->
from_start
();
my
$seg_slice
=
$seg
->
to_Slice
();
print
STDERR
"
MORE:
"
.
$seg_slice
->
name
.
"
\n
";
print
STDERR
"
constraint :-
$constraint
\n
";
my
$features
=
$self
->
_slice_fetch
(
$seg_slice
,
$constraint
);
## NO RESULTS
# if this was a symlinked slice offset the feature coordinates as needed
...
...
@@ -225,6 +230,7 @@ sub fetch_all_by_Slice_constraint {
FEATURE:
foreach
my
$f
(
@$features
)
{
print
STDERR
"
FEAT:
"
.
ref
(
$f
)
.
"
\n
";
if
(
$offset
!=
1
)
{
$f
->
{'
start
'}
+=
$offset
-
1
;
...
...
@@ -234,6 +240,7 @@ sub fetch_all_by_Slice_constraint {
# discard boundary crossing features from symlinked regions
foreach
my
$bound
(
@bounds
)
{
if
(
$f
->
{'
start
'}
<
$bound
&&
$f
->
{'
end
'}
>=
$bound
)
{
print
STDERR
"
BOUNDRY CROSSED
\n
";
next
FEATURE
;
}
}
...
...
@@ -289,6 +296,7 @@ sub _slice_fetch {
my
$slice_strand
=
$slice
->
strand
();
my
$slice_cs
=
$slice
->
coord_system
();
my
$slice_seq_region
=
$slice
->
seq_region_name
();
my
$slice_seq_region_id
=
$slice
->
get_seq_region_id
();
#get the synonym and name of the primary_table
my
@tabs
=
$self
->
_tables
;
...
...
@@ -300,7 +308,7 @@ sub _slice_fetch {
my
$asma
=
$self
->
db
->
get_AssemblyMapperAdaptor
();
my
@features
;
#
warn "jere are $self, @feat_css\n";
warn
"
jere are
$self
,
@feat_css
\n
";
# fetch the features from each coordinate system they are stored in
COORD_SYSTEM:
foreach
my
$feat_cs
(
@feat_css
)
{
my
$mapper
;
...
...
@@ -334,13 +342,16 @@ sub _slice_fetch {
"
AND
${tab_syn}
.seq_region_start >=
$min_start
";
}
print
STDERR
"
#constraint
$constraint
\n
";
my
$fs
=
$self
->
generic_fetch
(
$constraint
,
undef
,
$slice
);
# features may still have to have coordinates made relative to slice
# start
print
STDERR
"
#number of features is :-
"
.
scalar
(
@$fs
)
.
"
\n
";
$fs
=
_remap
(
$fs
,
$mapper
,
$slice
);
push
@features
,
@$fs
;
print
STDERR
"
#number of features is :-
"
.
scalar
(
@$fs
)
.
"
\n
";
}
else
{
$mapper
=
$asma
->
fetch_by_CoordSystems
(
$slice_cs
,
$feat_cs
);
...
...
@@ -356,7 +367,8 @@ sub _slice_fetch {
next
COORD_SYSTEM
if
(
!
@coords
);
@ids
=
map
{
$_
->
id
()}
@coords
;
@ids
=
@
{
$asma
->
seq_regions_to_ids
(
$feat_cs
,
\
@ids
)};
#coords are now id rather than name
# @ids = @{$asma->seq_regions_to_ids($feat_cs, \@ids)};
# When regions are large and only partially spanned by slice
# it is faster to to limit the query with start and end constraints.
...
...
@@ -369,11 +381,14 @@ sub _slice_fetch {
$constraint
.=
"
AND
"
if
(
$constraint
);
$constraint
.=
"
${tab_syn}
.seq_region_id IN (
$id_str
)
";
print
STDERR
"
.con:
$constraint
\n
";
my
$fs
=
$self
->
generic_fetch
(
$constraint
,
$mapper
,
$slice
);
print
STDERR
"
.number of features is :-
"
.
scalar
(
@$fs
)
.
"
\n
";
$fs
=
_remap
(
$fs
,
$mapper
,
$slice
);
push
@features
,
@$fs
;
print
STDERR
"
.number of features is :-
"
.
scalar
(
@features
)
.
"
\n
";
}
else
{
# do multiple split queries using start / end constraints
...
...
@@ -396,9 +411,12 @@ sub _slice_fetch {
"
AND
${tab_syn}
.seq_region_start >=
$min_start
";
}
print
STDERR
"
~con:
$constraint
\n
";
my
$fs
=
$self
->
generic_fetch
(
$constraint
,
$mapper
,
$slice
);
print
STDERR
"
~number of features is :-
"
.
scalar
(
@$fs
)
.
"
\n
";
$fs
=
_remap
(
$fs
,
$mapper
,
$slice
);
print
STDERR
"
~number after _remap features is :-
"
.
scalar
(
@$fs
)
.
"
\n
";
push
@features
,
@$fs
;
}
...
...
@@ -539,6 +557,7 @@ sub _remap {
my
(
$seq_region
,
$start
,
$end
,
$strand
);
my
$slice_seq_region_id
=
$slice
->
get_seq_region_id
();
my
$slice_seq_region
=
$slice
->
seq_region_name
();
foreach
my
$f
(
@$features
)
{
...
...
@@ -548,13 +567,14 @@ sub _remap {
throw
("
Feature does not have attached slice.
\n
");
}
my
$fseq_region
=
$fslice
->
seq_region_name
();
my
$fseq_region_id
=
$fslice
->
get_seq_region_id
();
my
$fcs
=
$fslice
->
coord_system
();
if
(
!
$slice_cs
->
equals
(
$fcs
))
{
#slice of feature in different coord system, mapping required
(
$seq_region
,
$start
,
$end
,
$strand
)
=
$mapper
->
fastmap
(
$fseq_region
,
$f
->
start
(),
$f
->
end
(),
$f
->
strand
(),
$fcs
);
$mapper
->
fastmap
(
$fseq_region
_id
,
$f
->
start
(),
$f
->
end
(),
$f
->
strand
(),
$fcs
);
# undefined start means gap
next
if
(
!
defined
$start
);
...
...
modules/Bio/EnsEMBL/DBSQL/DensityFeatureAdaptor.pm
View file @
275378ff
...
...
@@ -357,6 +357,7 @@ sub _objs_from_sth {
my
$dest_slice_strand
;
my
$dest_slice_length
;
my
$dest_slice_sr_name
;
my
$dest_slice_sr_id
;
if
(
$dest_slice
)
{
$dest_slice_start
=
$dest_slice
->
start
();
...
...
@@ -364,6 +365,7 @@ sub _objs_from_sth {
$dest_slice_strand
=
$dest_slice
->
strand
();
$dest_slice_length
=
$dest_slice
->
length
();
$dest_slice_sr_name
=
$dest_slice
->
seq_region_name
();
$dest_slice_sr_id
=
$dest_slice
->
get_seq_region_id
();
}
FEATURE:
while
(
$sth
->
fetch
())
{
...
...
@@ -403,7 +405,7 @@ sub _objs_from_sth {
$seq_region_start
=
$coords
[
0
]
->
{'
start
'};
$seq_region_end
=
$coords
[
0
]
->
{'
end
'};
$s
r_name
=
$coords
[
0
]
->
{'
id
'};
$s
eq_region_id
=
$coords
[
0
]
->
{'
id
'};
if
(
$density_type
->
value_type
()
eq
'
sum
')
{
#adjust density value so it reflects length of feature actually used
...
...
@@ -412,15 +414,14 @@ sub _objs_from_sth {
}
#get a slice in the coord system we just mapped to
if
(
$asm_cs
==
$sr_cs
||
(
$cmp_cs
!=
$sr_cs
&&
$asm_cs
->
equals
(
$sr_cs
)))
{
$slice
=
$slice_hash
{"
NAME:
$sr_name
:
$cmp_cs_name
:
$cmp_cs_vers
"}
||=
$sa
->
fetch_by_region
(
$cmp_cs_name
,
$sr_name
,
undef
,
undef
,
undef
,
$cmp_cs_vers
);
}
else
{
$slice
=
$slice_hash
{"
NAME:
$sr_name
:
$asm_cs_name
:
$asm_cs_vers
"}
||=
$sa
->
fetch_by_region
(
$asm_cs_name
,
$sr_name
,
undef
,
undef
,
undef
,
$asm_cs_vers
);
}
# if($asm_cs == $sr_cs || ($cmp_cs != $sr_cs && $asm_cs->equals($sr_cs))) {
$slice
=
$slice_hash
{"
ID:
"
.
$seq_region_id
}
||=
$sa
->
fetch_by_seq_region_id
(
$seq_region_id
);
# } else {
# $slice = $slice_hash{"NAME:$sr_name:$asm_cs_name:$asm_cs_vers"} ||=
# $sa->fetch_by_region($asm_cs_name, $sr_name, undef, undef, undef,
# $asm_cs_vers);
# }
}
#
...
...
@@ -441,7 +442,7 @@ sub _objs_from_sth {
#throw away features entirely off the end of the requested slice
if
(
$seq_region_end
<
1
||
$seq_region_start
>
$dest_slice_length
||
(
$dest_slice_sr_
name
ne
$s
r_name
))
{
(
$dest_slice_sr_
id
ne
$s
eq_region_id
))
{
next
FEATURE
;
}
$slice
=
$dest_slice
;
...
...
modules/Bio/EnsEMBL/DBSQL/DnaAlignFeatureAdaptor.pm
View file @
275378ff
...
...
@@ -261,6 +261,7 @@ sub _objs_from_sth {
my
$dest_slice_strand
;
my
$dest_slice_length
;
my
$dest_slice_sr_name
;
my
$dest_slice_seq_region_id
;
if
(
$dest_slice
)
{
$dest_slice_start
=
$dest_slice
->
start
();
...
...
@@ -268,6 +269,7 @@ sub _objs_from_sth {
$dest_slice_strand
=
$dest_slice
->
strand
();
$dest_slice_length
=
$dest_slice
->
length
();
$dest_slice_sr_name
=
$dest_slice
->
seq_region_name
();
$dest_slice_seq_region_id
=
$dest_slice
->
get_seq_region_id
();
}
FEATURE:
while
(
$sth
->
fetch
())
{
...
...
@@ -293,22 +295,20 @@ sub _objs_from_sth {
#
if
(
$mapper
)
{
(
$s
r_name
,
$seq_region_start
,
$seq_region_end
,
$seq_region_strand
)
=
(
$s
eq_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
(
$s
r_name
));
next
FEATURE
if
(
!
defined
(
$s
eq_region_id
));
#get a slice in the coord system we just mapped to
if
(
$asm_cs
==
$sr_cs
||
(
$cmp_cs
!=
$sr_cs
&&
$asm_cs
->
equals
(
$sr_cs
)))
{
$slice
=
$slice_hash
{"
NAME:
$sr_name
:
$cmp_cs_name
:
$cmp_cs_vers
"}
||=
$sa
->
fetch_by_region
(
$cmp_cs_name
,
$sr_name
,
undef
,
undef
,
undef
,
$cmp_cs_vers
);
$slice
=
$slice_hash
{"
ID:
"
.
$seq_region_id
}
||=
$sa
->
fetch_by_seq_region_id
(
$seq_region_id
);
}
else
{
$slice
=
$slice_hash
{"
NAME:
$sr_name
:
$asm_cs_name
:
$asm_cs_vers
"}
||=
$sa
->
fetch_by_region
(
$asm_cs_name
,
$sr_name
,
undef
,
undef
,
undef
,
$asm_cs_vers
);
$slice
=
$slice_hash
{"
ID:
"
.
$seq_region_id
}
||=
$sa
->
fetch_by_seq_region_id
(
$seq_region_id
);
}
}
...
...
@@ -330,7 +330,7 @@ sub _objs_from_sth {
#throw away features off the end of the requested slice
if
(
$seq_region_end
<
1
||
$seq_region_start
>
$dest_slice_length
||
(
$dest_slice_s
r_name
ne
$sr_name
))
{
(
$dest_slice_s
eq_region_id
ne
$seq_region_id
))
{
next
FEATURE
;
}
}
...
...
modules/Bio/EnsEMBL/DBSQL/ExonAdaptor.pm
View file @
275378ff
...
...
@@ -180,8 +180,11 @@ sub fetch_all_by_Transcript {
"
AND e.exon_id = et.exon_id
";
# fetch all of the exons
print
STDERR
"
\n
"
.
$slice
.
"
\n\t
"
.
$slice
->
name
.
"
\n
";
print
STDERR
"
$constraint
\n
";
my
$exons
=
$self
->
fetch_all_by_Slice_constraint
(
$slice
,
$constraint
);
print
STDERR
"
ther are
"
.
scalar
(
@$exons
)
.
"
exons
\n
";
#un-override the table definition
$self
->
{'
tables
'}
=
undef
;
$self
->
{'
final_clause
'}
=
undef
;
...
...
@@ -190,6 +193,7 @@ sub fetch_all_by_Transcript {
if
(
$slice
->
name
()
ne
$tslice
->
name
())
{
my
@out
;
foreach
my
$ex
(
@$exons
)
{
print
STDERR
"
$ex
being transfered
\n
";
push
@out
,
$ex
->
transfer
(
$tslice
);
}
$exons
=
\
@out
;
...
...
@@ -522,6 +526,7 @@ sub _objs_from_sth {
my
$dest_slice_length
;
my
$dest_slice_cs
;
my
$dest_slice_sr_name
;
my
$dest_slice_sr_id
;
my
$asma
;
if
(
$dest_slice
)
{
$dest_slice_start
=
$dest_slice
->
start
();
...
...
@@ -530,6 +535,7 @@ sub _objs_from_sth {
$dest_slice_length
=
$dest_slice
->
length
();
$dest_slice_cs
=
$dest_slice
->
coord_system
();
$dest_slice_sr_name
=
$dest_slice
->
seq_region_name
();
$dest_slice_sr_id
=
$dest_slice
->
get_seq_region_id
();
$asma
=
$self
->
db
->
get_AssemblyMapperAdaptor
();
}
...
...
@@ -565,23 +571,22 @@ sub _objs_from_sth {
#
if
(
$dest_mapper
)
{
(
$s
r_name
,
$seq_region_start
,
$seq_region_end
,
$seq_region_strand
)
=
(
$s
eq_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
(
$s
r_name
));
next
FEATURE
if
(
!
defined
(
$s
eq_region_id
));
#get a slice in the coord system we just mapped to
if
(
$asm_cs
==
$sr_cs
||
(
$cmp_cs
!=
$sr_cs
&&
$asm_cs
->
equals
(
$sr_cs
)))
{
$slice
=
$slice_hash
{"
NAME:
$sr_name
:
$cmp_cs_name
:
$cmp_cs_vers
"}
||=
$sa
->
fetch_by_region
(
$cmp_cs_name
,
$sr_name
,
undef
,
undef
,
undef
,
$cmp_cs_vers
);
}
else
{
$slice
=
$slice_hash
{"
NAME:
$sr_name
:
$asm_cs_name
:
$asm_cs_vers
"}
||=
$sa
->
fetch_by_region
(
$asm_cs_name
,
$sr_name
,
undef
,
undef
,
undef
,
$asm_cs_vers
);
}
# if($asm_cs == $sr_cs || ($cmp_cs != $sr_cs && $asm_cs->equals($sr_cs))) {
$slice
=
$slice_hash
{"
ID:
"
.
$seq_region_id
}
||=
$sa
->
fetch_by_seq_region_id
(
$seq_region_id
);
# } else {
# $slice = $slice_hash{"NAME:$sr_name:$asm_cs_name:$asm_cs_vers"} ||=
# $sa->fetch_by_seq_region_id($sr_name, undef, undef, undef,
# $asm_cs_vers);
# }
}
#
...
...
@@ -603,7 +608,7 @@ sub _objs_from_sth {
#throw away features off the end of the requested slice
if
(
$seq_region_end
<
1
||
$seq_region_start
>
$dest_slice_length
||
(
$dest_slice_sr_
name
ne
$sr_name
))
{
(
$dest_slice_sr_
id
!=
$seq_region_id
))
{
next
FEATURE
;
}
...
...
modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm
View file @
275378ff
...
...
@@ -1185,12 +1185,15 @@ sub _objs_from_sth {
my
$dest_slice_strand
;
my
$dest_slice_length
;
my
$dest_slice_sr_name
;
my
$dest_slice_sr_id
;
if
(
$dest_slice
)
{
$dest_slice_start
=
$dest_slice
->
start
();
$dest_slice_end
=
$dest_slice
->
end
();
$dest_slice_strand
=
$dest_slice
->
strand
();
$dest_slice_length
=
$dest_slice
->
length
();
$dest_slice_sr_name
=
$dest_slice
->
seq_region_name
();
$dest_slice_sr_id
=
$dest_slice
->
get_seq_region_id
();
}
FEATURE:
while
(
$sth
->
fetch
())
{
...
...
@@ -1216,23 +1219,22 @@ sub _objs_from_sth {
#
if
(
$mapper
)
{
(
$s
r_name
,
$seq_region_start
,
$seq_region_end
,
$seq_region_strand
)
=
(
$s
eq_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
(
$s
r_name
));
next
FEATURE
if
(
!
defined
(
$s
eq_region_id
));
#get a slice in the coord system we just mapped to
if
(
$asm_cs
==
$sr_cs
||
(
$cmp_cs
!=
$sr_cs
&&
$asm_cs
->
equals
(
$sr_cs
)))
{
$slice
=
$slice_hash
{"
NAME:
$sr_name
:
$cmp_cs_name
:
$cmp_cs_vers
"}
||=
$sa
->
fetch_by_region
(
$cmp_cs_name
,
$sr_name
,
undef
,
undef
,
undef
,
$cmp_cs_vers
);
}
else
{
$slice
=
$slice_hash
{"
NAME:
$sr_name
:
$asm_cs_name
:
$asm_cs_vers
"}
||=
$sa
->
fetch_by_region
(
$asm_cs_name
,
$sr_name
,
undef
,
undef
,
undef
,
$asm_cs_vers
);
}
# if($asm_cs == $sr_cs || ($cmp_cs != $sr_cs && $asm_cs->equals($sr_cs))) {
$slice
=
$slice_hash
{"
ID:
"
.
$seq_region_id
}
||=
$sa
->
fetch_by_seq_region_id
(
$seq_region_id
);
# } else {
# $slice = $slice_hash{"NAME:$sr_name:$asm_cs_name:$asm_cs_vers"} ||=
# $sa->fetch_by_region($asm_cs_name, $sr_name, undef, undef, undef,
# $asm_cs_vers);
# }
}
#
...
...
@@ -1255,7 +1257,7 @@ sub _objs_from_sth {
#throw away features off the end of the requested slice or on different seq_region
if
(
$seq_region_end
<
1
||
$seq_region_start
>
$dest_slice_length
||
(
$dest_slice_sr_
name
ne
$s
r_name
))
{
(
$dest_slice_sr_
id
ne
$s
eq_region_id
))
{
next
FEATURE
;
}
...
...
modules/Bio/EnsEMBL/DBSQL/MiscFeatureAdaptor.pm
View file @
275378ff
...
...
@@ -338,13 +338,14 @@ sub _objs_from_sth {
my
$dest_slice_strand
;
my
$dest_slice_length
;
my
$dest_slice_sr_name
;
my
$dest_slice_sr_id
;
if
(
$dest_slice
)
{
$dest_slice_start
=
$dest_slice
->
start
();
$dest_slice_end
=
$dest_slice
->
end
();
$dest_slice_strand
=
$dest_slice
->
strand
();
$dest_slice_length
=
$dest_slice
->
length
();
$dest_slice_sr_name
=
$dest_slice
->
seq_region_name
();
$dest_slice_sr_id
=
$dest_slice
->
get_seq_region_id
();
}
my
$current
=
-
1
;
...
...
@@ -414,27 +415,26 @@ sub _objs_from_sth {
#
if
(
$mapper
)
{
(
$s
r_name
,
$seq_region_start
,
$seq_region_end
,
$seq_region_strand
)
=
(
$s
eq_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
(
$s
r_name
))
{
if
(
!
defined
(
$s
eq_region_id
))
{
$throw_away
=
$misc_feature_id
;
next
FEATURE
;
}
#get a slice in the coord system we just mapped to
if
(
$asm_cs
==
$sr_cs
||
(
$cmp_cs
!=
$sr_cs
&&
$asm_cs
->
equals
(
$sr_cs
)))
{
$slice
=
$slice_hash
{"
NAME:
$sr_name
:
$cmp_cs_name
:
$cmp_cs_vers
"}
||=
$sa
->
fetch_by_region
(
$cmp_cs_name
,
$sr_name
,
undef
,
undef
,
undef
,
$cmp_cs_vers
);
}
else
{
$slice
=
$slice_hash
{"
NAME:
$sr_name
:
$asm_cs_name
:
$asm_cs_vers
"}
||=
$sa
->
fetch_by_region
(
$asm_cs_name
,
$sr_name
,
undef
,
undef
,
undef
,
$asm_cs_vers
);
}
# if ($asm_cs == $sr_cs ||
# ($cmp_cs != $sr_cs && $asm_cs->equals($sr_cs))) {
$slice
=
$slice_hash
{"
ID:
"
.
$seq_region_id
}
||=
$sa
->
fetch_by_seq_region_id
(
$seq_region_id
);
# } else {
# $slice = $slice_hash{"NAME:$sr_name:$asm_cs_name:$asm_cs_vers"} ||=
# $sa->fetch_by_region($asm_cs_name, $sr_name, undef, undef, undef,
# $asm_cs_vers);
# }
}
#
...
...
@@ -455,7 +455,7 @@ sub _objs_from_sth {
}
#throw away features off the end of the requested slice
if
(
$seq_region_end
<
1
||
$seq_region_start
>
$dest_slice_length
||
(
$dest_slice_sr_
name
ne
$s
r_name
))
{
(
$dest_slice_sr_
id
ne
$s
eq_region_id
))
{
#flag this feature as one to throw away
$throw_away
=
$misc_feature_id
;
next
FEATURE
;
...
...
modules/Bio/EnsEMBL/DBSQL/OligoFeatureAdaptor.pm
View file @
275378ff
...
...
@@ -306,12 +306,14 @@ sub _objs_from_sth {
my
$dest_slice_strand
;
my
$dest_slice_length
;
my
$dest_slice_sr_name
;
my
$dest_slice_sr_id
;
if
(
$dest_slice
)
{
$dest_slice_start
=
$dest_slice
->
start
();
$dest_slice_end
=
$dest_slice
->
end
();
$dest_slice_strand
=
$dest_slice
->
strand
();
$dest_slice_length
=
$dest_slice
->
length
();
$dest_slice_sr_name
=
$dest_slice
->
seq_region_name
();
$dest_slice_sr_id
=
$dest_slice
->
get_seq_region_id
();
}
my
$last_feature_id
=
-
1
;
...
...
@@ -339,20 +341,20 @@ sub _objs_from_sth {
# Remap the feature coordinates to another coord system if a mapper was provided
if
(
$mapper
)
{
(
$s
r_name
,
$seq_region_start
,
$seq_region_end
,
$seq_region_strand
)
(
$s
eq_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
$s
r_name
;
next
FEATURE
if
!
defined
$s
eq_region_id
;
# Get a slice in the coord system we just mapped to
if
(
$asm_cs
==
$sr_cs
||
(
$cmp_cs
!=
$sr_cs
&&
$asm_cs
->
equals
(
$sr_cs
)
)
)
{
$slice
=
$slice_hash
{"
NAME:
$sr_name
:
$cmp_cs_name
:
$cmp_cs_vers
"
}
||=
$sa
->
fetch_by_region
(
$cmp_cs_name
,
$sr_name
,
undef
,
undef
,
undef
,
$cmp_cs_vers
);
}
else
{
$slice
=
$slice_hash
{"
NAME:
$sr_name
:
$asm_cs_name
:
$asm_cs_vers
"}
||=
$sa
->
fetch_by_region
(
$asm_cs_name
,
$sr_name
,
undef
,
undef
,
undef
,
$asm_cs_vers
);
}
#
if ( $asm_cs == $sr_cs || ( $cmp_cs != $sr_cs && $asm_cs->equals($sr_cs) ) ) {
$slice
=
$slice_hash
{"
ID:
"
.
$seq_region_id
}
||=
$sa
->
fetch_by_
seq_
region
_id
(
$seq_region_id
);
#
} else {
#
$slice = $slice_hash{"NAME:$sr_name:$asm_cs_name:$asm_cs_vers"}
#
||= $sa->fetch_by_region($asm_cs_name, $sr_name, undef, undef, undef, $asm_cs_vers);
#
}
}
# If a destination slice was provided convert the coords
...
...
@@ -372,7 +374,7 @@ sub _objs_from_sth {
# Throw away features off the end of the requested slice
next
FEATURE
if
$seq_region_end
<
1
||
$seq_region_start
>
$dest_slice_length
||
(
$dest_slice_sr_
name
ne
$s
r_name
);
||
(
$dest_slice_sr_
id
ne
$s
eq_region_id
);
$slice
=
$dest_slice
;
}
...
...
modules/Bio/EnsEMBL/DBSQL/PredictionExonAdaptor.pm
View file @
275378ff
...
...
@@ -332,6 +332,7 @@ sub _objs_from_sth {
my
$dest_slice_cs
;
my
$asma
;
my
$dest_slice_sr_name
;
my
$dest_slice_sr_id
;
if
(
$dest_slice
)
{
$dest_slice_start
=
$dest_slice
->
start
();
...
...
@@ -340,6 +341,7 @@ sub _objs_from_sth {
$dest_slice_length
=
$dest_slice
->
length
();
$dest_slice_cs
=
$dest_slice
->
coord_system
;
$dest_slice_sr_name
=
$dest_slice
->
seq_region_name
();
$dest_slice_sr_id
=
$dest_slice
->
get_seq_region_id
();
$asma
=
$self
->
db
->
get_AssemblyMapperAdaptor
();
}
...
...
@@ -377,23 +379,22 @@ sub _objs_from_sth {
#
if
(
$dest_mapper
)
{
(
$s
r_name
,
$seq_region_start
,
$seq_region_end
,
$seq_region_strand
)
=
(
$s
eq_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
(
$s
r_name
));
next
FEATURE
if
(
!
defined
(
$s
eq_region_id
));
#get a slice in the coord system we just mapped to
if
(
$asm_cs
==
$sr_cs
||
(
$cmp_cs
!=
$sr_cs
&&
$asm_cs
->
equals
(
$sr_cs
)))
{
$slice
=
$slice_hash
{"
NAME:
$sr_name
:
$cmp_cs_name
:
$cmp_cs_vers
"}
||=
$sa
->
fetch_by_region
(
$cmp_cs_name
,
$sr_name
,
undef
,
undef
,
undef
,
$cmp_cs_vers
);
}
else
{
$slice
=
$slice_hash
{"
NAME:
$sr_name
:
$asm_cs_name
:
$asm_cs_vers
"}
||=
$sa
->
fetch_by_region
(
$asm_cs_name
,
$sr_name
,
undef
,
undef
,
undef
,
$asm_cs_vers
);
}
# if($asm_cs == $sr_cs || ($cmp_cs != $sr_cs && $asm_cs->equals($sr_cs))) {
$slice
=
$slice_hash
{"
ID:
"
.
$seq_region_id
}
||=
$sa
->
fetch_by_seq_region_id
(
$seq_region_id
);
# } else {
# $slice = $slice_hash{"NAME:$sr_name:$asm_cs_name:$asm_cs_vers"} ||=
# $sa->fetch_by_region($asm_cs_name, $sr_name, undef, undef, undef,
# $asm_cs_vers);
# }
}
#
...
...
@@ -415,7 +416,7 @@ sub _objs_from_sth {
#throw away features off the end of the requested slice
if
(
$seq_region_end
<
1
||
$seq_region_start
>
$dest_slice_length
||
(
$dest_slice_sr_
name
ne
$s
r_name
))
{
(
$dest_slice_sr_
id
ne
$s
eq_region_id
))
{
next
FEATURE
;
}
...
...
modules/Bio/EnsEMBL/DBSQL/PredictionTranscriptAdaptor.pm
View file @
275378ff
...
...
@@ -304,12 +304,14 @@ sub _objs_from_sth {
my
$dest_slice_strand
;
my
$dest_slice_length
;
my
$dest_slice_sr_name
;
my
$dest_slice_sr_id
;
if
(
$dest_slice
)
{
$dest_slice_start
=
$dest_slice
->
start
();
$dest_slice_end
=
$dest_slice
->
end
();
$dest_slice_strand
=
$dest_slice
->
strand
();
$dest_slice_length
=
$dest_slice
->
length
();
$dest_slice_sr_name
=
$dest_slice
->
seq_region_name
();
$dest_slice_sr_id
=
$dest_slice
->
get_seq_region_id
();
}
FEATURE:
while
(
$sth
->
fetch
())
{
...
...
@@ -335,23 +337,22 @@ sub _objs_from_sth {
#
if
(
$mapper
)
{