my $dust = Bio::EnsEMBL::Analysis::Runnable::Dust->
new(
-query => $slice,
-program => 'tcdust',
);
$dust->run;
my @repeats = @{$dust->output};
sub new
{ my ($class,@args) = @_;
my $self = $class->SUPER::new(@args);
my ($level, $word_size, $window_size) = rearrange(['MASKING_THRESHOLD',
'WORD_SIZE',
'WINDOW_SIZE',
], @args);
$self->program('tcdust') if(!$self->program);
$self->level($level) if($level);
$self->word_size($word_size) if($word_size);
$self->window_size($window_size) if($window_size);
return $self;
}
} |
sub parse_results
{ my ($self, $results) = @_;
if(!$results){
$results = $self->resultsfile;
}
my $ff = $self->feature_factory;
my @output;
open(DUST, $results) or throw("FAILED to open ".$results);
LINE:while(<DUST>){
chomp;
next LINE if(/^>/);
if (/(\d+)\.\.(\d+)/) {
my ($start, $end) = ($1, $2);
$start++;
$end++;
my $rc = $ff->create_repeat_consensus('dust', 'dust', 'simple', 'N');
my $rf = $ff->create_repeat_feature($start, $end, 0, 0, $start,
$end, $rc, $self->query->name,
$self->query);
push(@output, $rf);
}
}
$self->output(\@output);
close(DUST) or throw("FAILED to close ".$results); } |
sub run_analysis
{ my ($self, $program) = @_;
if(!$program){
$program = $self->program;
}
throw($program." is not executable Dust::run_analysis ")
unless($program && -x $program);
my $command = $self->program;
$command .= " -l ".$self->level if($self->level);
$command .= " -k ".$self->word_size if($self->word_size);
$command .= " -w ".$self->window_size if($self->window_size);
$command .= " -x ".$self->queryfile." > ".$self->resultsfile;
print "Running analysis ".$command."\n";
system($command) == 0 or throw("FAILED to run ".$command); } |
Arg [1] : Bio::EnsEMBL::Analysis::Runnable::Dust
Arg [2] : int for specified value (for more info see tcdust)
Function : container for specified variable. This pod refers to the
three methods below level, window size and word size. These are simple
containers which dont do more than hold and return an given value
nothing is defined
Returntype: int
Exceptions:
Example :