#!/bin/bash
#SBATCH -t 1:00:00
#SBATCH --nodes=1 --ntasks-per-node=1
#SBATCH --export=NONE
#SBATCH --mail-user=jamie_wandzilak@uri.edu
#SBATCH --mail-type=BEGIN,END,FAIL

#this script will convert the bedGraph files into bigwig files which are easier to view on IGV

module load kentUtils/397-foss-2019b

while [ ! -z "$1" ]

do
    PREFIX=$1  #Set the first argument to the experiment name
    DIRPATH=/data/kramseylab/bam/rnaseq_LVS_bam  #Define the working directory

    bedGraphToBigWig $DIRPATH/tracks/$PREFIX\_plus.bedGraph LVS_genomefile.txt $DIRPATH/tracks/$PREFIX\_plus.bw
    bedGraphToBigWig $DIRPATH/tracks/$PREFIX\_minus.bedGraph LVS_genomefile.txt $DIRPATH/tracks/$PREFIX\_minus.bw
shift

done

#be sure to put in your own reference genome instead of LVS_genomefile.txt
