Commit f16a49c1 authored by van den Berg's avatar van den Berg
Browse files

Clean up input for rule 'all'

parent 383b838f
......@@ -50,35 +50,13 @@ rule all:
multiqc = "multiqc_report/multiqc_report.html",
stats = "stats.json",
stats_tsv = "stats.tsv",
bam = expand("{sample}/bams/{sample}.bam",
vcfs = expand("{sample}/vcf/{sample}.vcf.gz",
vcf_tbi = expand("{sample}/vcf/{sample}.vcf.gz.tbi",
gvcfs = expand("{sample}/vcf/{sample}.g.vcf.gz",
gvcf_tbi = expand("{sample}/vcf/{sample}.g.vcf.gz.tbi",
fastqc_raw = (f"{sample}/pre_process/raw-{sample}-{read_group}/.done"
for read_group, sample in get_readgroup_per_sample()),
fastqc_trim = (f"{sample}/pre_process/trimmed-{sample}-{read_group}/.done"
for read_group, sample in get_readgroup_per_sample()),
cutadapt = (f"{sample}/pre_process/{sample}-{read_group}.txt"
for read_group, sample in get_readgroup_per_sample()),
bam = expand("{s}/bams/{s}.bam", s=config["samples"]),
vcfs = expand("{s}/vcf/{s}.vcf.gz", s=config["samples"]),
vcf_tbi = expand("{s}/vcf/{s}.vcf.gz.tbi", s=config["samples"]),
gvcfs = expand("{s}/vcf/{s}.g.vcf.gz", s=config["samples"]),
gvcf_tbi = expand("{s}/vcf/{s}.g.vcf.gz.tbi", s=config["samples"]),
coverage_stats = coverage_stats,
coverage_files = (f"{sample}/vcf/{sample}_{threshold}.bed"
for sample, threshold in itertools.product(
config['samples'], config['coverage_threshold'])
) if 'coverage_threshold' in config else []
coverage_files = coverage_files
rule create_markdup_tmp:
"""Create tmp directory for mark duplicates"""
......@@ -15,14 +15,14 @@ containers = {
"vtools": "docker://"
def set_default(key, value):
"""Set default config values"""
if key not in config:
config[key] = value
def process_config():
""" Process the config file and set the default values """
def set_default(key, value):
"""Set default config values"""
if key not in config:
config[key] = value
# Read the json schema
with open(srcdir('config/schema.json'), 'rt') as fin:
schema = json.load(fin)
......@@ -60,3 +60,21 @@ def process_config():
set_default("stats_to_tsv", srcdir("src/"))
set_default("py_wordcount", srcdir("src/"))
set_default("cutadapt_summary", srcdir("src/"))
def coverage_files(wildcards):
""" Return a list of all coverage files
The coverage is calculated for each sample, for each specified threshold
# We only calculate the coverage when this is specified in the
# configuration
if 'coverage_threshold' not in config:
return list()
samples = config['samples']
thresholds = config['coverage_threshold']
files = list()
for sample, threshold in itertools.product(samples, thresholds):
return files
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment