-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPipeline.mk
35 lines (24 loc) · 938 Bytes
/
Pipeline.mk
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
# Inspired by a bash pipeline written by Tristan Dubos in 2018
REF=/regovar/database/hg19.fa
INPUTS=/regovar/inputs
OUPUTS=/regovar/outputs
#patsubst: allows to change the extension and/or the path of the files
#wildcard: allows to get a list of files with globbing
all: \
$(patsubst $(INPUTS)/%.fastq,$(OUTPUTS)/%_snp.vcf, $(wildcard $(INPUTS)/*.fastq)) \
$(patsubst $(INPUTS)/%.fastq,$(OUTPUTS)/%_indel.vcf, $(wildcard $(INPUTS)/*.fastq))
%.sam: $(REF) %.fastq
bwa mem -t 4 $^ > $@
%.bam: %.sam
samtools view -b -S $< > $@
%_sorted.bam: %.bam
samtools sort $< $@
%_sorted.bai: %_sorted.bam
samtools index $<
%.mpileup: %_sorted.bam $(REF)
samtools mpileup -B -f $(REF) -Q 10 $< > $@
%_snp.vcf: %.mpileup
java -jar VarScan.v2.3.9.jar mpileup2snp $< --min-coverage 40 --min-var-freq 0.01 > $@
%_indel.vcf: %.mpileup
java -jar VarScan.v2.3.9.jar mpileup2indel $< --min-coverage 40 --min-var-freq 0.01 > $@
.PHONY: all