#!/bin/bash

#$ -cwd
#$ -o Output/batch-$TASK_ID.stdout
#$ -e Output/batch-$TASK_ID.stderr
#$ -S /bin/bash
cd $TMPDIR

cp /u/home/d/desmond/RH_hamster_gseq.txt RH_hamster_gseq.txt
cp /u/home/d/desmond/cell_label_info.txt cell_label_info.txt
cp /u/home/d/desmond/RH_pool_hamster_total_align.txt RH_pool_hamster_total_align.txt
cp -r /u/home/d/desmond/R R

. /etc/profile
module load R/3.5.0
echo Starting batch $SGE_TASK_ID

for i in {116..120..1}
  do
    Rscript --vanilla --verbose /u/home/d/desmond/runJobs_shuff_hamster.R $i > /u/home/d/desmond/Output/R-gam-$i-batch-${SGE_TASK_ID}.Rout 2>&1    
#    Rscript /u/home/d/desmond/runJobs_test_1.R $i
#    R CMD BATCH /u/home/d/desmond/runJobs_fast_$i.R /u/home/d/desmond/Output/R-gam-$i-batch-${SGE_TASK_ID}.Rout
  done
