diff --git a/main.nf b/main.nf index f585d53..4822698 100755 --- a/main.nf +++ b/main.nf @@ -10,10 +10,10 @@ * given `params.foo` specify on the run command line `--foo some_value`. */ -params.reads = "$baseDir/data/ggal/ggal_gut_{1,2}.fq" -params.transcriptome = "$baseDir/data/ggal/ggal_1_48850000_49020000.Ggal71.500bpflank.fa" +params.reads = "${baseDir}/data/ggal/ggal_gut_{1,2}.fq" +params.transcriptome = "${baseDir}/data/ggal/ggal_1_48850000_49020000.Ggal71.500bpflank.fa" params.outdir = "results" -params.multiqc = "$baseDir/multiqc" +params.multiqc = "${baseDir}/multiqc" // import modules @@ -25,15 +25,17 @@ include { MULTIQC } from './modules/multiqc' */ workflow { -log.info """\ + log.info( + """\ R N A S E Q - N F P I P E L I N E =================================== transcriptome: ${params.transcriptome} reads : ${params.reads} outdir : ${params.outdir} """ + ) - read_pairs_ch = channel.fromFilePairs( params.reads, checkIfExists: true ) - RNASEQ( params.transcriptome, read_pairs_ch ) - MULTIQC( RNASEQ.out, params.multiqc ) + read_pairs_ch = channel.fromFilePairs(params.reads, checkIfExists: true) + RNASEQ(params.transcriptome, read_pairs_ch) + MULTIQC(RNASEQ.out, params.multiqc) } diff --git a/modules/fastqc/main.nf b/modules/fastqc/main.nf index 57c0477..68533fe 100644 --- a/modules/fastqc/main.nf +++ b/modules/fastqc/main.nf @@ -1,9 +1,9 @@ params.outdir = 'results' process FASTQC { - tag "FASTQC on $sample_id" + tag "FASTQC on ${sample_id}" conda 'bioconda::fastqc=0.12.1' - publishDir params.outdir, mode:'copy' + publishDir params.outdir, mode: 'copy' input: tuple val(sample_id), path(reads) @@ -13,6 +13,6 @@ process FASTQC { script: """ - fastqc.sh "$sample_id" "$reads" + fastqc.sh "${sample_id}" "${reads}" """ } diff --git a/modules/index/main.nf b/modules/index/main.nf index 1d99b1b..81cfb69 100644 --- a/modules/index/main.nf +++ b/modules/index/main.nf @@ -1,16 +1,15 @@ - process INDEX { - tag "$transcriptome.simpleName" + tag "${transcriptome.simpleName}" conda 'bioconda::salmon=1.10.3' - + input: - path transcriptome + path transcriptome output: - path 'index' + path 'index' script: """ - salmon index --threads $task.cpus -t $transcriptome -i index + salmon index --threads ${task.cpus} -t ${transcriptome} -i index """ } diff --git a/modules/multiqc/main.nf b/modules/multiqc/main.nf index 43d7450..d75cb95 100644 --- a/modules/multiqc/main.nf +++ b/modules/multiqc/main.nf @@ -2,7 +2,7 @@ params.outdir = 'results' process MULTIQC { conda 'bioconda::multiqc=1.27.1' - publishDir params.outdir, mode:'copy' + publishDir params.outdir, mode: 'copy' input: path '*' @@ -13,7 +13,7 @@ process MULTIQC { script: """ - cp $config/* . + cp ${config}/* . echo "custom_logo: \$PWD/nextflow_logo.png" >> multiqc_config.yaml multiqc -n multiqc_report.html . """ diff --git a/modules/quant/main.nf b/modules/quant/main.nf index 7e7286f..b892e70 100644 --- a/modules/quant/main.nf +++ b/modules/quant/main.nf @@ -1,17 +1,16 @@ - process QUANT { - tag "$pair_id" + tag "${pair_id}" conda 'bioconda::salmon=1.10.3' input: - path index - tuple val(pair_id), path(reads) + path index + tuple val(pair_id), path(reads) output: - path pair_id + path pair_id script: """ - salmon quant --threads $task.cpus --libType=U -i $index -1 ${reads[0]} -2 ${reads[1]} -o $pair_id + salmon quant --threads ${task.cpus} --libType=U -i ${index} -1 ${reads[0]} -2 ${reads[1]} -o ${pair_id} """ } diff --git a/modules/rnaseq.nf b/modules/rnaseq.nf index 2f607c1..4109869 100644 --- a/modules/rnaseq.nf +++ b/modules/rnaseq.nf @@ -5,15 +5,15 @@ include { QUANT } from './quant' include { FASTQC } from './fastqc' workflow RNASEQ { - take: + take: transcriptome read_pairs_ch - - main: + + main: INDEX(transcriptome) FASTQC(read_pairs_ch) QUANT(INDEX.out, read_pairs_ch) - emit: - QUANT.out | concat(FASTQC.out) | collect -} \ No newline at end of file + emit: + QUANT.out | concat(FASTQC.out) | collect +} diff --git a/nextflow.config b/nextflow.config index c07d123..9b6727a 100755 --- a/nextflow.config +++ b/nextflow.config @@ -11,9 +11,9 @@ */ manifest { - description = 'Proof of concept of a RNA-seq pipeline implemented with Nextflow' - author = 'Paolo Di Tommaso' - nextflowVersion = '>=23.10.0' + description = 'Proof of concept of a RNA-seq pipeline implemented with Nextflow' + author = 'Paolo Di Tommaso' + nextflowVersion = '>=23.10.0' } /* @@ -30,119 +30,119 @@ params.multiqc = "${projectDir}/multiqc" */ profiles { - standard { - process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' - } - - 'all-reads' { - params.reads = "${projectDir}/data/ggal/ggal_*_{1,2}.fq" - } - - 'arm64' { - process.arch = 'arm64' - } - - 'wave' { - wave.enabled = true - wave.strategy = 'conda' - wave.freeze = true - } - - 'wave-mirror' { - wave.enabled = true - wave.strategy = 'container' - wave.mirror = true - wave.build.repository = 'quay.io' - } - - 'docker' { - process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' - docker.enabled = true - } - - 'singularity' { - process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' - singularity.enabled = true - singularity.autoMounts = true - } - - 'conda' { - conda.enabled = true - conda.channels = 'conda-forge,bioconda' - } - - 'mamba' { - conda.enabled = true - conda.useMicromamba = true - conda.channels = 'conda-forge,bioconda' - } - - 'slurm' { - process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' - process.executor = 'slurm' - singularity.enabled = true - } - - 'batch' { - params.reads = 's3://rnaseq-nf/data/ggal/lung_{1,2}.fq' - params.transcriptome = 's3://rnaseq-nf/data/ggal/transcript.fa' - process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' - process.executor = 'awsbatch' - process.queue = 'nextflow-ci' - workDir = 's3://nextflow-ci/work' - aws.region = 'eu-west-1' - aws.batch.cliPath = '/home/ec2-user/miniconda/bin/aws' - } - - 's3-data' { - process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' - params.reads = 's3://rnaseq-nf/data/ggal/lung_{1,2}.fq' - params.transcriptome = 's3://rnaseq-nf/data/ggal/transcript.fa' - } - - 'google-batch' { - params.transcriptome = 'gs://rnaseq-nf/data/ggal/transcript.fa' - params.reads = 'gs://rnaseq-nf/data/ggal/gut_{1,2}.fq' - params.multiqc = 'gs://rnaseq-nf/multiqc' - process.executor = 'google-batch' - process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' - /* - * replace with your own bucket! - */ - workDir = 'gs://rnaseq-nf/scratch' - google.region = 'europe-west2' - } - - 'gs-data' { - process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' - params.transcriptome = 'gs://rnaseq-nf/data/ggal/transcript.fa' - params.reads = 'gs://rnaseq-nf/data/ggal/gut_{1,2}.fq' - } - - 'azure-batch' { - process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' - workDir = 'az://nf-scratch/work' - process.executor = 'azurebatch' - /* - *place with your own Azure pool name! - */ - process.queue = 'nextflow-ci' - - /* - * make sure the following variables are defined in your environment - * - AZURE_BATCH_ACCOUNT_NAME - * - AZURE_BATCH_ACCOUNT_KEY - * - AZURE_STORAGE_ACCOUNT_NAME - * - AZURE_STORAGE_ACCOUNT_KEY - * see https://www.nextflow.io/docs/latest/azure.html#azure-batch - */ - - azure { - batch { - location = 'westeurope' - autoPoolMode = true - deletePoolsOnCompletion = true - } + standard { + process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' + } + + 'all-reads' { + params.reads = "${projectDir}/data/ggal/ggal_*_{1,2}.fq" + } + + arm64 { + process.arch = 'arm64' + } + + wave { + wave.enabled = true + wave.strategy = 'conda' + wave.freeze = true + } + + 'wave-mirror' { + wave.enabled = true + wave.strategy = 'container' + wave.mirror = true + wave.build.repository = 'quay.io' + } + + docker { + process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' + docker.enabled = true + } + + singularity { + process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' + singularity.enabled = true + singularity.autoMounts = true + } + + conda { + conda.enabled = true + conda.channels = 'conda-forge,bioconda' + } + + mamba { + conda.enabled = true + conda.useMicromamba = true + conda.channels = 'conda-forge,bioconda' + } + + slurm { + process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' + process.executor = 'slurm' + singularity.enabled = true + } + + batch { + params.reads = 's3://rnaseq-nf/data/ggal/lung_{1,2}.fq' + params.transcriptome = 's3://rnaseq-nf/data/ggal/transcript.fa' + process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' + process.executor = 'awsbatch' + process.queue = 'nextflow-ci' + workDir = 's3://nextflow-ci/work' + aws.region = 'eu-west-1' + aws.batch.cliPath = '/home/ec2-user/miniconda/bin/aws' + } + + 's3-data' { + process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' + params.reads = 's3://rnaseq-nf/data/ggal/lung_{1,2}.fq' + params.transcriptome = 's3://rnaseq-nf/data/ggal/transcript.fa' + } + + 'google-batch' { + params.transcriptome = 'gs://rnaseq-nf/data/ggal/transcript.fa' + params.reads = 'gs://rnaseq-nf/data/ggal/gut_{1,2}.fq' + params.multiqc = 'gs://rnaseq-nf/multiqc' + process.executor = 'google-batch' + process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' + /* + * replace with your own bucket! + */ + workDir = 'gs://rnaseq-nf/scratch' + google.region = 'europe-west2' + } + + 'gs-data' { + process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' + params.transcriptome = 'gs://rnaseq-nf/data/ggal/transcript.fa' + params.reads = 'gs://rnaseq-nf/data/ggal/gut_{1,2}.fq' + } + + 'azure-batch' { + process.container = 'docker.io/nextflow/rnaseq-nf:v1.3.1' + workDir = 'az://nf-scratch/work' + process.executor = 'azurebatch' + /* + *place with your own Azure pool name! + */ + process.queue = 'nextflow-ci' + + /* + * make sure the following variables are defined in your environment + * - AZURE_BATCH_ACCOUNT_NAME + * - AZURE_BATCH_ACCOUNT_KEY + * - AZURE_STORAGE_ACCOUNT_NAME + * - AZURE_STORAGE_ACCOUNT_KEY + * see https://www.nextflow.io/docs/latest/azure.html#azure-batch + */ + + azure { + batch { + location = 'westeurope' + autoPoolMode = true + deletePoolsOnCompletion = true + } + } } - } }