Skip to content

Instantly share code, notes, and snippets.

@pjbriggs
Created December 14, 2018 08:55
Show Gist options
  • Save pjbriggs/6066f55bf10e412a4b9fe556e17b2072 to your computer and use it in GitHub Desktop.
Save pjbriggs/6066f55bf10e412a4b9fe556e17b2072 to your computer and use it in GitHub Desktop.
SGE client JSV script to strip "-pe smp.pe 1" from cellranger SGE jobs
#!/usr/bin/env perl
#
# Client JSV script from Mark Lundie for running cellranger
# pipeline
#
# Strips "-pe smp.pe 1" lines from job submission scripts
# (requests for >1 core will be kept unchanged)
#
# Include in qsub commands using -jsv PATH/TO/sge.strip_pe.pl
use strict;
use warnings;
no warnings qw/uninitialized/;
use Env qw(SGE_ROOT);
use lib "$SGE_ROOT/util/resources/jsv";
use JSV qw( :DEFAULT jsv_send_env jsv_log_info);
jsv_on_start(sub {
jsv_send_env();
});
jsv_on_verify(sub {
my %params = jsv_get_param_hash();
if (exists $params{pe_name}) {
my $nslots = $params{pe_min};
if ($nslots lt 2) {
jsv_del_param('pe_name');
jsv_correct('Stripped PE from serial job.');
}
}
jsv_accept();
});
jsv_main();
#!/usr/bin/env perl
use strict;
use warnings;
no warnings qw/uninitialized/;
use Env qw(SGE_ROOT);
use lib "$SGE_ROOT/util/resources/jsv";
use JSV qw( :DEFAULT jsv_send_env jsv_log_info);
jsv_on_start(sub {
jsv_send_env();
});
jsv_on_verify(sub {
my %params = jsv_get_param_hash();
if (exists $params{pe_name}) {
my $nslots = $params{pe_min};
if ($nslots lt 2) {
jsv_del_param('pe_name');
jsv_correct('Stripped PE from serial job.');
}
}
jsv_accept();
});
jsv_main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment