Skip to content

Allow prefix in config file #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,20 @@ def get_region(wildcards):

rule all:
input:
expand("methylation_frequency/{region}_{sample}.tsv",
expand("{prefix}methylation_frequency/{region}_{sample}.tsv",
sample=config["fastq"],
region=config["region"])
region=config["region"],
prefix=config.get("prefix", ""))

rule nanopolish_index:
input:
f5 = get_fast5,
fq = get_fastq,
output:
"indices/index_done_{sample}"
"{prefix}indices/index_done_{sample}"
threads: 10 # Just to ensure that this is not ran in parallel for too many samples
log:
"logs/nanopolish_index/index_{sample}.log"
"{prefix}logs/nanopolish_index/index_{sample}.log"
shell:
"""
nanopolish index -d {input.f5}/ {input.fq} 2> {log}
Expand All @@ -45,12 +46,12 @@ rule call_methylation:
bam = get_bam,
genome = config["genome"],
output:
"methylation_calls/{region}_{sample}.tsv"
"{prefix}methylation_calls/{region}_{sample}.tsv"
threads: 8
params:
region = get_region,
log:
"logs/methylation/methcall_{region}_{sample}.log"
"{prefix}logs/methylation/methcall_{region}_{sample}.log"
shell:
"""
nanopolish call-methylation \
Expand All @@ -63,11 +64,11 @@ rule call_methylation:

rule methylation_frequency:
input:
"methylation_calls/{region}_{sample}.tsv"
"{prefix}methylation_calls/{region}_{sample}.tsv"
output:
"methylation_frequency/{region}_{sample}.tsv"
"{prefix}methylation_frequency/{region}_{sample}.tsv"
log:
"logs/methylation/methfreq_{region}_{sample}.log"
"{prefix}logs/methylation/methfreq_{region}_{sample}.log"
params:
script = os.path.join(workflow.basedir, "scripts/calculate_methylation_frequency.py")
shell:
Expand Down
3 changes: 3 additions & 0 deletions config_example.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
prefix:
"analysis_name" # or /path/where/you/want/the/results

genome:
/path/to/database/genome.fa.gz

Expand Down