Skip to content
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

feat: qc rules #16

Merged
merged 35 commits into from
Jun 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b9c8fad
feat: mapping QC rule with qualimap + general QC rule for Snakefile
yeising Apr 5, 2024
533f98a
feat: added QC rules for samples with NanoPlot and mapping with Quali…
yeising Apr 8, 2024
f4438d0
feat: QC-pipeline
yeising Apr 24, 2024
4504241
fix: wildcards in rule plot_samples
yeising Apr 28, 2024
f29b44b
fix: removed unused input statements
cmeesters Apr 29, 2024
a39ae8b
feat:qualimap integration
yeising Apr 29, 2024
00f869a
feat: added samstats QC step
yeising Apr 30, 2024
9e6ca47
merged with main
yeising Apr 30, 2024
c6808c5
fix: added .gtf ref in config + added condisition2 in samples.schema
yeising Apr 30, 2024
9e623af
Merge branch 'main' into feat-QC-rules
yeising Apr 30, 2024
a7a7ed1
fix. removed Qualimap because our annotation.gtf is not compatible
yeising May 3, 2024
0f4de07
fix: removed Qualimap refs + lint
yeising May 3, 2024
60e1dab
fix: added optional summary dir for NanoPlot in config
yeising May 3, 2024
49ddad6
fix: rule sam_stats output now overlaps with expected samtools stat o…
yeising May 8, 2024
7b3266a
feat: added branch in rule plot_samples to allow summary files for QC
yeising May 8, 2024
8ba2299
fix:Indentation in rule plot_samples
yeising May 8, 2024
2bb6269
Merge branch 'feat-QC-rules' of /~https://github.com/snakemake-workflow…
yeising May 8, 2024
008ae15
fix: removed unwanted merge syntax in Snakefile
yeising May 8, 2024
5c06cce
fix: linted with snakefmt
yeising May 8, 2024
b3b801e
fix: clarification on optionality of sequencing summary inclusion for qc
yeising May 21, 2024
0eb6409
feat: added rule for NanoPlot of all smaples with .fastq files, detac…
yeising May 21, 2024
ee19385
fix: provided rule for NanoPlot of all samples with resource configur…
yeising May 21, 2024
5e14bfd
fix: corrected env pathing
yeising May 22, 2024
4b01dc5
fix: input for rule plot_all_samples
yeising Jun 3, 2024
e511e9a
fix: added aggregate function for rule plot_all_samples
yeising Jun 3, 2024
d887b0a
fix: workiinig variable input files
yeising Jun 3, 2024
5aa32d5
fix: snakefmt and black linting
yeising Jun 3, 2024
bf1fde0
fix: removed unneeded .gtf requirement
yeising Jun 5, 2024
63f7f89
fix: clarified NanoPlot requirements
yeising Jun 5, 2024
e38de7d
fix: linting, compression now runs locally
yeising Jun 5, 2024
6e47dee
fix: linting
yeising Jun 5, 2024
96c8aa3
fix: NanoPlot compression: localrule + config for max_cpus + logs for…
yeising Jun 5, 2024
724035f
fix: linting
yeising Jun 5, 2024
763992a
fix: import workflowerror
yeising Jun 5, 2024
0e0a472
fix: added snakemake.exceptions WorkflowError for linting
yeising Jun 5, 2024
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
20 changes: 11 additions & 9 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ configfile: "config/config.yml"
include: "rules/commons.smk"
include: "rules/utils.smk"

inputdir = config["inputdir"]

inputdir = config["inputdir"]


rule all:
Expand All @@ -39,7 +39,7 @@ rule all:
de_heatmap="de_analysis/heatmap.svg",
lfc_analysis="de_analysis/lfc_analysis.csv",
sample_QC=expand("QC/NanoPlot/{sample}.tar.gz", sample=samples["sample"]),
samstats=expand("QC/samstats/{sample}.txt", sample=samples["sample"])
samstats=expand("QC/samstats/{sample}.txt", sample=samples["sample"]),


rule build_minimap_index: ## build minimap2 index
Expand Down Expand Up @@ -82,27 +82,30 @@ rule map_reads:
"""


#QC and metadata with NanoPlot
# QC and metadata with NanoPlot
if config["summary"] == "None":

rule plot_samples:
input:
fastq=lambda wildcards: get_mapped_reads_input(
samples["sample"][wildcards.sample]
),
output:
directory("NanoPlot/{sample}")
directory("NanoPlot/{sample}"),
log:
"logs/NanoPlot/{sample}.log",
resources:
## max of 39 for our SLURM partition
cpus_per_task= min(8,39) #problem with max(len(input.fastq),39)
cpus_per_task=min(8, 39), #problem with max(len(input.fastq),39)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cpus_per_task=min(len(input.fastq), config["max_cpus_in_default_partition/PC/
Server"])

vielleicht den Parameter anders nennen? ;-)

conda:
"envs/env.yml"
shell:
"mkdir {output}; "
"NanoPlot -t {resources.cpus_per_task} --tsv_stats -f svg "
"--fastq {input.fastq} -o {output} 2> {log}"

else:

rule plot_samples:
input:
summary=config["summary"],
Expand All @@ -122,9 +125,9 @@ rule compress_nplot:
input:
samples=rules.plot_samples.output,
output:
"QC/NanoPlot/{sample}.tar.gz"
"QC/NanoPlot/{sample}.tar.gz",
log:
"logs/NanoPlot/compress_{sample}.log"
"logs/NanoPlot/compress_{sample}.log",
shell:
"tar zcvf {output} {input} 2> {log}"

cmeesters marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -164,7 +167,7 @@ rule sam_stats:
output:
"QC/samstats/{sample}.txt",
log:
"logs/samtools/samstats_{sample}.log"
"logs/samtools/samstats_{sample}.log",
conda:
"envs/env.yml"
shell:
Expand Down Expand Up @@ -204,7 +207,6 @@ rule merge_counts:
"scripts/merge_count_tsvs.py"



rule write_coldata:
output:
coldata="de_analysis/coldata.tsv",
Expand Down
Loading