#
# This Makefile contains commands for the Zika reanalysis.
#
# https://read.biostarhandbook.com/rnaseq/rnaseq-zika-data.html
#

# The default action is to print help.
all:
	@echo "Select a task: getscripts, getdata, align, count, deseq1, deseq2, edger"

# These are the scripts that will perform the work.
getscripts:
	curl -sO http://data.biostarhandbook.com/rnaseq/projects/zika/zika-getdata.sh
	curl -sO http://data.biostarhandbook.com/rnaseq/projects/zika/zika-align.sh
	curl -sO http://data.biostarhandbook.com/rnaseq/projects/zika/zika-count.sh
	curl -sO http://data.biostarhandbook.com/rnaseq/projects/zika/zika-kallisto.sh
	curl -sO http://data.biostarhandbook.com/rnaseq/code/deseq1.r
	curl -sO http://data.biostarhandbook.com/rnaseq/code/deseq2.r
	curl -sO http://data.biostarhandbook.com/rnaseq/code/edger.r
	curl -sO http://data.biostarhandbook.com/rnaseq/code/draw-heatmap.r

# This script downloads the data.
getdata:
	bash zika-getdata.sh

# This script aligns the data.
align:
	bash zika-align.sh

# This script counts the alignment files.
count:
	bash zika-count.sh

deseq1:
	@echo "# Running DESeq1."
	cat sample_counts.txt | Rscript deseq1.r 4x4 2>> runlog.txt > results_deseq1.txt
	@echo "# Output: results_deseq1.txt"

deseq2:
	@echo "# Running DESeq2."
	cat sample_counts.txt | Rscript deseq2.r 4x4 2>> runlog.txt > results_deseq2.txt
	@echo "# Output: results_deseq2.txt"


edger:
	@echo "# Running EdgeR."
	cat sample_counts.txt | Rscript edger.r 4x4 2>> runlog.txt > results_edger.txt
	@echo "# Output: results_edger.txt"
