Chapter 4 Build the STAR genome index
4.2 Build STAR index
# Move to the base directory for references
cd "$BASE"
# Download the primary assembly and GTF (GENCODE v44)
wget -c https://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_44/GRCh38.primary_assembly.genome.fa.gz
wget -c https://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_44/gencode.v44.annotation.gtf.gz
# Decompress the downloads
gunzip -f GRCh38.primary_assembly.genome.fa.gz
gunzip -f gencode.v44.annotation.gtf.gz
# Paths
STAR_INDEX="$BASE/star"
genome_fa="$BASE/GRCh38.primary_assembly.genome.fa"
gtf="$BASE/gencode.v44.annotation.gtf"
# Create output directory for STAR index
mkdir -p "$STAR_INDEX"
# Build STAR genome index
STAR --runMode genomeGenerate \
--genomeDir "$STAR_INDEX" \
--genomeFastaFiles "$genome_fa" \
--sjdbGTFfile "$gtf" \
--runThreadN 4 \
--sjdbOverhang 100