ensembl-hive  2.8.1
MiscSet.pm
Go to the documentation of this file.
1 =head1 LICENSE
2 
3 See the NOTICE file distributed with this work for additional information
4 regarding copyright ownership.
5 
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 
18 =cut
19 
20 
21 =head1 CONTACT
22 
23  Please email comments or questions to the public Ensembl
24  developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.
25 
26  Questions may also be sent to the Ensembl help desk at
27  <http://www.ensembl.org/Help/Contact>.
28 
29 =cut
30 
31 =head1 NAME
32 
33 Bio::EnsEMBL::MiscSet - This is a set representing a classification of
34 a group of miscellaneuos features.
35 
36 =head1 SYNOPSIS
37 
39 
40  my $misc_set = Bio::EnsEMBL::MiscSet->new(
41  1234, $adaptor, 'tilepath',
42  'Assembly Tiling Path',
43  'The tiling path of clones', 1e6
44  );
45 
46  my $misc_feature->add_set($misc_set);
47 
48 =head1 DESCRIPTION
49 
50 MiscSets represent classsifications or groupings of MiscFeatures.
51 Features are classified into sets essentially to define what they are
52 and how they may be used. Generally MiscFeatures are retrieved on
53 the basis of their associated sets. See Bio::EnsEMBL::MiscFeature,
55 
56 Note that MiscSets and MiscFeatures were formerly known as MapSets and
57 MapFrags
58 
59 =head1 METHODS
60 
61 =cut
62 
63 package Bio::EnsEMBL::MiscSet;
64 
65 use strict;
66 
68 use Bio::EnsEMBL::Utils::Argument qw(rearrange);
69 
70 use vars qw(@ISA);
71 
72 @ISA = qw(Bio::EnsEMBL::Storable);
73 
74 
75 =head2 new
76 
77  Arg [1] : int $misc_set_id
78  The internal identifier for this misc set
79  Arg [2] : string $code
80  The unique code which identifies this set type
81  Arg [3] : string $name
82  The human readable name of this set
83  Arg [4] : string $desc
84  The description of this set
85  Arg [5] : int $max_len
86  The maximum length of features of this mapset
87  Example : $set = new Bio::EnsEMBL::MiscSet(1234, 'tilepath',
88  'Assembly Tiling Path',
89  'The tiling path of clones',
90  1e6);
91  Description: Instantiates a Bio::EnsEMBL::MiscSet
92  Returntype : Bio::EnsEMBL::MiscSet
93  Exceptions : none
94  Caller : MiscFeatureAdaptor
95  Status : Stable
96 
97 =cut
98 
99 sub new {
100  my $caller = shift;
101 
102  my $class = ref($caller) || $caller;
103 
104  my $self = $class->SUPER::new(@_);
105 
106  my($code, $name, $desc, $max_len) =
107  rearrange([qw(CODE NAME DESCRIPTION LONGEST_FEATURE)], @_);
108 
109  $self->{'code'} = $code;
110  $self->{'name'} = $name;
111  $self->{'description'} = $desc;
112  $self->{'longest_feature'} = $max_len;
113 
114  return $self;
115 }
116 
117 =head2 code
118 
119  Arg [1] : string $newval (optional)
120  The new value to set the code attribute to
121  Example : $code = $obj->code()
122  Description: Getter/Setter for the code attribute
123  Returntype : string
124  Exceptions : none
125  Caller : general
126  Status : Stable
127 
128 =cut
129 
130 sub code{
131  my $self = shift;
132  $self->{'code'} = shift if(@_);
133  return $self->{'code'};
134 }
135 
136 
137 =head2 name
138 
139  Arg [1] : string $newval (optional)
140  The new value to set the code attribute to
141  Example : $name = $obj->name()
142  Description: Getter/Setter for the name attribute
143  Returntype : string
144  Exceptions : none
145  Caller : general
146  Status : Stable
147 
148 =cut
149 
150 sub name {
151  my $self = shift;
152  $self->{'name'} = shift if(@_);
153  return $self->{'name'};
154 }
155 
156 
157 =head2 description
158 
159  Arg [1] : string $newval (optional)
160  The new value to set the description attribute to
161  Example : $description = $obj->description()
162  Description: Getter/Setter for the description attribute
163  Returntype : string
164  Exceptions : none
165  Caller : general
166  Status : Stable
167 
168 =cut
169 
170 sub description{
171  my $self = shift;
172  $self->{'description'} = shift if(@_);
173  return $self->{'description'};
174 }
175 
176 
177 =head2 longest_feature
178 
179  Arg [1] : int $newval (optional)
180  The new value to set the longest_feature attribute to
181  Example : $longest_feature = $obj->longest_feature()
182  Description: Getter/Setter for the longest_feature attribute
183  Returntype : int
184  Exceptions : none
185  Caller : general
186  Status : Stable
187 
188 =cut
189 
190 sub longest_feature{
191  my $self = shift;
192  $self->{'longest_feature'} = shift if(@_);
193  return $self->{'longest_feature'};
194 }
195 
196 
197 1;
Bio::EnsEMBL::DBSQL::MiscFeatureAdaptor
Definition: MiscFeatureAdaptor.pm:40
Bio::EnsEMBL::MiscSet
Definition: MiscSet.pm:31
Bio::EnsEMBL::MiscFeature
Definition: MiscFeature.pm:86
Bio::EnsEMBL::Storable
Definition: Storable.pm:23
Bio::EnsEMBL::MiscSet::new
public Bio::EnsEMBL::MiscSet new()
Bio::EnsEMBL::Utils::Argument
Definition: Argument.pm:34