my $obj = Bio::EnsEMBL::Pipeline::RunnableDB::Exonerate2Array->new(
-dbobj => $db,
-input_id => $id,
-analysis => $analysis
);
$obj->fetch_input();
$obj->run();
my @newfeatures = $obj->output();
$obj->write_output();
sub fetch_input
{ my( $self) = @_;
print STDERR "Fetching input\n ";
my $input_id = $self->input_id;
my $analysis = $self->analysis;
my $program = $analysis->program_file;
my $query_type = 'dna';
my $target_type = 'dna';
my $query_file = $ANALYSIS_INPUT_DIR.$input_id;
my $target_dir =$ANALYSIS_TARGET_DIR;
my $options = "--showalignment no --bestn 100 --dnahspthreshold 116 --fsmmemory 256 --dnawordlen 25 --dnawordthreshold 11 --querytype $query_type --targettype $target_type --target $target_dir --query " ;
my @query_seqs;
my $in = Bio::SeqIO->newFh(
-FILE => $query_file,
-FORMAT => 'Fasta',
);
while (my $seq = <$in>) {
push (@query_seqs, $seq);
}
throw("Can't run Exonerate without both query and target sequences")
unless (defined($query_file) && defined($target_dir));
info("exonerate is '$program', target_dir is $target_dir, query_file is $ query_file\n");
my $runnable = new Bio::EnsEMBL::Analysis::Runnable::ExonerateArray(
'-db' => $self->db,
'-query_seqs' =>\@ query_seqs,
'-program' => $program,
'-options' => $options,
'-analysis' => $self->analysis,
);
$self->runnable($runnable); } |
sub write_output
{
my($self) = @_;
my @misc_features = @{$self->output()};
my $mfa = $self->db->get_MiscFeatureAdaptor();
$mfa->store( @misc_features );
return 1;
}
1; } |
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _