3 See the NOTICE file distributed with
this work
for additional information
4 regarding copyright ownership.
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
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.
23 Please email comments or questions to the
public Ensembl
24 developers list at <http:
26 Questions may also be sent to the Ensembl help desk at
39 MicroRNAs. Mostly takes care of wrapping miRNA-specific
RNAProduct
40 attributes in methods which make them look like ordinary
class
53 # Get start and end position in the precursor transcript
54 my $start = $miR->start();
55 my $end = $miR->end();
60 package Bio::EnsEMBL::MicroRNA;
62 use vars qw($AUTOLOAD);
69 use Scalar::Util qw(weaken);
78 Arg: [-ARM] : which arm of the hairpin precursor
this miRNA comes
79 from. Returns 3 and 5
for 3
' and 5', respectively.
80 Arg [...] : Named arguments to superclass constructor
87 Description: Constructor. Creates a
new MicroRNA object
89 Exceptions :
throw if ARM value is out of bounds
91 Status : In Development
95 # perlcritic doesn't know about rearrange(), silence it
96 sub
new { ## no critic (Subroutines::RequireArgUnpacking)
99 my $class = ref($caller) || $caller;
101 my $self = $class->SUPER::new(@_);
103 my ($arm) = rearrange([
"ARM"], @_);
105 _validate_arm_value($arm);
107 $self->{
'arm'} = $arm;
115 Arg [1] : (optional)
int $arm which arm of the hairpin precursor
116 this miRNA comes from
117 Example : $mirna_arm = $mirna->arm();
119 Description : Sets or returns the arm of the hairpin
this miRNA comes
120 from. Accepted values are 3 and 5
for 3
' and 5',
122 Return type : Integer
123 Exceptions :
throw if setter is passed an incorrect value
124 or
if multiple
'mirna_arm' attributes exist.
131 my ($self, $arm) = @_;
134 _validate_arm_value($arm);
135 $self->{
'arm'} = $arm;
136 } elsif (!defined($self->{
'arm'})) {
137 my $arm_attrs = $self->get_all_Attributes(
'mirna_arm');
138 my $n_arms = scalar @{$arm_attrs};
141 throw(
"MicroRNA " . $self->display_id() .
142 " has multiple arm attributes");
144 $self->{
'arm'} = $arm_attrs->[0]->value();
148 return $self->{
'arm'};
152 =head2 summary_as_hash
154 Example : $mirna_summary = $mirna->summary_as_hash();
155 Description : Retrieves a textual summary of
this MicroRNA.
156 Built on top of
generic implementation in RNAProduct.
157 Returns : hashref of arrays of descriptive strings
158 Status : Intended
for internal use
162 sub summary_as_hash {
165 my $summary = SUPER::summary_as_hash();
166 $summary->{
'arm'} = $self->arm();
172 =head2 _validate_arm_value
173 Arg [1] :
int $arm which arm of the hairpin precursor
this miRNA
175 Description: PRIVATE validates
if its argument has one of the accepted
176 values
for specifying the miRNA hairpin arm.
178 Exceptions :
throw if the argument is out of bounds
184 sub _validate_arm_value {
187 if (($arm != 3) && ($arm != 5)) {
188 throw(
"'$arm' is not a valid miRNA hairpin-arm specification");