Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
bc9cf2c6
Commit
bc9cf2c6
authored
Jul 25, 2018
by
Marek Szuba
Browse files
RNAProduct + MicroRNA: increment hardcoded type_ids, AUTO_INCREMENT does not like zeros
parent
6e5ec76e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
modules/Bio/EnsEMBL/DBSQL/RNAProductAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/RNAProductAdaptor.pm
+2
-2
modules/Bio/EnsEMBL/MicroRNA.pm
modules/Bio/EnsEMBL/MicroRNA.pm
+1
-1
modules/Bio/EnsEMBL/RNAProduct.pm
modules/Bio/EnsEMBL/RNAProduct.pm
+2
-2
modules/t/rnaProduct.t
modules/t/rnaProduct.t
+5
-5
modules/t/transcript.t
modules/t/transcript.t
+2
-2
No files found.
modules/Bio/EnsEMBL/DBSQL/RNAProductAdaptor.pm
View file @
bc9cf2c6
...
...
@@ -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
");
...
...
modules/Bio/EnsEMBL/MicroRNA.pm
View file @
bc9cf2c6
...
...
@@ -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
;
...
...
modules/Bio/EnsEMBL/RNAProduct.pm
View file @
bc9cf2c6
...
...
@@ -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
...
...
modules/t/rnaProduct.t
View file @
bc9cf2c6
...
...
@@ -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
...
...
modules/t/transcript.t
View file @
bc9cf2c6
...
...
@@ -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
');
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment