-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcontest.mk
30 lines (24 loc) · 921 Bytes
/
contest.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
# This module runs ContEst on snp vcf files from gatk
# Author: inodb, limr
##### MAKE INCLUDES #####
include modules/Makefile.inc
include modules/variant_callers/gatk.inc
LOGDIR ?= log/contest.$(NOW)
.SECONDARY:
.DELETE_ON_ERROR:
.PHONY: contest
contest : contest/all_contest.txt
# ContEst doing on-the-fly genotyping
define contest-tumor-normal
contest/$1_$2.contest.txt : bam/$1.bam bam/$2.bam
$$(call RUN,-s 12G -m 12G,"$$(call GATK_MEM2,4G) -T ContEst -I:eval $$(<) -I:genotype $$(<<) \
-pf $$(HAPMAP_POP_FILE) -o $$(@) -R $$(REF_FASTA)")
endef
$(foreach pair,$(SAMPLE_PAIRS),$(eval $(call contest-tumor-normal,$(tumor.$(pair)),$(normal.$(pair)))))
contest/all_contest.txt : $(foreach pair,$(SAMPLE_PAIRS),contest/$(pair).contest.txt)
( \
head -1 $< | sed "s/^/sample\t/"; \
for s in $(^); do \
grep -P "META\t" $$s | sed "s/^/`basename $$s _contamination.txt`/"; \
done | sort -rnk5,5; \
) > $@