Bio::EnsEMBL::Analysis::RunnableDB::Finished
TRF
Toolbar
Summary
Bio::EnsEMBL::Analysis::RunnableDB::Finished::TRF
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
my $db = Bio::EnsEMBL::DBLoader->new($locator);
my $trf = Bio::EnsEMBL::Analysis::RunnableDB::TRF->new(
-dbobj => $db,
-input_id => $input_id
-analysis => $analysis
);
$trf->fetch_input();
$trf->run();
$trf->output();
$trf->write_output(); #writes to DB
Description
This object wraps Bio::EnsEMBL::Analysis::Runnable::TRF to add
functionality to read and write to databases. The appropriate
Bio::EnsEMBL::Analysis object must be passed for extraction of
parameters. A Bio::EnsEMBL::Pipeline::DBSQL::Obj is required
for database access.
Methods
Methods description
Methods code
sub fetch_input
{
my( $self) = @_;
throw("No input id") unless defined($self->input_id);
my $sliceid = $self->input_id;
my $sa = $self->db->get_SliceAdaptor();
my $slice = $sa->fetch_by_name($sliceid);
$slice->{'seq'}=$slice->seq();
my %parameters = %{$self->parameters_hash};
$parameters{-trf} = $self->analysis->program_file || undef;
$parameters{-query} = $slice->get_repeatmasked_seq($ANALYSIS_RM_TRF,$SOFT_MASKING) or throw("Unable to fetch slice");
$parameters{-analysis} = $self->analysis;
my $runnable = new Bio::EnsEMBL::Analysis::Runnable::TRF(%parameters);
$self->runnable($runnable);
return 1; } |
sub write_output
{
my ($self) = @_;
my @features = @{$self->output()->[0]};
my $repeat_f_a = $self->db->get_RepeatFeatureAdaptor();
my $slice;
eval {
$slice = $self->db->get_SliceAdaptor->fetch_by_name($self->input_id);
};
if ($@) {
print STDERR "Slice not found, skipping writing output to db: $@\n";
}
foreach my $f(@features){
$f->analysis($self->analysis);
$f->slice($slice);
$repeat_f_a->store($f);
}
}
1; } |
General documentation
Refactored by Sindhu K. Pillai sp1@sanger.ac.uk
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _