my $runnable = Bio::EnsEMBL::Analysis::Runnable::CPG->new
(
-query => $slice,
-program => 'cpg',
);
$runnable->run;
my @simple_features = @{$runnable->output};
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);
$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; } |
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+/){ 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; } |
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 :