None available.
sub options
{
return ('--model', 'affine:local', '--subopt', 'no', '--bestn', '1'); } |
sub submit_depend_job
{ my $self = shift;
$self->jobcount || return; my $jobid = $self->global_jobid || die( "global_jobid unset!" );
my $depend = join( ':', 'afterany', $jobid );
my $id = $self->submit_qsub( q( echo 'sleep 1' ),
[ '-W' => 'block=true',
'-W' => "depend=$depend" ] );
return $jobid;
}
} |
sub submit_exonerate
{ my ($self, $query, $target, $root_dir, @options) = @_;
my $num_jobs
= XrefMapper::Methods::ExonerateBasic::calculate_num_jobs($query);
$self->jobcount($self->jobcount()+$num_jobs);
$num_jobs || return;
my $options_str = join( ' ', @options );
my $shell_command = <<"EOF"; #!/bin/sh $exonerate_path \\ --target $target \\ --query $query \\ --querychunktotal $num_jobs \\ --querychunkid %d \\ --showvulgar FALSE \\ --showalignment FALSE \\ --ryo "xref:%%qi:%%ti:%%ei:%%ql:%%tl:%%qab:%%qae:%%tab:%%tae:%%C:%%s\\n" \\ $options_str \\ | grep '^xref' exit EOF
my $host = Sys::Hostname::hostname;
my $query_alphabet = $query =~ /peptide.fasta$/ ? 'peptide' : 'dna';
my $outfile_root = sprintf( "%s:%s/%s_%s",
$host,
$root_dir,
$self->get_class_name(),
$query_alphabet );
my $jobid = $self->submit_qsub( q( echo 'sleep 1' ),
[ -W => "depend=on:$num_jobs" ] );
my $jobname = join '.', 'X', ( $host =~ /^(\w+)/ ), $$;
foreach( my $i=1; $i<=$num_jobs; $i++ ){
my $outfile = sprintf( '%s_%s.map', $outfile_root, $i );
my $errfile = sprintf( '%s_%s.err', $outfile_root, $i );
my $chunkid = $self->submit_qsub
( sprintf( $shell_command, $i ),
[ '-N' => $jobname,
'-W' => "depend=beforeany:$jobid",
'-o' => $outfile,
'-e' => $errfile ] );
}
$self->global_jobid( $jobid );
return $jobid;
}
} |
sub submit_qsub
{ my $self = shift;
my $script = shift || die( "Need a script to submit to qsub!" );
my @qsub_args = @{ shift || [] };
local *QSUB;
local *QSUB_READER;
my $jobid;
my $writer_pid;
if( $writer_pid = open( QSUB_READER, '-|' ) ){
while( <QSUB_READER> ){
if( /^(\d+)/ ){
$jobid = $1;
print( "Job ID $1 submitted to qsub\n" );
}
}
close( QSUB_READER );
}
else{
unless( defined($writer_pid) ){ die("Could not fork : $!" ) }
my $runner_pid;
if( $runner_pid = open(QSUB, '|-') ){
print QSUB $script;
close QSUB;
unless( $? == 0 ){ die( "qsub failed; non-zero status" ) }
exit(0);
}
else{
unless( defined($runner_pid) ){ die("Could not fork : $!" ) }
exec( 'qsub', @qsub_args );
die("Could not exec qsub : $!");
}
}
return $jobid;
}
1; } |