forked from cfusterot/scASAP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snakefile
49 lines (43 loc) · 1.66 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
import pandas as pd
import os
# -- Snakefile basic configuration -- #
report: "report/workflow.rst"
# Include rule files
include: "rules/common.smk"
# Variable declaration
OUTDIR = config["out"]
LOGDIR = config["log"]
# -- Read samples file -- #
try:
samples = pd.read_csv(config["samples"], sep="\t", comment="#").set_index("sample", drop=False)
validate(samples, schema="schemas/samples.schema.yaml")
except FileNotFoundError:
warning(f"ERROR: the samples file ({config['samples']}) does not exist. Please see the README file for details. Quitting now.")
sys.exit(1)
# -- Read units file -- #
try:
units = pd.read_csv(config["units"], dtype=str, sep="\t", comment="#").set_index(["sample"], drop=False)
validate(units, schema="schemas/units.schema.yaml")
except FileNotFoundError:
warning(f"ERROR: the units file ({config['units']}) does not exist. Please see the README file for details. Quitting now.")
sys.exit(1)
# -- Auxiliary functions -- #
def get_resource(rule,resource):
try:
return config["resources"][rule][resource]
except KeyError:
return config["resources"]["default"][resource]
# -- Final output -- #
rule all:
input:
expand(["{OUTDIR}/{sample}/cellranger_count/cellranger.finish",
"{OUTDIR}/{sample}/qc/multiqc_report.html",
"{OUTDIR}/{sample}/mgatk/final/{sample}.variant_stats.tsv.gz",
"{OUTDIR}/{sample}/amulet/MultipletSummary.txt"
], sample=samples['sample'], OUTDIR=OUTDIR)
# -- Rule files -- #
include: "rules/cellranger.smk"
include: "rules/qc.smk"
include: "rules/mgatk.smk"
include: "rules/amulet.smk"
include: "rules/other.smk"