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
ef41c7f6
Commit
ef41c7f6
authored
Nov 11, 2002
by
Arne Stabenau
Browse files
bug fix
parent
a64c020c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
18 deletions
+21
-18
modules/Bio/EnsEMBL/External/ExternalFeatureAdaptor.pm
modules/Bio/EnsEMBL/External/ExternalFeatureAdaptor.pm
+21
-18
No files found.
modules/Bio/EnsEMBL/External/ExternalFeatureAdaptor.pm
View file @
ef41c7f6
...
...
@@ -121,6 +121,7 @@ use vars qw(@ISA);
use
Bio::EnsEMBL::
Root
;
@ISA
=
qw(Bio::EnsEMBL::Root)
;
...
...
@@ -148,10 +149,10 @@ sub new {
=head2 db
=head2
ensembl_
db
Arg [1] : (optional) Bio::EnsEMBL::DBSQL::DBAdaptor
Example : $external_feature_adaptor->db($new_val);
Example : $external_feature_adaptor->
ensembl_
db($new_val);
Description: none
Returntype : Bio::EnsEMBL::DBSQL::DBAdaptor
Exceptions : none
...
...
@@ -159,17 +160,19 @@ sub new {
=cut
sub
db
{
sub
ensembl_
db
{
my
(
$self
,
$value
)
=
@_
;
if
(
$value
)
{
#avoid potentially nasty memory leaks
if
(
ref
$value
&&
$value
->
isa
("
Bio::EnsEMBL::Container
"))
{
$self
->
{'
db
'}
=
$value
->
_obj
;
$self
->
{'
ensembl_db
'}
=
$value
->
_obj
;
}
else
{
$self
->
{'
ensembl_db
'}
=
$value
;
}
}
return
$self
->
{'
db
'};
return
$self
->
{'
ensembl_
db
'};
}
...
...
@@ -368,7 +371,7 @@ sub fetch_all_by_RawContig {
$end
=
$f
->
end
-
$offset
+
1
;
#skip features which are not entirely on this contig
next
if
(
$start
<
1
||
$end
>
$
self
->
length
);
next
if
(
$start
<
1
||
$end
>
$length
);
$f
->
start
(
$start
);
$f
->
end
(
$end
);
...
...
@@ -383,13 +386,13 @@ sub fetch_all_by_RawContig {
$self
->
_no_valid_coord_system
;
}
unless
(
$self
->
db
)
{
unless
(
$self
->
ensembl_
db
)
{
$self
->
throw
('
DB attribute not set. This value must be set for the
'
.
'
ExternalFeatureAdaptor to function correctly
');
}
my
$asma
=
$self
->
db
->
get_AssemblyMapperAdaptor
;
my
$mapper
=
$asma
->
fetch_by_type
(
$self
->
db
->
assembly_type
);
my
$asma
=
$self
->
ensembl_
db
->
get_AssemblyMapperAdaptor
;
my
$mapper
=
$asma
->
fetch_by_type
(
$self
->
ensembl_
db
->
assembly_type
);
#map the whole contig to the assembly
my
@mapped
=
$mapper
->
map_coordinates_to_assembly
(
$contig
->
dbID
,
1
,
...
...
@@ -472,12 +475,12 @@ sub fetch_all_by_contig_name {
"
but fetch_all_by_contig_name is not implemented
");
}
unless
(
$self
->
db
)
{
unless
(
$self
->
ensembl_
db
)
{
$self
->
throw
('
DB attribute not set. This value must be set for the
'
.
'
ExternalFeatureAdaptor to function correctly
');
}
my
$contig_adaptor
=
$self
->
db
->
get_RawContigAdaptor
;
my
$contig_adaptor
=
$self
->
ensembl_
db
->
get_RawContigAdaptor
;
my
$contig
=
$contig_adaptor
->
fetch_by_name
(
$contig_name
);
unless
(
$contig
)
{
...
...
@@ -599,13 +602,13 @@ sub fetch_all_by_clone_accession {
'
but does not implement fetch_all_by_clone_accession
');
}
unless
(
$self
->
db
)
{
unless
(
$self
->
ensembl_
db
)
{
$self
->
throw
('
DB attribute not set. This value must be set for the
'
.
'
ExternalFeatureAdaptor to function correctly
');
}
my
$clone_adaptor
=
$self
->
db
->
get_CloneAdaptor
;
my
$clone_adaptor
=
$self
->
ensembl_
db
->
get_CloneAdaptor
;
my
$clone
=
$clone_adaptor
->
fetch_by_accession
(
$acc
);
...
...
@@ -655,16 +658,16 @@ sub fetch_all_by_chr_start_end {
$self
->
throw
("
Incorrect start [
$start
] end [
$end
] or chr [
$chr_name
] arg
");
}
unless
(
$self
->
db
)
{
unless
(
$self
->
ensembl_
db
)
{
$self
->
throw
('
DB attribute not set. This value must be set for the
'
.
'
ExternalFeatureAdaptor to function correctly
');
}
my
$out
=
[]
;
my
$asma
=
$self
->
db
->
get_AssemblyMapperAdaptor
;
my
$mapper
=
$asma
->
fetch_by_type
(
$self
->
db
->
assembly_type
);
my
$contig_adaptor
=
$self
->
db
->
get_RawContigAdaptor
;
my
$asma
=
$self
->
ensembl_
db
->
get_AssemblyMapperAdaptor
;
my
$mapper
=
$asma
->
fetch_by_type
(
$self
->
ensembl_
db
->
assembly_type
);
my
$contig_adaptor
=
$self
->
ensembl_
db
->
get_RawContigAdaptor
;
if
(
$self
->
_supported
('
ASSEMBLY
'))
{
$self
->
throw
("
ExternalFeatureAdaptor supports ASSEMBLY coordinate system
"
.
...
...
@@ -672,7 +675,7 @@ sub fetch_all_by_chr_start_end {
}
my
$slice_adaptor
=
$self
->
db
->
get_SliceAdaptor
;
my
$slice_adaptor
=
$self
->
ensembl_
db
->
get_SliceAdaptor
;
#get a slice of the whole chromosome
my
$chrom_slice
=
$slice_adaptor
->
fetch_by_chr_name
(
$chr_name
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment