-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSnakefile
109 lines (101 loc) · 3.05 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
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
configfile: "configuration/snakemake.yaml"
container: "docker://condaforge/mambaforge:4.10.1-0"
BENCHS = config["bench_dir"]
DATA = config["data_dir"]
ENVS = config["env_dir"]
LOGS = config["log_dir"]
RESULTS = config["results_dir"]
rule all:
input:
RESULTS + "dag.png",
RESULTS + "process/sorted_isoforms.xlsx",
rule dag:
output:
dag = RESULTS + "dag.png",
conda:
ENVS + "dag.yml"
shell:
"snakemake -np --dag &> /dev/null | "
"dot -Tpng "
"> {output.dag}"
rule ids:
params:
url = config["gencode_url"],
output:
lut = DATA + "gencode.v26.annotation",
log:
LOGS + "ids.log"
benchmark:
BENCHS + "ids.txt"
shell:
"wget -qO- {params.url} | "
"gzip -dc | "
"grep -w gene | "
"cut -f9 | "
"cut -d ' ' -f2,6 | "
"tr -d ';\"' "
"> {output.lut} "
"2> {log}"
rule mane:
params:
url = config["mane_url"],
output:
data = DATA + "MANE.csv",
log:
LOGS + "mane.log"
benchmark:
BENCHS + "mane.txt"
conda:
ENVS + "mane.yml"
script:
"scripts/mane.py"
rule request:
input:
lut = DATA + "gencode.v26.annotation",
params:
gene_ids = config["gene_ids"],
region = config["region"],
output:
data = expand(RESULTS + "request/{gene}_message.csv", gene=config["gene_ids"]),
log:
LOGS + "request.log"
benchmark:
BENCHS + "request.txt"
threads:
workflow.cores
conda:
ENVS + "request.yml"
script:
"scripts/request.py"
rule biomart:
input:
data = expand(RESULTS + "request/{gene}_message.csv", gene=config["gene_ids"]),
output:
data = expand(RESULTS + "biomart/{gene}_message.csv", gene=config["gene_ids"]),
log:
LOGS + "biomart.log"
benchmark:
BENCHS + "biomart.txt"
threads:
workflow.cores
conda:
ENVS + "biomart.yml"
script:
"scripts/biomart.py"
rule process:
input:
gtex = expand(RESULTS + "request/{gene}_message.csv", gene=config["gene_ids"]),
bm = expand(RESULTS + "biomart/{gene}_message.csv", gene=config["gene_ids"]),
mane = DATA + "MANE.csv",
output:
data = RESULTS + "process/sorted_isoforms.xlsx",
log:
LOGS + "process.log"
benchmark:
BENCHS + "process.txt"
threads:
workflow.cores
conda:
ENVS + "process.yml"
script:
"scripts/process.py"