diff --git a/seqnado/workflow/rules/qc.smk b/seqnado/workflow/rules/qc.smk index 8424693c..6358bedc 100644 --- a/seqnado/workflow/rules/qc.smk +++ b/seqnado/workflow/rules/qc.smk @@ -93,19 +93,44 @@ use rule samtools_stats as samtools_stats_filtered with: output: stats="seqnado_output/qc/alignment_filtered/{sample}.txt", - -rule multiqc: - input: - expand( +def get_fastqc_files(wildcards): + + + single_end_assays = [name for name in SAMPLE_NAMES if DESIGN.query(name).is_paired == True] + paired_end_assays = [name for name in SAMPLE_NAMES if DESIGN.query(name).is_paired == False] + + fastqc_raw_paired = expand( "seqnado_output/qc/fastqc_raw/{sample}_{read}_fastqc.html", - sample=SAMPLE_NAMES, + sample=paired_end_assays, read=[1, 2], ), - expand( + fastqc_trimmed_paired = expand( "seqnado_output/qc/fastqc_trimmed/{sample}_{read}_fastqc.html", - sample=SAMPLE_NAMES, + sample=paired_end_assays, read=[1, 2], ), + + fastqc_raw_single = expand( + "seqnado_output/qc/fastqc_raw/{sample}_fastqc.html", + sample=single_end_assays, + ), + + fastqc_trimmed_single = expand( + "seqnado_output/qc/fastqc_trimmed/{sample}_fastqc.html", + sample=single_end_assays, + ), + + all_qc_files = [] + for files in [fastqc_raw_paired, fastqc_trimmed_paired, fastqc_raw_single, fastqc_trimmed_single]: + if files: + all_qc_files.extend(files) + + return all_qc_files + + +rule multiqc: + input: + get_fastqc_files, expand("seqnado_output/qc/alignment_raw/{sample}.txt", sample=SAMPLE_NAMES), expand( "seqnado_output/qc/alignment_filtered/{sample}.txt",