-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (51 loc) · 1.88 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
makeNotes:
$(info make clean = delete all output to start over)
$(info make demux = demultiplex raw MiSeq data with Pheniqs)
$(info make trim = remove primers and sequencing adapters)
$(info make denoise = denoise with DADA2)
$(info make compile = post-process OTUs, add metadata and taxonomy)
$(info make analysis = run a simple example analysis)
clean:
rm -r output
$(info you have a clean slate)
##############################
### demultiplex MiSeq data ###
##############################
muxDir = output/processing/demux
demux: ${muxDir}
${muxDir} ${muxDir}/demux.report.txt: code/demux.config.json
mkdir -p ${muxDir} && touch ${muxDir}
pheniqs mux -R ${muxDir}/demux.report.txt -c code/demux.config.json --base-input data/MiSeq_raw --base-output ${muxDir}/
###############################
### trim primers / adapters ###
###############################
trimDir = output/processing/trim
trim: ${trimDir}
${trimDir} ${trimDir}/summary.tab: code/trim.sh ${muxDir}
mkdir -p ${trimDir} && touch ${trimDir}
./code/trim.sh ${muxDir} ${trimDir}
##############
## denoise ###
##############
dadaDir = output/processing/dada
denoise: ${dadaDir}
${dadaDir} ${dadaDir}/dadaSmmary.csv: code/denoise.R ${trimDir}
mkdir -p ${dadaDir} && touch ${dadaDir}
Rscript code/denoise.R ${trimDir} ${dadaDir}
##############################
### compile processed data ###
##############################
compDir = output/processing/compiled/
compile: ${compDir}
${compDir} ${compDir}/phy.rds: code/compile.R ${dadaDir}
mkdir -p ${compDir} && touch ${compDir}
Rscript code/compile.R
################
### Analysis ###
################
analysis: output/html/analysis.html
output/html/analysis.html: code/analysis.Rmd ${compDir}/phy.rds
mkdir -p output/figs
mkdir -p output/html
Rscript -e 'rmarkdown::render("code/analysis.Rmd", output_dir = "output/html", knit_root_dir = "$(CURDIR)")'
rm Rplots.pdf