Bio::EnsEMBL::Analysis::Runnable CPG
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvsRaw content
Summary
Bio::EnsEMBL::Analysis::Runnable::CPG
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 $runnable = Bio::EnsEMBL::Analysis::Runnable::CPG->new
(
-query => $slice,
-program => 'cpg',
);
$runnable->run;
my @simple_features = @{$runnable->output};
Description
CPG expects to run the program cpg and produces SimpleFeature which can be
stored in the simple_feature table in the core database
Methods
min_gc_content
No description
Code
min_length
No description
Code
min_oe
No description
Code
newDescriptionCode
parse_resultsDescriptionCode
Methods description
newcode    nextTop
  Arg [1]   : Bio::EnsEMBL::Analysis::Runnable::CPG
Arg [2] : int, minimun length of hit
Arg [3] : int, minimun gc content of hit
Arg [4] : int, minimum oe of hit
Function : create a Bio::EnsEMBL::Analysis::Runnable::CPG
Returntype: Bio::EnsEMBL::Analysis::Runnable::CPG
Exceptions: none
Example :
parse_resultscodeprevnextTop
  Arg [1]   : Bio::EnsEMBL::Analysis::Runnable::CPG
Arg [2] : string, filename
Function : to open and parse the results file
Returntype: none
Exceptions: throws on failure to open or close the results file
or if the results file doesnt exist
Example :
Methods code
min_gc_contentdescriptionprevnextTop
sub min_gc_content {
  my $self = shift;
  $self->{'min_gc_content'} = shift if(@_);
  return $self->{'min_gc_content'};
}
min_lengthdescriptionprevnextTop
sub min_length {
  my $self = shift;
  $self->{'min_length'} = shift if(@_);
  return $self->{'min_length'};
}
min_oedescriptionprevnextTop
sub min_oe {
  my $self = shift;
  $self->{'min_oe'} = shift if(@_);
  return $self->{'min_oe'};
}
newdescriptionprevnextTop
sub new {
  my ($class,@args) = @_;
  my $self = $class->SUPER::new(@args);

  my ($min_length, $min_gc, $min_oe) = rearrange(['MIN_LENGTH',
                                                  'MIN_GC_CONTENT',
                                                  'MIN_OE',
                                                 ], @args);
  ##################
#SETTING DEFAULTS#
##################
$self->program('cpg') if(!$self->program); $self->min_length(400); $self->min_gc_content(50); $self->min_oe(0.6); #################
$self->min_length($min_length) if($min_length); $self->min_gc_content($min_gc) if($min_gc); $self->min_oe($min_oe) if($min_oe); return $self;
}
parse_resultsdescriptionprevnextTop
sub parse_results {
  my ($self, $results) = @_;

  if(!$results){
    $results = $self->resultsfile;
  }
  my $ff = $self->feature_factory;
  if(!-e $results){
    throw("Can't parse an no existance results file ".$results.
          " CPG:parse_results");
  }
  my @output;
  open(CPG, $results) or throw("FAILED to open ".$results.
                               " CPG:parse_results");
  LINE:while(<CPG>){
    if (/\d+/){ #ignore introductory lines
chomp; my @elements = split; my ($name, $start, $end, $score, $gc_content, $oe) = @elements[0, 1, 2, 3, 6, 7]; if($oe eq "-"){ $oe = 0; } my $length = $end - $start + 1; next LINE unless($length >= $self->min_length && $gc_content >= $self->min_gc_content && $oe >= $self->min_oe); my $sf = $ff->create_simple_feature($start, $end, 0, $score, "oe = $oe", $name, $self->query); push(@output, $sf); } } $self->output(\@output); close(CPG) or throw("FAILED to close ".$results. " CPG:parse_results"); } 1;
}
General documentation
CONTACTTop
Post questions to the Ensembl development list: ensembl-dev@ebi.ac.uk
containersTop
  Arg [1]   : Bio::EnsEMBL::Analysis::Runnable::CPG
Arg [2] : int, minimun value
Function : container for specified variable. This pod refers to the
three methods below min_length, min_gc_content, min_oe. These are simple
containers which dont do more than hold and return an given value
nothing is defined
Returntype: int
Exceptions:
Example :