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

RNAProduct: transcript() can now retrieve data from DB

parent 2414c08b
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
......@@ -404,8 +404,19 @@ sub transcript {
delete( $self->{'transcript'} );
} elsif (!defined($self->{'transcript'})) {
warn("Cannot retrieve transcript from DB yet");
my $adaptor = $self->{'adaptor'};
if (!defined($adaptor)) {
throw("Adaptor not set for rnaproduct, cannot fetch its transcript");
}
my $dbID = $self->{'dbID'};
if (!defined($dbID)) {
throw("dbID not set for rnaproduct, cannot fetch its transcript.");
}
$self->{'transcript'} =
$adaptor->db()->get_TranscriptAdaptor()
->fetch_by_rnaproduct_id($dbID);
# Do not weaken the reference if we had to get the transcript from the
# database. The user is probably working on rnaproducts directly,
......
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