diff --git a/rules/rawQC.smk b/rules/rawQC.smk index 0f1997c89408e1413d1dbc1cda55898982c9a5d3..b835d0f9592874a788ebb484bf3c4f117023e096 100644 --- a/rules/rawQC.smk +++ b/rules/rawQC.smk @@ -5,7 +5,7 @@ Description: rules for QC and pre-processing of paired-end shotgun DNA metagenomic sequencing. ''' localrules: - multiqc_raw_listing_files, + multiqc_raw_list_files, multiqc_raw ##---------------------------------------------------------------------------## @@ -33,22 +33,24 @@ rule fastqc_raw: fastqc_zip = RAW_QC_DIR+'/{dataset}_fastqc/{fastq_file}_fastqc.zip' threads: cpus_avail singularity: singularity_img + message: + "Executing FatQC on {input} with {threads} threads and using {params.samplerate} times total reads." shell: ''' - # Take a random sample of reads (1%) and process them with fastQC + # Take a random sample of reads and process them with fastQC (reformat.sh in={input} out=stdout.fq samplerate={params.samplerate} | \ fastqc -o {params.fastqc_dir}/{wildcards.dataset}_fastqc -f fastq \ -t {threads} stdin:{wildcards.fastq_file}) 2> {log} ''' # List files for MultiQC -rule multiqc_raw_listing_files: +rule multiqc_raw_list_files: input: - #all fastqc zip files in a dataset + #all fastqc zip files per dataset fastqcs=lambda wildcards: ['{}/{}_fastqc/{}_fastqc.zip'.format(RAW_QC_DIR, value, FASTQS[ix]) for ix,value in enumerate(DATASETSX) if value==wildcards.dataset] output: - multiqc_input_list = RAW_QC_DIR+'/{dataset}_multiqc_inputs.txt' + multiqc_input_list = RAW_QC_REPORT+'/{dataset}_multiqc_inputs.txt' run: import os try: @@ -59,10 +61,11 @@ rule multiqc_raw_listing_files: with open(output.multiqc_input_list, mode='w', encoding='utf-8') as out: for item in input.fastqcs: out.write("%s\n" % item) -# + +# Run MultiQC on all FastQC eports rule multiqc_raw: input: - RAW_QC_DIR+'/{dataset}_multiqc_inputs.txt' + RAW_QC_REPORT + '/{dataset}_multiqc_inputs.txt' output: multiqc_report = report(RAW_QC_REPORT + '/{dataset}_multiqc.html', category='rawQC')