modified: myjupyterlab.sh
[GalaxyCodeBases.git] / projects / radseq / novogene / dot.sh
bloba55131d70c5c4ea1e2eb527f46e3758455d08b74
1 #!/bin/bash
2 #$ -v PERL5LIB,PATH,PYTHONPATH,LD_LIBRARY_PATH
3 #$ -cwd -r y -l vf=0.9g,p=1
4 #$ -S /bin/bash -t 1-2
7 MY_HOST=`/bin/hostname`
8 MY_DATE=`/bin/date`
9 echo "================================================================"
10 echo JOB_NAME=$JOB_NAME
11 echo JOB_ID=$JOB_ID
12 echo SGE_TASK_ID=$SGE_TASK_ID
13 echo SGE_TASK_FIRST=$SGE_TASK_FIRST
14 echo SGE_TASK_LAST=$SGE_TASK_LAST
15 echo NSLOTS=$NSLOTS
16 echo QUEUE=$QUEUE
17 echo SGE_CWD_PATH=$SGE_CWD_PATH
18 echo PATH=$PATH
19 echo SGE_STDIN_PATH=$SGE_STDIN_PATH
20 echo SGE_STDOUT_PATH=$SGE_STDOUT_PATH
21 echo SGE_STDERR_PATH=$SGE_STDERR_PATH
22 echo SGE_O_HOST=$SGE_O_HOST
23 echo SGE_O_PATH=$SGE_O_PATH
24 echo "================================================================"
26 echo "Running job JOB_NAME=$JOB_NAME task SGE_TASK_ID=$SGE_TASK_ID on $MY_HOST at $MY_DATE"
27 echo "Running job JOB_NAME=$JOB_NAME task SGE_TASK_ID=$SGE_TASK_ID on $MY_HOST at $MY_DATE" >out/$MAIN.sailog
29 SEEDFILE=ng/t.lst
30 SEED=$(/bin/sed -n -e "${SGE_TASK_ID} p" $SEEDFILE)
31 PATH=$(/bin/sed -n -e "${SGE_TASK_ID} p" $SEEDFILE|/bin/awk -F"\t" '{print $1}')
32 MAIN=$(/bin/sed -n -e "${SGE_TASK_ID} p" $SEEDFILE|/bin/awk -F"\t" '{print $2}')
33 /usr/local/bin/bwa aln -l 17 -q 10 -t 6 cat62 $PATH/$MAIN.1.fq.gz >out/$MAIN.1.sai 2>>out/$MAIN.sailog
34 /bin/date >> out/$MAIN.sailog
35 /usr/local/bin/bwa aln -l 17 -q 10 -t 6 cat62 $PATH/$MAIN.2.fq.gz >out/$MAIN.2.sai 2>>out/$MAIN.sailog
36 /bin/date >> out/$MAIN.sailog
37 /usr/local/bin/bwa sampe -a 800 cat62 out/$MAIN.1.sai out/$MAIN.2.sai $PATH/$MAIN.1.fq.gz $PATH/$MAIN.2.fq.gz 2>>out/$MAIN.sailog | /bin/gzip -9c >out/$MAIN.rawsam.gz
38 /bin/date >> out/$MAIN.sailog
39 /usr/bin/perl ng/pickR1orR2XTUreads.pl out/$MAIN.rawsam.gz out/$MAIN.sam.gz
40 /bin/date >> out/$MAIN.sailog
41 /usr/local/bin/samtools view -bS out/$MAIN.sam.gz >out/$MAIN.bam 2>>out/$MAIN.sailog
42 /usr/local/bin/samtools sort -m 3200000000 out/$MAIN.bam out/$MAIN.sort
43 /usr/local/bin/samtools rmdup out/$MAIN.sort.bam out/$MAIN.rmdup.bam
44 /bin/date >> out/$MAIN.sailog