Skip to content

Commit

Permalink
turned sub-directories into params and removed unnecessary sub-dirs f…
Browse files Browse the repository at this point in the history
…or MultiQC reports
  • Loading branch information
jessicaw9910 committed Jul 19, 2024
1 parent 4fe2b57 commit bf3928e
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions nextflow/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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}")

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit bf3928e

Please sign in to comment.