
env rnain=fastq/SRR097896_1.fastq.gz qsub -q normal gsnap1.sh

#! /bin/bash 
#PBS -N gsnap1
#PBS -A ddp138
#PBS -l nodes=1:ppn=32,walltime=2:55:00
#PBS -o gsnap1.$$.out
#PBS -e gsnap1.$$.err
#PBS -V
## avoid HOME, use  /scratch/$USER/$PBS_JOBID   /oasis/$USER

ncpu=32

oasd=/oasis/$USER
workd=$oasd/chrs/aphid2
gmapd=$oasd/bio/gmap11
rund=/scratch/$USER/$PBS_JOBID

mkdir -p $rund
mkdir $rund/outs

cp -rp $workd/genome/gmap $rund/
cd $rund/

i=0; while [ $i -lt $ncpu ]; do {
 ...
 i=$(( $i + 1 ))
}
done
wait

cp -rp $rund/outs $workd/rnas/
