From bf3928eb2ddeb120c8b4db18b405bba3f4bb2c7c Mon Sep 17 00:00:00 2001 From: jessicaw9910 Date: Fri, 19 Jul 2024 13:19:12 -0400 Subject: [PATCH] turned sub-directories into params and removed unnecessary sub-dirs for MultiQC reports --- nextflow/main.nf | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/nextflow/main.nf b/nextflow/main.nf index 0ca9067..d8e61ea 100644 --- a/nextflow/main.nf +++ b/nextflow/main.nf @@ -12,15 +12,25 @@ params.max_memory = "64.GB" params.max_cpus = 12 -params.fastq = "${params.inputDir}${params.fastqFile}" +// sub-directories - only FastQC needs additional sub-dir +params.dirFastQC = "fastqc" +params.dirFastp = "fastqp" +params.dirMultiQC = "multiqc" +params.dirAlignment = "alignment" -params.fastp = "${params.outDir}/fastp/*_{1,2}.fastp*" -params.fastp_json = "${params.outDir}/fastp/*fastp.json" +// fastq +params.fastq = "${params.inputDir}/${params.fastqFile}" -params.fastqc_fastq = "${params.outDir}/fastqc/fastq/*/*" -params.fastqc_fastp = "${params.outDir}/fastqc/fastp/*/*" +// fastp +params.fastp = "${params.outDir}/${params.dirFastp}/*_{1,2}.fastp*" +params.fastp_json = "${params.outDir}/${params.dirFastp}/*fastp.json" -params.bam = "${params.outDir}/alignment/*.Aligned.sortedByCoord.out.bam" +// fastqc +params.fastqc_fastq = "${params.outDir}/${params.dirFastQC}/fastq/*/*" +params.fastqc_fastp = "${params.outDir}/${params.dirFastQC}/fastp/*/*" + +// bam +params.bam = "${params.outDir}/${params.dirAlignment}/*.Aligned.sortedByCoord.out.bam" log.info """\ STAR RNA-Seq NextFlow Pipeline (Reference-Based) @@ -42,20 +52,20 @@ log.info """\ */ // pre-trimming QC fastqc and multiqc -include { RUN_FASTQC as RUN_FASTQC_FASTQ } from './modules/fastqc/main.nf' addParams(OUTPUT: "${params.outDir}/fastqc/fastq") -include { RUN_MULTIQC as RUN_MULTIQC_FASTQ } from './modules/multiqc/main.nf' addParams(OUTPUT: "${params.outDir}/multiqc/fastq") +include { RUN_FASTQC as RUN_FASTQC_FASTQ } from './modules/fastqc/main.nf' addParams(OUTPUT: "${params.outDir}/${params.dirFastQC}/fastq") +include { RUN_MULTIQC as RUN_MULTIQC_FASTQ } from './modules/multiqc/main.nf' addParams(OUTPUT: "${params.outDir}/${params.dirMultiQC}") // trimming with fastp and pre-alignment QC fastqc and multiqc -include { RUN_FASTP } from './modules/fastp/main.nf' addParams(OUTPUT: "${params.outDir}/fastp") -include { RUN_FASTQC as RUN_FASTQC_FASTP } from './modules/fastqc/main.nf' addParams(OUTPUT: "${params.outDir}/fastqc/fastp") -include { RUN_MULTIQC as RUN_MULTIQC_FASTP } from './modules/multiqc/main.nf' addParams(OUTPUT: "${params.outDir}/multiqc/fastp") +include { RUN_FASTP } from './modules/fastp/main.nf' addParams(OUTPUT: "${params.outDir}/${params.dirFastp}") +include { RUN_FASTQC as RUN_FASTQC_FASTP } from './modules/fastqc/main.nf' addParams(OUTPUT: "${params.outDir}/${params.dirFastQC}/fastp") +include { RUN_MULTIQC as RUN_MULTIQC_FASTP } from './modules/multiqc/main.nf' addParams(OUTPUT: "${params.outDir}/${params.dirMultiQC}") // align fastq files using STAR and index -include { STAR_ALIGN } from './modules/star/main.nf' addParams(OUTPUT: "${params.outDir}/alignment") -include { SAMTOOLS_INDEX } from './modules/samtools/main.nf' addParams(OUTPUT: "${params.outDir}/alignment") +include { STAR_ALIGN } from './modules/star/main.nf' addParams(OUTPUT: "${params.outDir}/${params.dirAlignment}") +include { SAMTOOLS_INDEX } from './modules/samtools/main.nf' addParams(OUTPUT: "${params.outDir}/${params.dirAlignment}") // post-alignment multiqc -include { RUN_MULTIQC as RUN_MULTIQC_STAR } from './modules/multiqc/main.nf' addParams(OUTPUT: "${params.outDir}/multiqc/bam") +include { RUN_MULTIQC as RUN_MULTIQC_STAR } from './modules/multiqc/main.nf' addParams(OUTPUT: "${params.outDir}/${params.dirMultiQC}") /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~