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
6d244bff
Commit
6d244bff
authored
12 years ago
by
Andy Yates
Browse files
Options
Downloads
Patches
Plain Diff
Bringing in summaries as hashes
parent
2d3ad239
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/Bio/EnsEMBL/MiscFeature.pm
+25
-0
25 additions, 0 deletions
modules/Bio/EnsEMBL/MiscFeature.pm
modules/Bio/EnsEMBL/SimpleFeature.pm
+22
-0
22 additions, 0 deletions
modules/Bio/EnsEMBL/SimpleFeature.pm
with
47 additions
and
0 deletions
modules/Bio/EnsEMBL/MiscFeature.pm
+
25
−
0
View file @
6d244bff
...
@@ -376,7 +376,32 @@ sub display_id {
...
@@ -376,7 +376,32 @@ sub display_id {
}
}
}
}
=head2 summary_as_hash
Example : my $hash = $misc_feature->summary_as_hash();
Description: Generates a HashRef compatible with GFFSerializer. Adds
all attribute key value pairs plus MiscSet codes and names
Returntype : Hash
Exceptions : none
Caller : general
Status : Stable
=cut
sub
summary_as_hash
{
my
(
$self
)
=
@_
;
my
$hash
=
$self
->
SUPER::
summary_as_hash
();
my
$attributes
=
$self
->
get_all_Attributes
();
foreach
my
$attr
(
@
{
$attributes
})
{
$hash
->
{
$attr
->
name
()}
=
$attr
->
value
();
}
my
$misc_sets
=
$self
->
get_all_MiscSets
();
foreach
my
$set
(
@
{
$misc_sets
})
{
push
(
@
{
$hash
->
{
misc_set_code
}},
$set
->
code
());
push
(
@
{
$hash
->
{
misc_set_name
}},
$set
->
name
());
}
return
$hash
;
}
1
;
1
;
This diff is collapsed.
Click to expand it.
modules/Bio/EnsEMBL/SimpleFeature.pm
+
22
−
0
View file @
6d244bff
...
@@ -162,5 +162,27 @@ sub score {
...
@@ -162,5 +162,27 @@ sub score {
return
$self
->
{'
score
'};
return
$self
->
{'
score
'};
}
}
=head2 summary_as_hash
Example : my $hash = $simple_feature->summary_as_hash();
Description: Generates a HashRef compatible with GFFSerializer. Adds
score, external_name and logic_name to the basic Feature
hash
Returntype : Hash
Exceptions : none
Caller : general
Status : Stable
=cut
sub
summary_as_hash
{
my
(
$self
)
=
@_
;
my
$hash
=
$self
->
SUPER::
summary_as_hash
();
$hash
->
{
score
}
=
$self
->
score
()
if
$self
->
score
();
$hash
->
{'
external_name
'}
=
$self
->
display_label
()
if
$self
->
display_label
();
$hash
->
{'
logic_name
'}
=
$self
->
analysis
->
logic_name
();
return
$hash
;
}
1
;
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