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
a86f7e80
Commit
a86f7e80
authored
18 years ago
by
Eugene Kulesha
Browse files
Options
Downloads
Patches
Plain Diff
moved get_all_DAS_Features into Storable so it can be used by geneview, protview, transview etc
parent
3c05dff5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/Bio/EnsEMBL/Storable.pm
+33
-0
33 additions, 0 deletions
modules/Bio/EnsEMBL/Storable.pm
modules/Bio/EnsEMBL/Translation.pm
+2
-0
2 additions, 0 deletions
modules/Bio/EnsEMBL/Translation.pm
with
35 additions
and
0 deletions
modules/Bio/EnsEMBL/Storable.pm
+
33
−
0
View file @
a86f7e80
...
...
@@ -176,6 +176,39 @@ sub is_stored {
return
0
;
}
sub
get_all_DAS_Features
{
my
(
$self
,
$slice
)
=
@_
;
$self
->
{
_das_features
}
||=
{};
# Cache
$self
->
{
_das_styles
}
||=
{};
# Cache
my
%das_features
;
my
%das_styles
;
foreach
my
$dasfact
(
@
{
$self
->
get_all_DASFactories
}
){
my
$dsn
=
$dasfact
->
adaptor
->
dsn
;
my
$name
=
$dasfact
->
adaptor
->
name
;
my
$type
=
$dasfact
->
adaptor
->
type
;
my
$url
=
$dasfact
->
adaptor
->
url
;
# Construct a cache key : SOURCE_URL/TYPE
# Need the type to handle sources that serve multiple types of features
my
$key
=
$url
||
(
$dasfact
->
adaptor
->
protocol
.
'
://
'
.
join
('
/
'
.
$dasfact
->
adaptor
->
domain
,
$dasfact
->
adaptor
->
dsn
));
if
(
$self
->
{
_das_features
}
->
{
$key
}
){
# Use cached
$das_features
{
$name
}
=
$self
->
{
_das_features
}
->
{
$key
};
$das_styles
{
$name
}
=
$self
->
{
_das_styles
}
->
{
$key
};
}
else
{
# Get fresh data
my
(
$featref
,
$styleref
)
=
(
$type
=~
/^ensembl_location/
)
?
(
$dasfact
->
fetch_all_Features
(
$slice
,
$type
))[
0
]
:
$dasfact
->
fetch_all_by_ID
(
$self
);
$self
->
{
_das_features
}
->
{
$key
}
=
$featref
;
$self
->
{
_das_styles
}
->
{
$key
}
=
$styleref
;
$das_features
{
$name
}
=
$featref
;
$das_styles
{
$name
}
=
$styleref
;
}
}
return
(
\
%das_features
,
\
%das_styles
);
}
1
;
This diff is collapsed.
Click to expand it.
modules/Bio/EnsEMBL/Translation.pm
+
2
−
0
View file @
a86f7e80
...
...
@@ -814,6 +814,8 @@ sub get_all_DAS_Features{
my
$GeneAdaptor
=
$db
->
get_GeneAdaptor
;
my
$Gene
=
$GeneAdaptor
->
fetch_by_translation_stable_id
(
$self
->
stable_id
)
||
return
;
my
$slice
=
$Gene
->
feature_Slice
;
return
$self
->
SUPER::
get_all_DAS_Features
(
$slice
);
foreach
my
$dasfact
(
@
{
$self
->
get_all_DASFactories
}
){
my
$dsn
=
$dasfact
->
adaptor
->
dsn
;
...
...
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