-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSnakefile
73 lines (63 loc) · 1.77 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
71
72
73
import glob
import os
#
# helper functions
#
def get_raw_bed(wildcards):
"""
Get the raw read count BED file from the config
"""
return config['raw_bed']
def get_calls_bed(wildcards):
"""
Get the calls BED file from the config
"""
return config['calls_bed']
def get_translocation_file(wildcards):
"""
Get the translocation file from the config
"""
return config['translocation_bedpe']
def get_all_files(wildcards):
"""
Get all the input files
"""
files = list()
files.append('.'.join([config['sample'], 'raw.fixed.bed']))
files.append('.'.join([config['sample'], 'calls.fixed.bed']))
files.append('.'.join([config['sample'], 'translocation.fixed.link']))
return files
def get_sample_name(wildcards):
"""
Get the sample name
"""
return config['sample']
#
# rules
#
rule all:
input: get_all_files
rule get_raw_bed:
input: get_raw_bed
output: expand("{sample}.raw.fixed.bed", sample=config['sample'])
params:
sample=get_sample_name,
cmd=srcdir("convert_bed_to_cnv_track.py")
shell:
"python {params.cmd} --sample {params.sample} --type raw --bed {input}"
rule get_calls_bed:
input: get_calls_bed
output: expand("{sample}.calls.fixed.bed", sample=config['sample'])
params:
sample=get_sample_name,
cmd=srcdir("convert_bed_to_cnv_track.py")
shell:
"python {params.cmd} --sample {params.sample} --type calls --bed {input}"
rule get_link_file:
input: get_translocation_file
output: expand("{sample}.translocation.fixed.link", sample=config['sample'])
params:
sample=get_sample_name,
cmd=srcdir("convert_bedpe_to_link.py")
shell:
"python {params.cmd} --sample {params.sample} --bedpe {input}"