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
df067b63
Commit
df067b63
authored
20 years ago
by
Eugene Kulesha
Browse files
Options
Downloads
Patches
Plain Diff
added get_all_DAS_Features that will get das features and annotations from all attached sources
parent
451a888e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/Bio/EnsEMBL/Gene.pm
+38
-0
38 additions, 0 deletions
modules/Bio/EnsEMBL/Gene.pm
modules/Bio/EnsEMBL/Transcript.pm
+59
-0
59 additions, 0 deletions
modules/Bio/EnsEMBL/Transcript.pm
modules/Bio/EnsEMBL/Translation.pm
+42
-0
42 additions, 0 deletions
modules/Bio/EnsEMBL/Translation.pm
with
139 additions
and
0 deletions
modules/Bio/EnsEMBL/Gene.pm
+
38
−
0
View file @
df067b63
...
...
@@ -838,5 +838,43 @@ sub get_all_DASFeatures_by_slice{
}
return
\
%das_features
;
}
=head2 get_all_DAS_Features
Arg [1] : none
Example : $features = $prot->get_all_DAS_Features;
Description: Retreives a hash reference to a hash of DAS feature
sets, keyed by the DNS, NOTE the values of this hash
are an anonymous array containing:
(1) a pointer to an array of features;
(2) a pointer to the DAS stylesheet
Returntype : hashref of Bio::SeqFeatures
Exceptions : ?
Caller : webcode
=cut
sub
get_all_DAS_Features
{
my
(
$self
,
@args
)
=
@_
;
$self
->
{
_das_features
}
||=
{};
# Cache
my
%das_features
;
my
$slice
=
$self
->
feature_Slice
;
foreach
my
$dasfact
(
@
{
$self
->
get_all_DASFactories
}
){
my
$dsn
=
$dasfact
->
adaptor
->
dsn
;
my
$type
=
$dasfact
->
adaptor
->
type
;
my
$key
=
defined
(
$dasfact
->
adaptor
->
url
)
?
$dasfact
->
adaptor
->
url
.
'
/
'
.
$dsn
:
$dasfact
->
adaptor
->
protocol
.
'
://
'
.
$dasfact
->
adaptor
->
domain
.
'
/
'
.
$dsn
;
if
(
$self
->
{
_das_features
}
->
{
$key
}
){
# Use cached
$das_features
{
$key
}
=
$self
->
{
_das_features
}
->
{
$key
};
next
;
}
else
{
# Get fresh data
my
@featref
=
(
$type
eq
'
ensembl_location
')
?
(
$key
,
(
$dasfact
->
fetch_all_by_Slice
(
$slice
))[
0
])
:
$dasfact
->
fetch_all_by_DBLink_Container
(
$self
);
$self
->
{
_das_features
}
->
{
$key
}
=
[
@featref
];
$das_features
{
$key
}
=
[
@featref
];
}
}
return
\
%das_features
;
}
1
;
This diff is collapsed.
Click to expand it.
modules/Bio/EnsEMBL/Transcript.pm
+
59
−
0
View file @
df067b63
...
...
@@ -1900,5 +1900,64 @@ sub temporary_id{
}
=head2 get_all_DASFactories
Arg [1] : none
Function : Retrieves a listref of registered DAS objects
Returntype: [ DAS_objects ]
Exceptions:
Caller :
Example : $dasref = $prot->get_all_DASFactories
=cut
sub
get_all_DASFactories
{
my
$self
=
shift
;
return
[
$self
->
adaptor
()
->
db
()
->
_each_DASFeatureFactory
];
}
=head2 get_all_DAS_Features
Arg [1] : none
Example : $features = $prot->get_all_DAS_Features;
Description: Retreives a hash reference to a hash of DAS feature
sets, keyed by the DNS, NOTE the values of this hash
are an anonymous array containing:
(1) a pointer to an array of features;
(2) a pointer to the DAS stylesheet
Returntype : hashref of Bio::SeqFeatures
Exceptions : ?
Caller : webcode
=cut
sub
get_all_DAS_Features
{
my
(
$self
,
@args
)
=
@_
;
$self
->
{
_das_features
}
||=
{};
# Cache
my
%das_features
;
my
$db
=
$self
->
adaptor
->
db
;
my
$GeneAdaptor
=
$db
->
get_GeneAdaptor
;
my
$Gene
=
$GeneAdaptor
->
fetch_by_transcript_stable_id
(
$self
->
stable_id
);
my
$slice
=
$Gene
->
feature_Slice
;
foreach
my
$dasfact
(
@
{
$self
->
get_all_DASFactories
}
){
my
$dsn
=
$dasfact
->
adaptor
->
dsn
;
my
$type
=
$dasfact
->
adaptor
->
type
;
my
$key
=
defined
(
$dasfact
->
adaptor
->
url
)
?
$dasfact
->
adaptor
->
url
.
'
/
'
.
$dsn
:
$dasfact
->
adaptor
->
protocol
.
'
://
'
.
$dasfact
->
adaptor
->
domain
.
'
/
'
.
$dsn
;
if
(
$self
->
{
_das_features
}
->
{
$key
}
){
# Use cached
$das_features
{
$key
}
=
$self
->
{
_das_features
}
->
{
$key
};
next
;
}
else
{
# Get fresh data
my
@featref
=
(
$type
eq
'
ensembl_location
')
?
(
$key
,
(
$dasfact
->
fetch_all_by_Slice
(
$slice
))[
0
])
:
$dasfact
->
fetch_all_by_DBLink_Container
(
$self
);
$self
->
{
_das_features
}
->
{
$key
}
=
[
@featref
];
$das_features
{
$key
}
=
[
@featref
];
}
}
return
\
%das_features
;
}
1
;
This diff is collapsed.
Click to expand it.
modules/Bio/EnsEMBL/Translation.pm
+
42
−
0
View file @
df067b63
...
...
@@ -751,4 +751,46 @@ sub get_all_DASFeatures{
return
\
%das_features
;
}
=head2 get_all_DAS_Features
Arg [1] : none
Example : $features = $prot->get_all_DAS_Features;
Description: Retreives a hash reference to a hash of DAS feature
sets, keyed by the DNS, NOTE the values of this hash
are an anonymous array containing:
(1) a pointer to an array of features;
(2) a pointer to the DAS stylesheet
Returntype : hashref of Bio::SeqFeatures
Exceptions : ?
Caller : webcode
=cut
sub
get_all_DAS_Features
{
my
(
$self
,
@args
)
=
@_
;
$self
->
{
_das_features
}
||=
{};
# Cache
my
%das_features
;
my
$db
=
$self
->
adaptor
->
db
;
my
$GeneAdaptor
=
$db
->
get_GeneAdaptor
;
my
$Gene
=
$GeneAdaptor
->
fetch_by_translation_stable_id
(
$self
->
stable_id
);
my
$slice
=
$Gene
->
feature_Slice
;
foreach
my
$dasfact
(
@
{
$self
->
get_all_DASFactories
}
){
my
$dsn
=
$dasfact
->
adaptor
->
dsn
;
my
$type
=
$dasfact
->
adaptor
->
type
;
my
$key
=
defined
(
$dasfact
->
adaptor
->
url
)
?
$dasfact
->
adaptor
->
url
.
'
/
'
.
$dsn
:
$dasfact
->
adaptor
->
protocol
.
'
://
'
.
$dasfact
->
adaptor
->
domain
.
'
/
'
.
$dsn
;
if
(
$self
->
{
_das_features
}
->
{
$key
}
){
# Use cached
$das_features
{
$key
}
=
$self
->
{
_das_features
}
->
{
$key
};
next
;
}
else
{
# Get fresh data
my
@featref
=
(
$type
eq
'
ensembl_location
')
?
(
$key
,
(
$dasfact
->
fetch_all_by_Slice
(
$slice
))[
0
])
:
$dasfact
->
fetch_all_by_DBLink_Container
(
$self
);
$self
->
{
_das_features
}
->
{
$key
}
=
[
@featref
];
$das_features
{
$key
}
=
[
@featref
];
}
}
return
\
%das_features
;
}
1
;
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