Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
ef41c7f6
Commit
ef41c7f6
authored
22 years ago
by
Arne Stabenau
Browse files
Options
Downloads
Patches
Plain Diff
bug fix
parent
a64c020c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/External/ExternalFeatureAdaptor.pm
+21
-18
21 additions, 18 deletions
modules/Bio/EnsEMBL/External/ExternalFeatureAdaptor.pm
with
21 additions
and
18 deletions
modules/Bio/EnsEMBL/External/ExternalFeatureAdaptor.pm
+
21
−
18
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment