From 67a1f343adfeffb8bc93c85c9173a304838c94d5 Mon Sep 17 00:00:00 2001 From: Jan-Hinnerk Vogel <jhv@sanger.ac.uk> Date: Fri, 13 Mar 2009 15:18:23 +0000 Subject: [PATCH] Method analysis->data added to retrieve data for an alysis object out of the analysis_data table using the analysisDataAdaptor. --- modules/Bio/EnsEMBL/Hive/Extensions.pm | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/modules/Bio/EnsEMBL/Hive/Extensions.pm b/modules/Bio/EnsEMBL/Hive/Extensions.pm index 8699b46c4..27a4ae6ae 100755 --- a/modules/Bio/EnsEMBL/Hive/Extensions.pm +++ b/modules/Bio/EnsEMBL/Hive/Extensions.pm @@ -193,6 +193,35 @@ sub Bio::EnsEMBL::Analysis::stats return $stats; } +=head2 Bio::EnsEMBL::Analysis::data + + Arg [1] : none + Example : $stats = $analysis->data; + Description: returns the analysis data associated with this Analysis + object. The data is stored in the analysis_data table. + Does not cache, but pull from database by using the + Analysis objects adaptor->db. + Returntype : String + Exceptions : none + Caller : general + +=cut + +sub Bio::EnsEMBL::Analysis::data +{ + my $self = shift; + my $data = ""; + + my $analysis_data_id = eval($self->parameters)->{'analysis_data_id'}; + unless ( $analysis_data_id) { + warning( " analysis_data_id undefined for analysis " .$self->logic_name. " in analysis_data table.") ; + }else { + $data = $self->adaptor->db->get_AnalysisDataAdaptor->fetch_by_dbID($analysis_data_id) ; + } + return $data; +} + + ####################################### # extensions to # Bio::EnsEMBL::Pipeline::RunnableDB -- GitLab