Commit bc9cf2c6 authored by Marek Szuba's avatar Marek Szuba
Browse files

RNAProduct + MicroRNA: increment hardcoded type_ids, AUTO_INCREMENT does not like zeros

parent 6e5ec76e
......@@ -332,9 +332,9 @@ sub _fetch_direct_query {
my $class_name;
# FIXME: the usual thing about using type_id directly
if ($rnaproduct_type_id == 0) {
if ($rnaproduct_type_id == 1) {
$class_name = 'Bio::EnsEMBL::RNAProduct';
} elsif ($rnaproduct_type_id == 1) {
} elsif ($rnaproduct_type_id == 2) {
$class_name = 'Bio::EnsEMBL::MicroRNA';
} else {
throw("Unknown rnaproduct type");
......
......@@ -109,7 +109,7 @@ sub new { ## no critic (Subroutines::RequireArgUnpacking)
my $self = $class->SUPER::new(@_);
# FIXME: see the comment about same in RNAProduct::new()
my $type_id = 1;
my $type_id = 2;
my ($arm) = rearrange(["ARM"], @_);
$self->{'arm'} = $arm;
......
......@@ -105,7 +105,7 @@ sub new { ## no critic (Subroutines::RequireArgUnpacking)
# RNA". Ideally we would look the corresponding ID up in rnaproduct_type,
# then again that would make this dependent on the database connection...
# Maybe we should just store a string code instead? Either way, FIXME.
my $type_id = 0;
my $type_id = 1;
my ($seq_start, $seq_end, $stable_id, $version, $dbID, $adaptor, $seq,
$created_date, $modified_date ) =
......@@ -811,7 +811,7 @@ sub transcript {
=head2 type_id
Example : my $rp_type_id = $rnaproduct->type();
Example : my $rp_type_id = $rnaproduct->type_id();
Description: Getter for the RNAProduct type (e.g. miRNA, circRNA, ...).
The type is expressed as a numerical ID and it is up to the
user to look the details up in rnaproduct_type; it has been
......
......@@ -85,7 +85,7 @@ ok(test_getter_setter($rp, 'created_date', time()), 'Test getter/setter created_
ok(test_getter_setter($rp, 'modified_date', time()), 'Test getter/setter modified_date()');
# FIXME: temporary, at least this way
is($rp->type_id(), 0, 'type_id is zero (i.e. generic mature RNA)');
is($rp->type_id(), 1, 'type_id is 1 (i.e. generic mature RNA)');
subtest 'Test stable_id_version() functionality' => sub {
ok(test_getter_setter($rp, 'stable_id_version', 3.14),
......@@ -197,10 +197,10 @@ subtest 'fetch_all_by_type_id() functionality' => sub {
# At the moment we have only got miRNA in the homo_sapiens test database
# FIXME: compare this to the total number of RNAProducts?
$n_rps = scalar @{$rp_a->fetch_all_by_type_id(1)};
cmp_ok($n_rps, '>', 0, 'Got non-empty list of type_id==1 rnaproducts');
$n_rps = scalar @{$rp_a->fetch_all_by_type_id(2)};
cmp_ok($n_rps, '==', 0, 'Got empty list of type_id==2 rnaproducts');
cmp_ok($n_rps, '>', 0, 'Got non-empty list of type_id==2 rnaproducts');
$n_rps = scalar @{$rp_a->fetch_all_by_type_id(3)};
cmp_ok($n_rps, '==', 0, 'Got empty list of type_id==3 rnaproducts');
};
$rp = undef;
......@@ -212,7 +212,7 @@ $rp = $rp_a->fetch_by_stable_id('ENSM00000000001');
ok($rp, 'Can fetch RNAProduct by stable ID');
# FIXME: temporary, at least this way
is($rp->type_id(), 1, 'type_id is 1 (i.e. miRNA)');
is($rp->type_id(), 2, 'type_id is 2 (i.e. miRNA)');
# FIXME: perform an in-depth inspection of one of the fetched RNAProducts,
# to make sure new_fast() call all of these fetch methods use does what it
......
......@@ -1032,8 +1032,8 @@ for (my $i = 0; $i < scalar(@absolute_coords); $i++) {
{
$tr = $ta->fetch_by_stable_id('ENST00000278995');
my $rps_all = $tr->get_all_RNAProducts();
my $rps_micro = $tr->get_all_RNAProducts(1);
my $rps_circ = $tr->get_all_RNAProducts(2);
my $rps_micro = $tr->get_all_RNAProducts(2);
my $rps_circ = $tr->get_all_RNAProducts(3);
cmp_ok(scalar @{$rps_all}, '>', 0, 'Have RNA products');
is_deeply($rps_all, $rps_micro, 'All RNA products are microRNAs');
......
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