Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl
Commits
a7f99bd9
Commit
a7f99bd9
authored
Aug 10, 2018
by
Marek Szuba
Browse files
Transcript: get_all_RNAProducts() now uses type codes instead of IDs
parent
5b7fb4a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
modules/Bio/EnsEMBL/Transcript.pm
modules/Bio/EnsEMBL/Transcript.pm
+6
-8
modules/t/transcript.t
modules/t/transcript.t
+2
-2
No files found.
modules/Bio/EnsEMBL/Transcript.pm
View file @
a7f99bd9
...
...
@@ -3005,13 +3005,11 @@ sub get_all_DAS_Features {
=head2 get_all_RNAProducts
Arg [1] : optional int $type_id
The numerical ID of the rnaproduct type to retrieve values for.
FIXME: this should definitely take string codes instead.
Example : @transc_mirnas = @{$transcript->get_all_RNAProducts(1)};
Arg [1] : optional string $type_code type of rnaproducts to retrieve
Example : @transc_mirnas = @{$transcript->get_all_RNAProducts('miRNA')};
@transc_rnaproducts = @{$transcript->get_all_RNAProducts()};
Description: Gets a list of RNAProducts of this transcript.
Optionally just get RNAProducts for given type
ID
.
Optionally just get RNAProducts for given type
code
.
Returntype : listref Bio::EnsEMBL::RNAProduct
Exceptions : none
Caller : general
...
...
@@ -3020,7 +3018,7 @@ sub get_all_DAS_Features {
=cut
sub
get_all_RNAProducts
{
my
(
$self
,
$type_
id
)
=
@_
;
my
(
$self
,
$type_
code
)
=
@_
;
if
(
!
exists
$self
->
{'
rnaproducts
'})
{
if
(
!
$self
->
adaptor
())
{
...
...
@@ -3031,8 +3029,8 @@ sub get_all_RNAProducts {
$self
->
{'
rnaproducts
'}
=
$rnaproduct_adaptor
->
fetch_all_by_Transcript
(
$self
);
}
if
(
defined
$type_
id
)
{
my
@results
=
grep
{
$_
->
type_
id
()
==
$type_
id
}
@
{
$self
->
{'
rnaproducts
'}};
if
(
defined
$type_
code
)
{
my
@results
=
grep
{
$_
->
type_
code
()
eq
$type_
code
}
@
{
$self
->
{'
rnaproducts
'}};
return
\
@results
;
}
else
{
return
$self
->
{'
rnaproducts
'};
...
...
modules/t/transcript.t
View file @
a7f99bd9
...
...
@@ -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
(
2
);
my
$rps_circ
=
$tr
->
get_all_RNAProducts
(
3
);
my
$rps_micro
=
$tr
->
get_all_RNAProducts
(
'
miRNA
'
);
my
$rps_circ
=
$tr
->
get_all_RNAProducts
(
'
circRNA
'
);
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