Module which inherits from StateInfoContainer and overrides specific methods to implement the incremental
updating of the Blast analysis used in the Finished Pipeline.
sub fetch_analysis_by_input_id
{ my ( $self, $inputId ) = @_;
my @result;
my @row;
my $anaAd = $self->db->get_AnalysisAdaptor();
my $sth = $self->prepare(
q{ SELECT analysis_id , db_version FROM input_id_analysis WHERE input_id = ? }
);
$sth->execute($inputId);
while ( my $row = $sth->fetchrow_arrayref ) {
my $analysis = $anaAd->fetch_by_dbID( $row->[0] );
my $version = $row->[1];
next unless ($analysis);
if ( !$version
|| $analysis->logic_name =~ /Halfwise/
|| $analysis->db_version eq $version )
{
push( @result, $analysis );
}
else {
}
}
return\@ result; } |
sub fetch_db_version
{ my ( $self, $inputId, $analysis) = @_;
my $db_version = '';
throw("[$analysis] is not a Bio::EnsEMBL::Pipeline::Analysis object")
unless $analysis->isa("Bio::EnsEMBL::Pipeline::Analysis");
my $sth = $self->prepare(
q { SELECT db_version FROM input_id_analysis WHERE input_id = ? AND analysis_id = ? }
);
$sth->execute($inputId,$analysis->dbID);
while ( my $row = $sth->fetchrow_arrayref ) {
$db_version = $row->[0];
}
return $db_version; } |
sub store_input_id_analysis
{ my ( $self, $inputId, $analysis, $host, $is_dbversion_saved, $run_time ) =
@_;
throw("[$analysis] is not a Bio::EnsEMBL::Pipeline::Analysis object")
unless $analysis->isa("Bio::EnsEMBL::Pipeline::Analysis");
throw("Invalid inputId [$inputId]")
unless $inputId;
throw("No type defined in analysis obj")
unless defined( $analysis->input_id_type );
if ( defined($run_time) ) {
my $db_version = $is_dbversion_saved ? $analysis->db_version : 0;
my $sth = $self->prepare(
qq{
REPLACE INTO input_id_analysis
(input_id, input_id_type, analysis_id, created, runhost, db_version , result)
values (?, ?, ?, now(), ?, ? , ?)
}
);
$sth->execute( $inputId, $analysis->input_id_type, $analysis->dbID,
$host, $db_version, $run_time );
}
else {
my $db_version = $is_dbversion_saved ? $analysis->db_version : 0;
my $sth = $self->prepare(
qq{
REPLACE INTO input_id_analysis
(input_id, input_id_type, analysis_id, created, runhost, db_version)
values (?, ?, ?, now(), ?, ?)
}
);
$sth->execute( $inputId, $analysis->input_id_type, $analysis->dbID,
$host, $db_version );
}
}
1; } |
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _