Bio::EnsEMBL::Analysis::Runnable::Funcgen
MAT
Toolbar
Summary
Bio::EnsEMBL::Analysis::Runnable::Funcgen::MAT
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
my $runnable = Bio::EnsEMBL::Analysis::Runnable::Funcgen::MAT->new
(
-analysis => $analysis,
-query => 'slice',
-program => 'program.pl',
);
$runnable->run;
my @features = @{$runnable->output};
Description
MAT expects to run the program MAT (Model-based Analysis of Tiling-array, Johnson
et al., PMID: 16895995) and predicts features which can be stored in the
annotated_feature table in the eFG database
Methods
Methods description
Arg [1] : Bio::EnsEMBL::Analysis::Runnable::MAT Arg [2] : filename (string) Description : will hold a given filename or if one is requested but none defined it will use the create_filename method to create a filename Returntype : string, filename Exceptions : none Example : |
Arg [1] : Bio::EnsEMBL::Analysis::Runnable Arg [2] : integer Function : container for the chip number Returntype: interger Exceptions: throws if passed an object which isnt a slice Example : |
Arg [1] : Bio::EnsEMBL::Analysis::Runnable::MAT Arg [2] : string, program name Usage : Description : Returns : Exceptions : |
Arg [1] : Bio::EnsEMBL::Analysis::Runnable::MAT Arg [2] : filename Description : Returntype : Exceptions : Example : |
Methods code
sub config_file
{ my $self = shift;
$self->{'config_file'} = shift if(@_);
return $self->{'config_file'};
}
1; } |
sub infile
{
my ($self, $filename) = @_;
if($filename){
$self->{'infile'} = $filename;
}
if(!$self->{'infile'}){
$self->{'infile'} = $self->create_filename($self->analysis->logic_name, 'dat');
}
return $self->{'infile'}; } |
sub query
{ my ($self, $chip) = @_;
if ($chip){
throw("Must pass RunnableDB::Funcgen::MAT::query an integer ".
"specifying the chip to br processed not ".$chip)
unless($chip =~ m/^\d+$/); $self->{'chip'} = $chip;
}
return $self->{'chip'}; } |
sub run_analysis
{
my ($self, $program) = @_;
if(!$program){
$program = $self->program;
}
throw($program." is not executable")
unless($program && -x $program);
if (! $ENV{INFILE_EXISTS}) {
my $command = $self->program . ' ' . $self->infile;
warn("Running analysis " . $command . "\n");
throw("FAILED to run $command: ", $@) if ($@);
} } |
sub write_infile
{
my ($self, $filename) = @_;
my $chipno = sprintf("%02d", $self->query);
if (exists $ENV{INFILE_EXISTS} && $ENV{INFILE_EXISTS}) {
opendir(DIR, $self->workdir())
or throw("Can't open dir ".$self->workdir());
my @files = grep { /.$chipno.tag$/ } readdir DIR;
throw("More than one tag file fir chip $chipno in ".$self->workdir)
if (! @files);
$filename = $self->workdir.'/'.$files[0];
closedir DIR;
}
if (! $filename) {
($filename = $self->infile()) =~ s/\.dat$/.$chipno.tag/;
}
(my $logfile = $filename) =~ s/\.tag$/.log/;
$ENV{BPMAPFILE} =~ s/<CHIPNO>/$chipno/;
$ENV{CELFILES} =~ s/<CHIPNO>/$chipno/g;
open(TAG, ">$filename")
or throw("Can't open .tag-file $filename.");
print TAG <<EOT;
[data] BpmapFolder = $ENV{BPMAPFOLDER} CelFolder = $ENV{CELFOLDER} GenomeGrp = $ENV{GENOMEGRP} RepLib = $ENV{REPLIB} Group = $ENV{GROUP} Pair = $ENV{PAIR}
[bpmap] 1 = $ENV{BPMAPFILE}
[cel] 1 = $ENV{CELFILES}
[intensity analysis] BandWidth = $ENV{BANDWIDTH} MaxGap = $ENV{MAXGAP} MinProbe = $ENV{MINPROBE}
[interval analysis] Matscore = Pvalue = 1e-5 FDR = Extend =
[output] Log = $logfile
EOT
close TAG;
$self->infile($filename);
(my $bedfile = $filename) =~ s/\.tag$/.bed/;
$self->resultsfile($bedfile);
my @fields = (0..2,4);
$self->output_fields(\@fields);
return $filename; } |
General documentation
Stefan Graf, Ensembl Functional Genomics -