my $runnable = Bio::EnsEMBL::Analysis::Runnable::tRNAscan_SE->new
(
-query => $slice,
-program => 'trnascan-SE',
);
$runnable->run;
my @simple_features = @{$runnable->output};
sub new
{ my ($class,@args) = @_;
my $self = $class->SUPER::new(@args);
if(!$self->options){
$self->options('-q');
}
if(!$self->program){
$self->program('tRNAscan-SE');
}
return $self; } |
sub parse_results
{ my ($self, $results) = @_;
if(!$results){
$results = $self->resultsfile;
}
if(!-e $results){
throw("Can't parse an no existance results file ".$results.
" tRNAscan_SE:parse_results");
}
my $ff = $self->feature_factory;
my @output;
open(CPG, $results) or throw("FAILED to open ".$results.
" tRNAscan_SE:parse_results");
LINE:while(<CPG>){
next LINE if(/^Sequence/ ||/^Name/ || /^---/);
my @element = split (/\s+/, $_);
my ($name, $start, $end, $display_label, $score)
= @element[0, 2, 3, 4, 8];
my $strand = 1;
if($start > $end){
$strand = -1;
my $temp_end = $start;
$start = $end;
$end = $temp_end;
}
my $sf = $ff->create_simple_feature($start, $end, $strand, $score,
$display_label,
$name, $self->query);
push(@output, $sf)
}
$self->output(\@output);
close(CPG) or throw("FAILED to close ".$results.
" tRNAscan_SE:parse_results");
}
1; } |