Bio::EnsEMBL::Analysis::RunnableDB::Finished TRF
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::Analysis::RunnableDB::Finished::TRF
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Analysis::Config::General
Bio::EnsEMBL::Analysis::Runnable::TRF
Bio::EnsEMBL::Analysis::RunnableDB::Finished
Bio::EnsEMBL::Utils::Exception qw ( verbose throw warning )
Inherit
Bio::EnsEMBL::Analysis::RunnableDB::Finished
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
fetch_inputDescriptionCode
write_output
No description
Code
Methods description
fetch_inputcode    nextTop
Methods code
fetch_inputdescriptionprevnextTop
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;
}
write_outputdescriptionprevnextTop
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
CONTACTTop
Refactored by Sindhu K. Pillai sp1@sanger.ac.uk
APPENDIXTop
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _