-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snakefile
72 lines (52 loc) · 2.22 KB
/
Snakefile
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
from pathlib import Path
################ Read Configs ################
configfile: "configs/configs.yaml"
sample_generic = config['sample']['generic']
sample_dante = config['sample']['dante']
sample_dict = {sample_generic: sample_dante}
wgs_fastq_path = Path(config['dante']['fastq_path'])
wgs_bam_path = Path(config['dante']['bam_path'])
wgs_vcf_path = Path(config['dante']['vcf_path'])
################################################
EXTERNAL_DIR = Path("data/external")
INTERIM_DIR = Path("data/interim")
PROCESSED_DIR = Path("data/processed")
# rtg vcfeval params to be used based on filter status
VCFEVAL_PARAMS_OUTDIR_LIST = [ 'pass_only',
'pass_only_noGT',
'pass_and_fail_noGT']
VCFEVAL_PARAMS_LIST = [ '',
'--squash-ploidy',
'--all-records --squash-ploidy']
VCFEVAL_PARAMS_DICT = dict(zip(VCFEVAL_PARAMS_OUTDIR_LIST, VCFEVAL_PARAMS_LIST))
# seq read pairs
READ_TYPES = ["R1", "R2"]
##### Wildcard constraints #####
wildcard_constraints:
sample= "|".join([sample_dante, sample_generic]),
read="|".join(READ_TYPES)
################################################
include: "rules/common.smk"
include: "rules/qc.smk"
if config['23andme_file']: # include only if provided by user
include: "rules/compare_vcfs.smk"
################################################
def get_23andme_targets():
'''
if 23andme file is provided, return targets of interest.
'''
targets = []
if config['23andme_file']:
targets.extend(expand(str(PROCESSED_DIR / "23andme/vcf/{sample}.vcf.gz"),
sample=sample_generic)),
targets += expand(str(PROCESSED_DIR / "rtg_vcfeval_results/{sample}/{comparison_type}/done"),
sample=sample_generic,
comparison_type=VCFEVAL_PARAMS_DICT.keys())
return targets
rule all:
input:
expand(str(PROCESSED_DIR / "qc/fastqc/{sample}-{read}.html"),
sample=sample_dante, read=READ_TYPES),
expand(str(PROCESSED_DIR / "qc/qualimap/{sample}/qualimapReport.html"),
sample=sample_dante),
get_23andme_targets()