Bio::EnsEMBL::Pipeline::BatchSubmission Local
Included librariesPackage variablesGeneral documentationMethods
Toolbar
WebCvsRaw content
Package variables
No package variables defined.
Included modules
Bio::EnsEMBL::Pipeline::BatchSubmission
Bio::EnsEMBL::Utils::Exception qw ( verbose throw warning info )
File::Copy
strict
Inherit
Bio::EnsEMBL::Pipeline::BatchSubmission
Synopsis
No synopsis!
Description
No description!
Methods
construct_command_line
No description
Code
copy_output
No description
Code
delete_temp_output
No description
Code
job_stats
No description
Code
new
No description
Code
open_command_line
No description
Code
temp_filename
No description
Code
temp_stderr
No description
Code
temp_stdout
No description
Code
Methods description
None available.
Methods code
construct_command_linedescriptionprevnextTop
sub construct_command_line {
  my($self, $command) = @_; 
  
  if(!$command){
    throw("Can't create command line if not command is passed in");
  }
  $self->command($command);
  
  my $command_line = $command;
  $command .= " 1> ".$self->temp_stdout." ";
  $command .= "2> ".$self->temp_stderr." ";
  $self->command($command);
}
copy_outputdescriptionprevnextTop
sub copy_output {
  my ($self, $file_to_copy, $new_location) = @_;
  eval{
    copy($file_to_copy, $new_location);
  };
  if($@){
    throw("Copy of temporary output ".$file_to_copy." to new location ".
          $new_location." failed $@");
  }
  return $new_location;
}
delete_temp_outputdescriptionprevnextTop
sub delete_temp_output {
  my ($self) = @_;
  if(-e $self->temp_stderr){
    unlink $self->temp_stderr;
  }
  if(-e $self->temp_stdout){
    unlink $self->temp_stdout;
  }
}
job_statsdescriptionprevnextTop
sub job_stats {
  my ($self) = @_;
  my $hash = {};
  $hash->{1} = 1;
  return $hash;
}
newdescriptionprevnextTop
sub new {
  my ($class, @args) = @_;
  my $self = $class->SUPER::new(@args);

  $self->{'commandline'} = undef;
  return $self;
}
open_command_linedescriptionprevnextTop
sub open_command_line {
  my ($self, $verbose) = @_;
  if($verbose){
    print STDERR "Opening ".$self->command."\n";
  }
  eval{
    system($self->command);
  };
  if($@){
    throw("FAILED to open commandline locally $@");
  }
  eval{
    if($self->stderr_file){
      $self->copy_output($self->temp_stderr, $self->stderr_file);
    }
    if($self->stdout_file){
      $self->copy_output($self->temp_stdout, $self->stdout_file);
    }
  };
  if($@){
    throw("FAILED to copy output to defined location $@ keeping temporary".
          "output")
  }else{
    $self->delete_temp_output;
  }
}
temp_filenamedescriptionprevnextTop
sub temp_filename {
  my ($self) = @_;
  return '/tmp/';
}
temp_stderrdescriptionprevnextTop
sub temp_stderr {
  my ($self, $file) = @_;
  if($file){
    $self->{'temp_stderr'} = $file;
  }
  if(!$self->{'temp_stderr'}){
    my $num = int(rand(100000));
    $self->{'temp_stderr'} = "/tmp/temp_local_out.".$num.".$$.err";
  }
  return $self->{'temp_stderr'};
}
temp_stdoutdescriptionprevnextTop
sub temp_stdout {
  my ($self, $file) = @_;
  if($file){
    $self->{'temp_stdout'} = $file;
  }
  if(!$self->{'temp_stdout'}){
    my $num = int(rand(100000));
    $self->{'temp_stdout'} = "/tmp/temp_local_out.".$num.".$$.out";
  }
  return $self->{'temp_stdout'};
}
General documentation
No general documentation available.