# RNA-Seq Analysis with the Salmon aligner # The location for the data DATA_URL=https://data.biostarhandbook.com/data/rnaseq.airway.2026.tar.gz # The reference genome file FASTA=fasta/GRCh38.chr16.transcripts.fa # The directory for the index FASTA_IDX_DIR = fasta/idx/GRCh38.chr16.transcripts # The index file sentinel FASTA_IDX = ${FASTA_IDX_DIR}/index.ctab # The annotation file GTF=gtf/GRCh38.chr16.annotation.gtf # The sample name SAMPLE = Ctrl_N61311 # The path to the read file R1=fastq/${SAMPLE}_1.fq # Countdir files as text COUNT_DIR = counts/${SAMPLE} # Salmon counts file COUNTS = ${COUNT_DIR}/quant.sf # The design file DESIGN = design.csv # Run two jobs at a time since the alignment is already multithreadedwith 4 threads, thus using 2x4=8 cores PARALLEL = parallel --eta --colsep , --header : --jobs 2 --lb # This makefile's filename MAKE_FILE = $(lastword $(MAKEFILE_LIST)) # --- All definitions above this line. All code below this line --- # First target is the help. help: @echo "# " @echo "# SAMPLE=${SAMPLE}" @echo "# FASTA=${FASTA}" @echo "# R1=${R1}" @echo "# COUNT=${COUNT}" @echo "# " @echo "# make data" @echo "# make index" @echo "# make align" @echo "# make count" @echo "# " @echo "# make all" @echo "# " # Download and unpack the data ${FASTA} ${GTF} ${R1} &: curl ${DATA_URL} | tar xzvf - # Show the data files. data: ${FASTA} ${GTF} ${R1} ls -lh ${FASTA} ${GTF} ${R1} # The index file ${FASTA_IDX}: ${FASTA} salmon index --transcripts ${FASTA} --index ${FASTA_IDX_DIR} # Show the index file. index: ${FASTA_IDX} ls -lh ${FASTA_IDX} # Generate the counts for the default sample. ${COUNTS}: ${FASTA_IDX} ${R1} mkdir -p $(dir ${COUNT_DIR}) salmon quant --index ${FASTA_IDX_DIR} --libType A -r ${R1} --output ${COUNT_DIR} # Generate the counts for the default sample. counts: ${COUNTS} ls -lh ${COUNTS} # Run all steps for a single sample all: counts # Batch process all samples. batch: # Run the quantification for the default sample. make -f ${MAKE_FILE} index # Run the quantification for each sample. cat $(DESIGN) | $(PARALLEL) make -f ${MAKE_FILE} SAMPLE={sample} counts # These targets are not files. .PHONY: help data index counts all batch # Additional Makefile settings SHELL := bash .DELETE_ON_ERROR: .ONESHELL: .SHELLFLAGS := -eu -o pipefail -c MAKEFLAGS += --warn-undefined-variables --no-print-directory