#!/bin/bash

#SBATCH --job-name=star_index # Job name
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=100G
#SBATCH --time=0-03:00:00
#SBATCH --mail-user=ccast036@ucr.edu
#SBATCH --mail-type=ALL
#SBATCH -p highmem
#SBATCH --output=slurmout/star-index_%A.out # File to which STDOUT will be written
#SBATCH --error=slurmout/star-index_%A.err # File to which STDERR will be written

start=`date +%s`
echo $HOSTNAME

cd References/star.overlap100.ncbi

module load STAR/2.7.9a

call="STAR --runThreadN 1 \
     --runMode genomeGenerate \
     --genomeDir /bigdata/roperlab/ccast036/biofilm_rnaseq/References/star.overlap100.ncbi \
     --genomeFastaFiles /bigdata/roperlab/ccast036/biofilm_rnaseq/References/GCF_000007245.1_ASM724v1_genomic_1.fa /bigdata/roperlab/ccast036/biofilm_rnaseq/References/GCF_000007245.1_ASM724v1_genomic_2.fa \
     --sjdbGTFfile /bigdata/roperlab/ccast036/biofilm_rnaseq/References/GCA_000007245.1_ASM724v1_genomic.gtf \
     --sjdbGTFfeatureExon CDS \
     --sjdbOverhang 149 \
     --genomeSAindexNbases 8"

echo $call
eval $call

end=`date +%s`
runtime=$((end-start))
echo $runtime
