-
Notifications
You must be signed in to change notification settings - Fork 1
/
Snakefile
64 lines (51 loc) · 1.71 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
"""Workflow for running simulations in this folder
:Author: Arvind Rasi Subramaniam
:Date: 18 Dec 2018
"""
# This generates the sim.params.tsv below
include: "choose_simulation_parameters.py"
import pandas as pd
input_params = pd.read_table("sim.params.tsv", index_col=0)
# These rules are run locally
localrules: all, combine_mrna_protein_stats, analyze_data
rule all:
"""List of all files we want at the end"""
input:
"analyze_results.md"
rule run_simulation:
"""Run simulation for each parameter combination"""
input:
"choose_simulation_parameters.py",
"../../tasep.py"
output:
"output/tasep_{n}_psr_stats.tsv.gz",
"output/tasep_{n}_mrna_lifetime_stats.tsv.gz",
"output/tasep_{n}.params.tsv.gz",
"output/tasep_{n}_collision_stats.tsv.gz",
"output/tasep_{n}_abort_stats.tsv.gz"
shell:
"python run_simulation.py {wildcards.n}"
rule combine_mrna_protein_stats:
"""Tabulate results from all simulations"""
input:
[f"output/tasep_{n}_psr_stats.tsv.gz" for n in range(len(input_params))],
[f"output/tasep_{n}_collision_stats.tsv.gz" for n in range(len(input_params))],
[f"output/tasep_{n}_abort_stats.tsv.gz" for n in range(len(input_params))],
[f"output/tasep_{n}_mrna_lifetime_stats.tsv.gz" for n in range(len(input_params))]
output:
"tables/psr_stats.tsv",
"tables/mrna_lifetime_stats.tsv",
"tables/collision_stats.tsv",
"tables/abort_stats.tsv"
script:
"../../combine_lifetime_and_psr_data.R"
rule analyze_data:
"""Analyze tabulated results and make figures"""
input:
"tables/psr_stats.tsv",
"tables/mrna_lifetime_stats.tsv",
"tables/collision_stats.tsv"
output:
"analyze_results.md"
script:
"analyze_results.Rmd"