Skip to content
Snippets Groups Projects
Commit cffc4712 authored by Marek Szuba's avatar Marek Szuba
Browse files

RNAProduct: implement basic type_id support

parent db7f244b
No related branches found
No related tags found
2 merge requests!371Add support for mature RNA products of transcripts (e.g. MicroRNA) to the API and schema,!371Add support for mature RNA products of transcripts (e.g. MicroRNA) to the API and schema
......@@ -101,6 +101,12 @@ sub new { ## no critic (Subroutines::RequireArgUnpacking)
my $class = ref($caller) || $caller;
# For an unspecialised rnaproduct object, set the type to "generic mature
# 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 ($seq_start, $seq_end, $stable_id, $version, $dbID, $adaptor, $seq,
$created_date, $modified_date ) =
rearrange(["SEQ_START", "SEQ_END", "STABLE_ID", "VERSION", "DBID",
......@@ -120,7 +126,8 @@ sub new { ## no critic (Subroutines::RequireArgUnpacking)
'dbID' => $dbID,
'seq' => $seq,
'created_date' => $created_date,
'modified_date' => $modified_date
'modified_date' => $modified_date,
'type_id' => $type_id
}, $class;
$self->adaptor($adaptor);
......@@ -802,6 +809,27 @@ sub transcript {
}
=head2 type_id
Example : my $rp_type_id = $rnaproduct->type();
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
implemented this way because at this point it hasn't been
decided whether we need to expose this to users at all.
Returntype : int
Exceptions : none
Caller : ?
Status : In Development
=cut
sub type_id {
my $self = shift;
return $self->{'type_id'};
}
=head2 version
Arg [1] : (optional) string $version - version to set
......
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