SGE job array for MaSuRCA pipeline
1
0
Entering edit mode
6.8 years ago
fufuyou ▴ 110

This is a sh file from MaSuRCA pipeline. I want to do this by SGE array job or single job submit to server since the pipeline will take long time in this step. I did not know how to set up $SGE_TASK_ID. Could you give me some suggestions? Thanks, Fuyou

#!/bin/sh

perl='/usr/bin/env perl'

jobid=$SGE_TASK_ID
if [ x$jobid = x -o x$jobid = xundefined -o x$jobid = x0 ]; then
  jobid=$1
fi
if [ x$jobid = x ]; then
  echo Error: I need SGE_TASK_ID set, or a job index on the command line.
  exit 1
fi

bat=`head -n $jobid /scratch/snyder/f/fu115/Genome_assembly/Lordec/masurca21/MaSuRCA/CA.mr.41.15.17.0.029/0-overlaptrim-overlap/ovlbat | tail -n 1`
job=`head -n $jobid /scratch/snyder/f/fu115/Genome_assembly/Lordec/masurca21/MaSuRCA/CA.mr.41.15.17.0.029/0-overlaptrim-overlap/ovljob | tail -n 1`
opt=`head -n $jobid /scratch/snyder/f/fu115/Genome_assembly/Lordec/masurca21/MaSuRCA/CA.mr.41.15.17.0.029/0-overlaptrim-overlap/ovlopt | tail -n 1`
jid=$$

if [ ! -d /scratch/snyder/f/fu115/Genome_assembly/Lordec/masurca21/MaSuRCA/CA.mr.41.15.17.0.029/0-overlaptrim-overlap/$bat ]; then
  mkdir /scratch/snyder/f/fu115/Genome_assembly/Lordec/masurca21/MaSuRCA/CA.mr.41.15.17.0.029/0-overlaptrim-overlap/$bat
fi

if [ -e /scratch/snyder/f/fu115/Genome_assembly/Lordec/masurca21/MaSuRCA/CA.mr.41.15.17.0.029/0-overlaptrim-overlap/$bat/$job.ovb.gz ]; then
  echo Job previously completed successfully.
  exit
fi

if [ x$bat = x ]; then
  echo Error: Job index out of range.
  exit 1
fi

AS_OVL_ERROR_RATE=0.06
AS_CNS_ERROR_RATE=0.06
AS_CGW_ERROR_RATE=0.15
AS_OVERLAP_MIN_LEN=40
AS_READ_MIN_LEN=64
export AS_OVL_ERROR_RATE AS_CNS_ERROR_RATE AS_CGW_ERROR_RATE AS_OVERLAP_MIN_LEN AS_READ_MIN_LEN

syst=`uname -s`
arch=`uname -m`
name=`uname -n`

if [ "$arch" = "x86_64" ] ; then
  arch="amd64"
fi
if [ "$arch" = "Power Macintosh" ] ; then
  arch="ppc"
fi

bin="/depot/bioinfo/apps/apps/MaSuRCA-3.2.3/CA8/$syst-$arch/bin"

$bin/overlapInCore -G --hashbits 22 --hashload 0.75 -t 20 \
  $opt \
  -k 22 \
  -k /scratch/snyder/f/fu115/Genome_assembly/Lordec/masurca21/MaSuRCA/CA.mr.41.15.17.0.029/0-mercounts/genome.nmers.obt.fasta \
  -o /scratch/snyder/f/fu115/Genome_assembly/Lordec/masurca21/MaSuRCA/CA.mr.41.15.17.0.029/0-overlaptrim-overlap/$bat/$job.ovb.WORKING.gz \
  /scratch/snyder/f/fu115/Genome_assembly/Lordec/masurca21/MaSuRCA/CA.mr.41.15.17.0.029/genome.gkpStore \
&& \
mv /scratch/snyder/f/fu115/Genome_assembly/Lordec/masurca21/MaSuRCA/CA.mr.41.15.17.0.029/0-overlaptrim-overlap/$bat/$job.ovb.WORKING.gz /scratch/snyder/f/fu115/Genome_assembly/Lordec/masurca21/MaSuRCA/CA.mr.41.15.17.0.029/0-overlaptrim-overlap/$bat/$job.ovb.gz

exit 0
Assembly • 1.7k views
ADD COMMENT
1
Entering edit mode

I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

101010 Button

ADD REPLY
0
Entering edit mode

OK. Thanks. I will do next time as what you said. Fuyou

ADD REPLY
0
Entering edit mode
6.8 years ago
h.mon 35k

Probably the simplest solution is to use useGrid=false.

If you do want a better solution, then you should answer these questions: how are you trying to run MaSuRCA? What are the error messages? Do your workstation / server / cluster have SGE installed? I guess you are using useGrid=true?

ADD COMMENT

Login before adding your answer.

Traffic: 2487 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6