Franco / [STAR index]
Script LINK
This a script used to build the STAR aligner specific indeces required prior to performing alignments. For a tutorial see link
UCI uses the SLURM scheduler so you must use slurm headers to specify how and where you want the job to run. You must also name the script SCRIPT_NAME.sub and then run the script using "Sbatch SCRIPT_NAME.sub", while you are in the working directory of the script location.
For a more in depth view on a SLURM job script headers see https://rcic.uci.edu/slurm/examples.html.
Make note that this script uses the free partition but you can use your free 1000 core hours of the lab's core hours by changing the header. Otherwise your job can be killed in the free partition.
#!/bin/bash
#SBATCH --job-name=Index_build
#SBATCH -p free
#SBATCH --nodes=1
#SBATCH --mem=100G ## request 100GB of memory
#SBATCH -o /dfs3b/hertel-lab/fcarranz/project_name/star_index/star_build.out ## the name of the output file. not to be confused with the results.
#SBATCH -e /dfs3b/hertel-lab/fcarranz/project_name/star_index/star_build.err ## name of the error file
#SBATCH --mail-user fcarranz@uci.edu
#SBATCH --mail-type=ALLmodule load star/2.7.10a
module load python/3.8.0
module load samtools/1.10Location of files to be used in index creation
DATA_DIR=/data/homezvol2/fcarranzLocation of reference genome file / fasta files being used can download the lastest reference fasta file at GENCODE, under the fasta files and downloading the primary assembly.
Note, this will have to be customized if you are using spike-in reads.
REF_FASTA=${DATA_DIR}/Genome/v45/v45.faLocation of annotation file / gtf files being used Can download the lastest reference fasta file at GENCODE, under the GTF files and downloading the primary assembly. Note, this will have to be customized if you are using spike-in reads.
REF_ANNOTATION=${DATA_DIR}/GTF/v45/gencode.v45.primary_assembly.basic.annotation.gtfLocation of the resulting star indeces.
OUTPUT_DIR=/dfs3b/hertel-lab/fcarranz/project_name/star_index
# Making the result file directory
mkdir -p ${OUTPUT_DIR}
O=124 #this overhang ideally should be ReadLength-1. So if your reads are 125 after trimming then 124 is appropriate.
P=16 #threads
#STAR --runMode genomeGenerate --genomeDir $OUTPUT_DIR --genomeFastaFiles $REF_FASTA --runThreadN $P --sjdbGTFfile $REF_ANNOTATION --sjdbOverhang $O
STAR --runMode genomeGenerate --genomeDir $OUTPUT_DIR --genomeFastaFiles $REF_FASTA --runThreadN $P --sjdbGTFfile $REF_ANNOTATION --sjdbOverhang $O \
#--runMode genomeGenerate
#--genomeDir path to where output files should be placed
#--genomeFastaFiles Fasta file location
#--runThreadN Number of threads
#--sjdbGTFfile path to annotation file
#-- ReadLength-1
# Please note if any of these commands are not sent in as slurm job but done in the terminal then you need to be in a interactive node, NOT THE LOGIN NODE! You will get in trouble with UCI's HPC staff.