Commit 8b4b7967 authored by Marek Szuba's avatar Marek Szuba
Browse files

MicroRNA: having multiple mirna_arms in the DB is now fatal

On the one hand there seems to be no good reason for a MicroRNA object
having multiple arm attributes, on the other hand simply taking the
first one in the event of it happening may not even return the same
value every time (it depends on a lot of factors, from the
implementation details of AttributeAdaptor up to and including the
underlying database system). There was a warning but who reads those
anyway. Just throw an exception instead, if someone decides to allow
such a case they can always catch it.
parent 50fdfcee
......@@ -115,8 +115,8 @@ sub new { ## no critic (Subroutines::RequireArgUnpacking)
from. Accepted values are 3 and 5 for 3' and 5',
respectively.
Return type : Integer
Exceptions : throw if setter is passed an incorrect value;
warn if multiple 'mirna_arm' attributes exist.
Exceptions : throw if setter is passed an incorrect value
or if multiple 'mirna_arm' attributes exist.
Caller : General
Status : Stable
......@@ -133,8 +133,8 @@ sub arm {
my $n_arms = scalar @{$arm_attrs};
if ($n_arms > 0) {
if ($n_arms > 1) {
warning("MicroRNA " . $self->display_id() .
" has multiple arm attributes, using first");
throw("MicroRNA " . $self->display_id() .
" has multiple arm attributes");
}
$self->{'arm'} = $arm_attrs->[0]->value();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment