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
dcbea868
Commit
dcbea868
authored
21 years ago
by
Graham McVicker
Browse files
Options
Downloads
Patches
Plain Diff
updated PODs
parent
ed8911ac
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/MiscFeature.pm
+41
-95
41 additions, 95 deletions
modules/Bio/EnsEMBL/MiscFeature.pm
with
41 additions
and
95 deletions
modules/Bio/EnsEMBL/MiscFeature.pm
+
41
−
95
View file @
dcbea868
...
...
@@ -15,6 +15,8 @@ associations.
=head1 SYNOPSIS
use Bio::EnsEMBL::MiscFeature;
use Bio::EnsEMBL::MiscSet;
use Bio::EnsEMBL::Attribute;
my $mfeat = Bio::EnsEMBL::MiscFeature->new(-START => 1200,
-END => 100_000,
...
...
@@ -22,31 +24,43 @@ associations.
-SLICE => $slice);
# Can add attributes to the misc feature and associate with various sets
$clone_set->code('clone');
$tiling_path_set->core('tilingpath');
$mfeat->add_attribute('name', 'RLX12451');
$mfeat->add_attribute('version', '4');
$mfeat->add_attribute('synonym', 'AL42131.4');
$mfeat->add_attrubute('synonym', 'Z199311');
$mfeat->add_set($clone_set);
$mfeat->add_set($tiling_path_set);
my ($name) = $mfeat->get_attribute('name');
my @synonyms = $mfeat->get_attribute('synonym');
my @attrib_types = $mfeat->get_attribute_types();
foreach my $attrib_type (@attrib_types) {
print join(',', $mfeat->get_attribute($attrib_type));
}
my $clone_set = Bio::EnsEMBL::MiscSet->new(-CODE => 'clone',
-NAME => '1MB clone set',
-DESCRIPTION => '1MB CloneSet');
$clone_set = $mfeat->get_set('clone');
$tiling_path_set = $mfeat->get_set('tiling_path');
my @set_codes = $mfeat->get_set_codes();
foreach my $set_code (@set_codes) {
print $mfeat->get_set->name(), "\n";
}
my $tiling_path_set = Bio::EnsEMBL::MiscSet->new(-CODE => 'tilingpath',
-NAME => 'tiling path set');
my $attrib1 = Bio::EnsEMBL::Attribute->new(-VALUE => 'RLX12451',
-CODE => 'name',
-NAME => 'name');
my $attrib2 = Bio::EnsEMBL::Attribute->new(-VALUE => '4',
-CODE => 'version',
-NAME => 'version');
my $attrib3 = Bio::EnsEMBL::Attribute->new(-VALUE => 'AL42131.4',
-CODE => 'synonym',
-NAME => 'synonym');
# can associate a misc feature with any number of sets
$mfeat->add_MiscSet($clone_set);
$mfeat->add_MiscSet($tiling_path_set);
# can add arbitrary attributes to a misc feature
$mfeat->add_Attribute($attrib1);
$mfeat->add_Attribute($attrib2);
$mfeat->add_Attribute($attrib3);
my ($name_attrib) = @{$mfeat->get_all_Attributes('name')};
my @all_attribs = @{$mfeat->get_all_Attributes()};
my @all_sets = @{$mfeat->get_all_MiscSets()};
my ($clone_set) = @{$mfeat->get_all_CloneSets('clone')};
# Can do normal feature operations as well
...
...
@@ -59,6 +73,9 @@ associations.
MiscFeatures are extremely general features with a location, and an
arbitrary group of attributes. They are grouped with other features of the
same 'type' through the use of MiscSets (see Bio::EnsEMBL::MiscSet).
Attributes are attached in the fom of Bio::EnsEMBL::Attribute objects.
See Bio::EnsEMBL::DBSQL::MiscFeatureAdaptor for ways to fetch or store
MiscFeatures.
=head1 CONTACT
...
...
@@ -84,6 +101,7 @@ use vars qw(@ISA);
@ISA
=
qw(Bio::EnsEMBL::Feature)
;
# new is inherited from superclass
sub
new_fast
{
...
...
@@ -94,25 +112,6 @@ sub new_fast {
=head2 add_attribute
Arg [1] : string $type
The type of attribute to add
Arg [2] : string $value
The value of the attribute to add
Example : $misc_feature->add_attribute('synonym', 'AL124141.1');
Description: Adds an attribute of a given type to this misc. feature
Returntype : none
Exceptions : throw if type arg is not provided
Caller : general
=cut
sub
add_attribute
{
throw
(
"
You need to make Attribute objects now, use add_Attribute
"
);
}
=head2 add_Attribute
Arg [1] : Bio::EnsEMBL::Attribute $attribute
...
...
@@ -136,23 +135,6 @@ sub add_Attribute {
}
=head2 add_set
Arg [1] : Bio::EnsEMBL::MiscSet $set
The set to add
Example : $misc_feature->add_set(Bio::EnsEMBL::MiscSet->new(...));
Description: Associates this MiscFeature with a given Set.
Returntype : none
Exceptions : throw if the set arg is not provided,
throw if the set to be added does not have a code
Caller : general
=cut
sub
add_set
{
throw
(
"
Use add_MiscSet instead.
"
);
}
=head2 add_MiscSet
...
...
@@ -183,25 +165,6 @@ sub add_MiscSet {
=head2 get_set
Arg [1] : optional string $code
The code of the set to retrieve
Example : $set = $misc_feature->get_set($code);
Description: Retrieves a set that this feature is associated with via its
code. Undef is returned if the feature is not associated with
the requested set.
Returntype : Bio::EnsEMBL::MiscSet or undef
Exceptions : throw if the code arg is not provided
Caller : general
=cut
sub
get_set
{
throw
(
"
Use get_MiscSets()
"
);
}
=head2 get_all_MiscSets
Arg [1] : optional string $code
...
...
@@ -230,23 +193,6 @@ sub get_all_MiscSets {
}
=head2 get_attribute
Arg [1] : string $type
The type of the attribute values to retrieve
Example : @values = $misc_feature->get_attribute('name');
Description: Retrieves a list of values for a particular attribute type
Returntype : list of strings
Exceptions : thrown if a type arg is not provided
Caller : general
=cut
sub
get_attribute
{
throw
(
"
Use get_Attributes now
"
);
}
=head2 get_all_Attributes
Arg [1] : optional string $code
...
...
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