-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: mapping QC rule with qualimap + general QC rule for Snakefile * feat: added QC rules for samples with NanoPlot and mapping with Qualimap + corresponding config/config.yml and profile/config.yml * feat: QC-pipeline * fix: wildcards in rule plot_samples * fix: removed unused input statements * feat:qualimap integration * feat: added samstats QC step * fix: added .gtf ref in config + added condisition2 in samples.schema * fix. removed Qualimap because our annotation.gtf is not compatible * fix: removed Qualimap refs + lint * fix: added optional summary dir for NanoPlot in config * fix: rule sam_stats output now overlaps with expected samtools stat output * feat: added branch in rule plot_samples to allow summary files for QC * fix:Indentation in rule plot_samples * fix: removed unwanted merge syntax in Snakefile * fix: linted with snakefmt * fix: clarification on optionality of sequencing summary inclusion for qc * feat: added rule for NanoPlot of all smaples with .fastq files, detached qc rules from snakefile into their own .smk * fix: provided rule for NanoPlot of all samples with resource configuration * fix: corrected env pathing * fix: input for rule plot_all_samples * fix: added aggregate function for rule plot_all_samples * fix: workiinig variable input files * fix: snakefmt and black linting * fix: removed unneeded .gtf requirement * fix: clarified NanoPlot requirements * fix: linting, compression now runs locally * fix: linting * fix: NanoPlot compression: localrule + config for max_cpus + logs for stdout+stderr * fix: linting * fix: import workflowerror * fix: added snakemake.exceptions WorkflowError for linting --------- Co-authored-by: cmeesters <meesters@uni-mainz.de>
- Loading branch information
Showing
10 changed files
with
238 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
import os | ||
|
||
|
||
localrules: | ||
compress_nplot, | ||
compress_nplot_all, | ||
|
||
|
||
configfile: "config/config.yml" | ||
|
||
|
||
inputdir = config["inputdir"] #"/lustre/project/m2_zdvhpc/transcriptome_data/" | ||
|
||
|
||
# QC and metadata with NanoPlot | ||
|
||
if config["summary"] == "None": | ||
sample_QC = ( | ||
(expand("QC/NanoPlot/{sample}.tar.gz", sample=samples["sample"]),), | ||
"QC/NanoPlot/all_samples.tar.gz", | ||
) | ||
else: | ||
sample_QC = "QC/NanoPlot/summary.tar.gz" | ||
|
||
|
||
if config["summary"] == "None": | ||
|
||
rule plot_samples: | ||
input: | ||
fastq=lambda wildcards: get_mapped_reads_input( | ||
samples["sample"][wildcards.sample] | ||
), | ||
output: | ||
directory("NanoPlot/{sample}"), | ||
log: | ||
"logs/NanoPlot/{sample}.log", | ||
resources: | ||
cpus_per_task=min(len({input}), config["max_cpus"]), #problem with max(len(input.fastq),39) | ||
conda: | ||
"../envs/env.yml" | ||
shell: | ||
"mkdir {output}; " | ||
"NanoPlot -t {resources.cpus_per_task} --tsv_stats -f svg " | ||
"--fastq {input.fastq} -o {output} 2> {log}" | ||
|
||
rule plot_all_samples: | ||
input: | ||
aggregate_input(samples["sample"]), | ||
output: | ||
directory("NanoPlot/all_samples"), | ||
log: | ||
"logs/NanoPlot/all_samples.log", | ||
conda: | ||
"../envs/env.yml" | ||
shell: | ||
"mkdir {output}; " | ||
"NanoPlot -t {resources.cpus_per_task} --tsv_stats -f svg " | ||
"--fastq {input} -o {output} 2> {log}" | ||
|
||
rule compress_nplot: | ||
input: | ||
samples=rules.plot_samples.output, | ||
output: | ||
"QC/NanoPlot/{sample}.tar.gz", | ||
log: | ||
"logs/NanoPlot/compress_{sample}.log", | ||
conda: | ||
None | ||
shell: | ||
"tar zcvf {output} {input} &> {log}" | ||
|
||
rule compress_nplot_all: | ||
input: | ||
all_samples=rules.plot_all_samples.output, | ||
output: | ||
"QC/NanoPlot/all_samples.tar.gz", | ||
log: | ||
"logs/NanoPlot/compress_all_samples.log", | ||
conda: | ||
None | ||
shell: | ||
"tar zcvf {output} {input} &> {log}" | ||
|
||
else: | ||
|
||
rule plot_samples: | ||
input: | ||
summary=config["summary"], | ||
output: | ||
directory("NanoPlot"), | ||
log: | ||
"logs/NanoPlot/NanoPlot.log", | ||
conda: | ||
"../envs/env.yml" | ||
shell: | ||
"mkdir {output}; " | ||
"NanoPlot -t {resources.cpus_per_task} --barcoded --tsv_stats " | ||
"--summary {input.summary} -o {output} 2> {log}" | ||
|
||
rule compress_nplot: | ||
input: | ||
samples=rules.plot_samples.output, | ||
output: | ||
"QC/NanoPlot/summary.tar.gz", | ||
log: | ||
"logs/NanoPlot/compress_summary.log", | ||
conda: | ||
None | ||
shell: | ||
"tar zcvf {output} {input} &> {log}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.