Bio::EnsEMBL::Analysis::Runnable Dust
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::Analysis::Runnable::Dust
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Analysis::Runnable
Bio::EnsEMBL::Utils::Argument qw ( rearrange )
Bio::EnsEMBL::Utils::Exception qw ( throw warning )
Inherit
Bio::EnsEMBL::Analysis::Runnable
Synopsis
  my $dust = Bio::EnsEMBL::Analysis::Runnable::Dust->
new(
-query => $slice,
-program => 'tcdust',
);
$dust->run;
my @repeats = @{$dust->output};
Description
Dust is a wrapper for the tcdust program which runs the dust algorithm
to identify and mask simple repeats
Methods
level
No description
Code
newDescriptionCode
parse_resultsDescriptionCode
run_analysisDescriptionCode
window_size
No description
Code
word_size
No description
Code
Methods description
newcode    nextTop
  Arg [1]   : Bio::EnsEMBL::Analysis::Runnable::Dust
Arg [2] : int, masking threshold
Arg [3] : int, word size
Arg [4] : int, window size
Function : create a new Bio::EnsEMBL::Analysis::Runnable::Dust
Returntype: Bio::EnsEMBL::Analysis::Runnable::Dust
Exceptions:
Example :
parse_resultscodeprevnextTop
  Arg [1]   : Bio::EnsEMBL::Analysis::Runnable::Dust
Arg [2] : string, filename
Function : open and parse the results file into repeat
features
Returntype: none
Exceptions: throws on failure to open or close output file
Example :
run_analysiscodeprevnextTop
  Arg [1]   : Bio::EnsEMBL::Analysis::Runnable::Dust
Arg [2] : string, program name
Function : constructs a commandline and runs the program passed
in, the generic method in Runnable isnt used as Dust doesnt
fit this module
Returntype: none
Exceptions: throws if run failed because system doesnt
return 0
Example :
Methods code
leveldescriptionprevnextTop
sub level {
  my $self = shift;
  $self->{'min_length'} = shift if(@_);
  return $self->{'min_length'};
}
newdescriptionprevnextTop
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);
  ##################
#SETTING DEFAULTS#
##################
$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; } #container methods
}
parse_resultsdescriptionprevnextTop
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);
}
run_analysisdescriptionprevnextTop
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);
}
window_sizedescriptionprevnextTop
sub window_size {
  my $self = shift;
  $self->{'min_gc_content'} = shift if(@_);
  return $self->{'min_gc_content'};
}
word_sizedescriptionprevnextTop
sub word_size {
  my $self = shift;
  $self->{'min_oe'} = shift if(@_);
  return $self->{'min_oe'};
}



#utility methods
}
General documentation
CONTACTTop
Post questions to the Ensembl development list: ensembl-dev@ebi.ac.uk
containersTop
  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 :