forked from percyfal/biomake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.variation
120 lines (97 loc) · 3.51 KB
/
Makefile.variation
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#-*- makefile -*-
MAKEDIR = $(dir $(lastword $(MAKEFILE_LIST)))
ifeq ($(findstring Makefile.ngsvars,$(MAKEFILE_LIST)),)
include $(MAKEDIR)Makefile.ngsvars
endif
#
# variation analysis makefile rules
#
# vcftools
ifndef VCFTOOLS
VCFTOOLS_HOME=.
endif
ifndef VCFTOOLS_OPTIONS
VCFTOOLS_OPTIONS=
endif
ifndef VCFTOOLS_STATS_OPTIONS
VCFTOOLS_STATS_OPTIONS=
endif
# htslib
ifndef HTSLIB_HOME
HTSLIB_HOME=.
endif
ifndef VCF_HOME
VCF_HOME=.
endif
%.ped: %.vcf
$(VCFTOOLS_HOME)/vcftools $(VCFTOOLS_OPTIONS) --vcf $< --plink --out $*.tmp && mv $*.tmp.ped $@; mv $*.tmp.map $*.map
%.stats.dump: %.vcf
$(VCFTOOLS_HOME)/vcf-stats $(VCFTOOLS_STATS_OPTIONS) $< -p $*.stats
%.frq: %.vcf
$(VCFTOOLS_HOME)/vcftools --freq $(VCFTOOLS_OPTIONS) --vcf $< --out $*.tmp && rename $*.tmp $* $**
%.2.frq: %.vcf
$(VCFTOOLS_HOME)/vcftools --counts --freq2 $(VCFTOOLS_OPTIONS) --vcf $< --out $*.2.tmp && rename $*.2.tmp $*.2 $**
%.chk: %.vcf
$(VCF_HOME)/vcf check $< > [email protected] && mv [email protected] $@
%-summary.pdf: %.chk
$(HTSLIB_HOME)/misc/plot-vcfcheck $< -p $*
#
# annovar
#
ifndef ANNOVAR_HOME
ANNOVAR_HOME=.
endif
ifndef ANNOVAR_OPTIONS
ANNOVAR_OPTIONS=
endif
ifndef ANNOVAR_DB
ANNOVAR_DB=$(ANNOVAR_HOME)/humandb
endif
ifndef ANNOVAR_BUILDVER
ANNOVAR_BUILDVER=hg19
endif
ifndef ANNOVAR_DBLIST
ANNOVAR_DBLIST=dgv genomicSuperDups gwascatalog tfbs wgEncodeRegTfbsClustered wgEncodeRegDnaseClustered phastConsElements46way
endif
ifndef ANNOVAR_DBLIST_WEBFROM_ANNOVAR
ANNOVAR_DBLIST_WEBFROM_ANNOVAR=1000g2012apr cosmic64 esp6500si_all esp6500si_ea ljb_all snp137 refGene avsift
endif
annovar-download-webfrom-annovar-%:
$(ANNOVAR_HOME)/annotate_variation.pl -buildver $(ANNOVAR_BUILDVER) -downdb -webfrom annovar $* $(ANNOVAR_DB)
annovar-download-%:
$(ANNOVAR_HOME)/annotate_variation.pl -buildver $(ANNOVAR_BUILDVER) -downdb $* $(ANNOVAR_DB)
# DB targets
ANNOVAR_DBLIST_TARGETS:=$(addprefix annovar-download-,$(ANNOVAR_DBLIST))
ANNOVAR_DBLIST_WEBFROM_ANNOVAR_TARGETS:=$(addprefix annovar-download-webfrom-annovar-,$(ANNOVAR_DBLIST_WEBFROM_ANNOVAR))
# Rule for setting up db
# NB: this rule is problematic in that it is always run. We need a
# list of all output database file names as targets.
annovar-setupdb: $(ANNOVAR_DBLIST_TARGETS) $(ANNOVAR_DBLIST_WEBFROM_ANNOVAR_TARGETS)
ifndef ANNOVAR_TABLE_OPTIONS
ANNOVAR_TABLE_OPTIONS=--otherinfo
endif
%.avinput.hg19_multianno.txt: %.avinput
$(ANNOVAR_HOME)/table_annovar.pl $< $(ANNOVAR_DB) $(ANNOVAR_TABLE_OPTIONS) --buildver hg19
ifndef ANNOVAR_CONVERT_OPTIONS
ANNOVAR_CONVERT_OPTIONS=--includeinfo
endif
ifndef ANNOVAR_CONVERT_VCF_FORMAT
ANNOVAR_CONVERT_VCF_FORMAT=vcf4
endif
%.avinput: %.vcf
$(ANNOVAR_HOME)/convert2annovar.pl $(ANNOVAR_OPTIONS) $(ANNOVAR_CONVERT_OPTIONS) -format $(ANNOVAR_CONVERT_VCF_FORMAT) $< > [email protected] && mv [email protected] $@
##############################
# Settings
##############################
print-%:
@echo '$*=$($*)'
variation-header:
@echo -e "\nMakefile.variation options"
@echo "============================"
vcftools-header:
@echo -e "\nvcftools options"
@echo "--------------------"
annovar-header:
@echo -e "\nannovar options"
@echo "--------------------"
variation-settings: variation-header vcftools-header print-VCFTOOLS_HOME print-VCFTOOLS_OPTIONS print-VCFTOOLS_STATS_OPTIONS print-HTSLIB_HOME print-VCF_HOME annovar-header print-ANNOVAR_HOME print-ANNOVAR_OPTIONS print-ANNOVAR_DB print-ANNOVAR_BUILDVER print-ANNOVAR_DBLIST print-ANNOVAR_DBLIST_WEBFROM_ANNOVAR print-ANNOVAR_DBLIST_TARGETS print-ANNOVAR_DBLIST_WEBFROM_ANNOVAR_TARGETS print-ANNOVAR_TABLE_OPTIONS print-ANNOVAR_CONVERT_OPTIONS