## Set your variable names

## Folders for use
DATADIR=data
USERDIR=user_data
OUTDIR=results
REPODIR=~/Desktop/FREYA/FREYA/DataAnalysis

## Canine data
DOGEXPR=Canine_RNASeq.csv
DOGMUTS=mutations_genesOnly_allHuman.csv
DOGPHEN=samples_canine_updated.csv

## Canine info files generated by FREYA scripts
PAM50=$(OUTDIR)/PAM50_dog.csv
CMTFILE=$(OUTDIR)/CMT_PEPs.csv
MAPPING=data/humanmapping.rda # If you regenerate the mapping file, make sure to update this link

## Human cancer datasets (provided with FREYA)
BRCAEXPR=$(DATADIR)/BRCA_rnaseq_paired_noMets.t.txt
BRCAPHEN=$(DATADIR)/BRCA_PAM50_labels.csv


## Creates the input files for analysis, only run if using the data-prep portion of FREYA
#data: prep_data.R peps_and_simulations.R

dat:
	echo 'Running the data processing scripts'
	$(REPODIR)/prep_data.R -d $(USERDIR)
	$(REPODIR)/peps_and_simulations.R -s $(DOGPHEN) -i 10 -d $(USERDIR) -c $(USERDIR)/dexseq_count -m $(MAPPING) # TODO: change from 10 to 300 iterations
	rm -f Rplots.pdf

## Runs manuscript analysis
report:
	echo 'Generating reports for each analysis'
	$(REPODIR)/run_topGO.R -u $(CMTFILE) -n 10 -c 0.05 -t 
	$(REPODIR)/PAGE.R -p $(CMTFILE) -d $(DATADIR) -w $(USERDIR)
	$(REPODIR)/run_DESeq3.R -p $(CMTFILE)
	$(REPODIR)/PAM50_refactored.R -c $(USERDIR)/$(DOGPHEN) -e $(USERDIR)/$(DOGEXPR) -p $(CMTFILE) -d , -o $(OUTDIR)
	$(REPODIR)/mut_analysis_refactored.R -c $(USERDIR)/$(DOGPHEN) -m $(USERDIR)/$(DOGMUTS) -p $(CMTFILE) -n 5 -s $(PAM50)
	rm -f Rplots.pdf

all: dat report

clean:
	rm -rf $(OUTDIR) Rplots.pdf
