-
Notifications
You must be signed in to change notification settings - Fork 4
/
Snakefile
53 lines (41 loc) · 1.6 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
import os
import re
import pandas as pd
from snakemake.utils import validate, min_version
min_version("5.3.1")
UORFANNOTATIONPATH = config["uorfannotationpath"]
CODONS = config["alternativestartcodons"]
samples = pd.read_csv(config["samples"], sep="\t", dtype=str).set_index(["method", "condition", "replicate"], drop=False)
samples.index = samples.index.set_levels([i.astype(str) for i in samples.index.levels])
def replicate_check(samples):
if(samples['replicate'].nunique() < 2):
print("Warning: Please make sure your experiment contains replicates!")
with pd.option_context('display.max_rows', None, 'display.max_columns', None):
print(samples)
validate(samples, schema="schemas/samples.schema.yaml")
onstart:
if not os.path.exists("logs"):
os.makedirs("logs")
replicate_check(samples)
report: "report/workflow.rst"
rule all:
input:
expand("maplink/{sample.method}-{sample.condition}-{sample.replicate}.bam", sample=samples.itertuples()),
expand("ribotish/{sample.condition}-{sample.replicate}-newORFs.tsv_all.txt", sample=samples.itertuples()),
expand("tracks/{sample.method}-{sample.condition}-{sample.replicate}.bw", sample=samples.itertuples()),
"uORFs/merged_uORFs.csv",
"tracks/annotation.bb",
"uORFs/sfactors_lprot.csv",
"uORFs/uORFs_regulation.tsv",
onsuccess:
print("Done, no error")
# Preprocessing
include: "rules/preprocessing.smk"
# Bootstrap
include: "rules/bootstrap.smk"
# Visualization
include: "rules/visualization.smk"
# Ribotish
include: "rules/ribotish.smk"
# uORF-tools
include: "rules/uORF-Tools.smk"