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
227ae696
Commit
227ae696
authored
21 years ago
by
Graham McVicker
Browse files
Options
Downloads
Patches
Plain Diff
Created new Bio::EnsEMBL::Attribute class
parent
2edcd70f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/Attribute.pm
+161
-0
161 additions, 0 deletions
modules/Bio/EnsEMBL/Attribute.pm
with
161 additions
and
0 deletions
modules/Bio/EnsEMBL/Attribute.pm
0 → 100644
+
161
−
0
View file @
227ae696
#
# Ensembl module for Bio::EnsEMBL::Attribute
#
# Copyright (c) 2004 Ensembl
#
# You may distribute this module under the same terms as perl itself
# POD documentation - main docs before the code
=head1 NAME
Bio::EnsEMBL::Attribute - A generic Attribute class.
=head1 SYNOPSIS
use Bio::EnsEMBL::Attribute;
my $attribute = Bio::EnsEMBL::Attribute->new
(-CODE => 'myCode',
-NAME => 'My Attribute',
-DESC => 'This is my attribute description.',
-VALUE => '10023');
print $attrib->name(), "\n";
print $attrib->code(), "\n";
print $attrib->desc(), "\n";
print $attrib->value(), "\n";
=head1 DESCRIPTION
This is a generic attribute class used to represent attributes
associated with seq_regions (and their Slices) and MiscFeatures.
Also see B<Bio::EnsEMBL::Slice>, B<Bio::EnsEMBL::MiscFeature> and
B<Bio::EnsEMBL::DBSQL::AttributeAdaptor>.
=head1 CONTACT
This modules is part of the Ensembl project http://www.ensembl.org
Questions can be posted to the ensembl-dev mailing list:
ensembl-dev@ebi.ac.uk
=head1 METHODS
=cut
use
strict
;
use
warnings
;
package
Bio::EnsEMBL::
Attribute
;
use
Bio::EnsEMBL::Utils::
Argument
qw(rearrange)
;
=head2 new
Arg [-CODE] : string - the code for this attribute
Arg [-NAME] : string - a human readable name for this attribute
Arg [-DESC] : string - a description for this attribute
Arg [-VALUE] : value - the value of this attribute
Example : my $attribute = Bio::EnsEMBL::Attribute->new
(-CODE => 'myCode',
-NAME => 'My Attribute',
-DESC => 'This is my attribute description.',
-VALUE => '10023');
Description: Constructor. Instantiates a Bio::EnsEMBL::Attribute object.
Returntype : Bio::EnsEMBL::Attribute
Exceptions : none
Caller : general
=cut
sub
new
{
my
$caller
=
shift
;
# allow to be called as class or object method
my
$class
=
ref
(
$caller
)
||
$caller
;
my
(
$code
,
$name
,
$desc
,
$value
)
=
rearrange
([
qw(CODE NAME DESC VALUE)
],
@
_
);
return
bless
{'
code
'
=>
$code
,
'
name
'
=>
$name
,
'
desc
'
=>
$desc
,
'
value
'
=>
$value
},
$class
;
}
=head2 code
Arg [1] : string $code (optional)x
Example : $code = $attribute->code();
Description: Getter/Setter for code attribute
Returntype : string
Exceptions : none
Caller : general
=cut
sub
code
{
my
$self
=
shift
;
$self
->
{'
code
'}
=
shift
if
(
@
_
);
return
$self
->
{'
code
'};
}
=head2 name
Arg [1] : string $name (optional)
Example : $name = $attribute->name();
Description: Getter/Setter for name attribute
Returntype : string
Exceptions : none
Caller : general
=cut
sub
name
{
my
$self
=
shift
;
$self
->
{'
name
'}
=
shift
if
(
@
_
);
return
$self
->
{'
name
'};
}
=head2 desc
Arg [1] : string $desc (optional)
Example : $desc = $attribute->desc();
Description: Getter/Setter for description attribute
Returntype : string
Exceptions : none
Caller : general
=cut
sub
desc
{
my
$self
=
shift
;
$self
->
{'
desc
'}
=
shift
if
(
@
_
);
return
$self
->
{'
desc
'};
}
=head2 value
Arg [1] : string $value (optional)
Example : $value = $attribute->value();
Description: Getter/Setter for value attribute
Returntype : string
Exceptions : none
Caller : general
=cut
sub
value
{
my
$self
=
shift
;
$self
->
{'
value
'}
=
shift
if
(
@
_
);
return
$self
->
{'
value
'};
}
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