Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .test/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ mapping_stats:
genome_size: 1000
extra: ""
deeptools_plotcoverage:
extra: ""
extra: "--numberOfSamples 10000 --skipZeros --coverageThresholds 1"

variant_calling:
tool: "freebayes"
Expand Down
2 changes: 1 addition & 1 deletion config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ mapping_stats:
genome_size: 1000
extra: ""
deeptools_plotcoverage:
extra: ""
extra: "--numberOfSamples 10000 --skipZeros --coverageThresholds 1"

variant_calling:
tool: "freebayes"
Expand Down
2 changes: 2 additions & 0 deletions config/schemas/config.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,13 @@ properties:
extra:
type: string
description: additional arguments to pass to DeepTools plotCoverage
default: "--numberOfSamples 10000 --skipZeros --coverageThresholds 1"
required:
- gffread
- rseqc_infer_experiment
- rseqc_bam_stat
- deeptools_coverage
- deeptools_plotcoverage
variant_calling:
type: object
properties:
Expand Down
3 changes: 2 additions & 1 deletion workflow/rules/bowtie2.smk
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ rule bowtie2_build:
rule bowtie2_align:
input:
sample=expand(
"results/fastp/{{sample}}_{read}.fastq.gz",
"results/{tool}/{{sample}}_{read}.fastq.gz",
read=["read1", "read2"] if is_paired_end() else ["read1"],
tool=config["processing"]["tool"],
),
idx=rules.bowtie2_build.output,
output:
Expand Down
3 changes: 2 additions & 1 deletion workflow/rules/bwamem2.smk
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ rule bwa_mem2_index:
rule bwa_mem2:
input:
reads=expand(
"results/fastp/{{sample}}_{read}.fastq.gz",
"results/{tool}/{{sample}}_{read}.fastq.gz",
read=["read1", "read2"] if is_paired_end() else ["read1"],
tool=config["processing"]["tool"],
),
idx=rules.bwa_mem2_index.output,
output:
Expand Down
22 changes: 21 additions & 1 deletion workflow/rules/common.smk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# import basic packages
import pandas as pd
from snakemake.utils import validate
from snakemake.logging import logger
from pathlib import Path

# read sample sheet
Expand Down Expand Up @@ -86,8 +87,9 @@ def get_multiqc_input(wildcards):
tool=config["mapping"]["tool"],
)
result += expand(
"results/fastp/{sample}.json",
"results/{tool}/{sample}.json",
sample=samples.index,
tool=config["processing"]["tool"],
)
result += expand(
"results/rseqc/{tool}/{sample}.txt",
Expand Down Expand Up @@ -120,3 +122,21 @@ def get_multiqc_input(wildcards):
),
)
return result


# stop workflow when paired-end reads are used as input for fastplong
if is_paired_end() and config["processing"]["tool"] == "fastplong":
Comment thread
m-jahn marked this conversation as resolved.
config["processing"]["tool"] = "fastp"
logger.warning(
"\nWARNING: fastplong cannot be used with paired-end reads in this workflow.\n"
+ "Fastp will be used as a replacement.\n"
+ "Please consult the fastplong documentation for details.\n"
)

# trigger warning when paired-end reads are used with minimap2
if is_paired_end() and config["mapping"]["tool"] == "minimap2":
logger.warning(
"\nWARNING: minimap2 is being used with paired-end reads.\n"
+ "This is possible but may require additional parameters to run.\n"
+ "Please consult the minimap2 documentation for details.\n"
)
2 changes: 1 addition & 1 deletion workflow/rules/mapping_stats.smk
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,6 @@ rule deeptools_plotcoverage:
"results/deeptools/coverage/{sample}_coverage.log",
threads: 4
params:
extra="--coverageThresholds 1",
extra=config["mapping_stats"]["deeptools_plotcoverage"]["extra"],
wrapper:
Comment thread
m-jahn marked this conversation as resolved.
"v5.6.0/bio/deeptools/plotcoverage"
3 changes: 2 additions & 1 deletion workflow/rules/minimap2.smk
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ rule minimap2_align:
input:
target=rules.minimap2_index.output.index,
query=expand(
"results/fastp/{{sample}}_{read}.fastq.gz",
"results/{tool}/{{sample}}_{read}.fastq.gz",
read=["read1", "read2"] if is_paired_end() else ["read1"],
tool=config["processing"]["tool"],
),
output:
"results/minimap2/align/{sample}/mapped.bam",
Expand Down
14 changes: 12 additions & 2 deletions workflow/rules/star.smk
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,18 @@ rule star_index:

rule star_align:
input:
fq1="results/fastp/{sample}_read1.fastq.gz",
fq2="results/fastp/{sample}_read2.fastq.gz" if is_paired_end() else [],
fq1=expand(
"results/{tool}/{{sample}}_read1.fastq.gz",
tool=config["processing"]["tool"],
),
fq2=(
expand(
"results/{tool}/{{sample}}_read2.fastq.gz",
tool=config["processing"]["tool"],
)
if is_paired_end()
else []
),
idx=rules.star_index.output,
output:
aln="results/star/align/{sample}/mapped.bam",
Expand Down
Loading