diff --git a/Fastp/0.14.1/Fastp.nf b/Fastp/0.14.1/Fastp.nf index 8e1d9405..acb1c93f 100644 --- a/Fastp/0.14.1/Fastp.nf +++ b/Fastp/0.14.1/Fastp.nf @@ -13,7 +13,7 @@ process Fastp { script: //adapted from https://github.com/nf-core/eager/blob/master/LICENSE, Copyright (c) Alexander Peltzer, Stephen Clayton, James A. Fellows Yates, Maxime Borry - if (params.singleEnd) { + if (params.single_end) { """ fastp --in1 ${fastq_files[0]} --out1 "${fastq_files[0].simpleName}.trim.fastq.gz" -j ${sample_id}_fastp.json ${params.optional} """ diff --git a/Fastp/0.20.1/Fastp.nf b/Fastp/0.20.1/Fastp.nf index 90f1b99a..2c6112b9 100644 --- a/Fastp/0.20.1/Fastp.nf +++ b/Fastp/0.20.1/Fastp.nf @@ -13,7 +13,7 @@ process Fastp { script: //adapted from https://github.com/nf-core/eager/blob/master/LICENSE, Copyright (c) Alexander Peltzer, Stephen Clayton, James A. Fellows Yates, Maxime Borry - if (params.singleEnd) { + if (params.single_end) { """ fastp --in1 ${fastq_files[0]} --out1 "${fastq_files[0].simpleName}_trim.fastq.gz" -j ${sample_id}_fastp.json ${params.optional} """ diff --git a/Pandocker/21.02/MarkdownToPdf.nf b/Pandocker/21.02/MarkdownToPdf.nf new file mode 100644 index 00000000..275f6d78 --- /dev/null +++ b/Pandocker/21.02/MarkdownToPdf.nf @@ -0,0 +1,24 @@ +process MarkdownToPdf { + tag {"Pandocker MarkdownToPdf"} + label 'Pandocker_21_02' + label 'Pandocker_21_02_MarkdownToPdf' + + container = 'library://dalibo/pandocker:v21.02' + shell = ['/bin/bash', '-euo', 'pipefail'] + + input: + path(md_file) + + output: + path("${md_file.baseName}.pdf") + + script: + """ + pandoc ${md_file} \ + --variable urlcolor=blue \ + -s \ + --toc \ + -f markdown \ + -o ${md_file.baseName}.pdf + """ +} diff --git a/STARFusion/1.8.1/STARFusion.nf b/STARFusion/1.8.1/STARFusion.nf index 8404928a..e042ffcd 100644 --- a/STARFusion/1.8.1/STARFusion.nf +++ b/STARFusion/1.8.1/STARFusion.nf @@ -17,7 +17,7 @@ process STARFusion { script: //Adapted code from: https://github.com/nf-core/rnafusion - MIT License - Copyright (c) Martin Proks def avail_mem = task.memory ? "--limitGenomeGenerateRAM ${task.memory.toBytes() - 100000000}" : '' - def read_args = params.singleEnd ? "--left_fq ${fastq_files[0]}" : "--left_fq ${fastq_files[0]} --right_fq ${fastq_files[1]}" + def read_args = params.single_end ? "--left_fq ${fastq_files[0]}" : "--left_fq ${fastq_files[0]} --right_fq ${fastq_files[1]}" """ STAR \ --genomeDir ${star_index} \ diff --git a/Salmon/1.2.1/Quant.nf b/Salmon/1.2.1/Quant.nf index 0093d7ba..e88a8232 100644 --- a/Salmon/1.2.1/Quant.nf +++ b/Salmon/1.2.1/Quant.nf @@ -14,13 +14,13 @@ process Quant { script: //Adapted code from: https://github.com/nf-core/rnaseq - MIT License - Copyright (c) Phil Ewels, Rickard Hammarén - def rnastrandness = params.singleEnd ? 'U' : 'IU' + def rnastrandness = params.single_end ? 'U' : 'IU' if (params.stranded && !params.unstranded) { - rnastrandness = params.singleEnd ? 'SF' : 'ISF' + rnastrandness = params.single_end ? 'SF' : 'ISF' } else if (params.revstranded && !params.unstranded) { - rnastrandness = params.singleEnd ? 'SR' : 'ISR' + rnastrandness = params.single_end ? 'SR' : 'ISR' } - def endedness = params.singleEnd ? "-r ${fastq_files[0]}" : "-1 ${fastq_files[0]} -2 ${fastq_files[1]}" + def endedness = params.single_end ? "-r ${fastq_files[0]}" : "-1 ${fastq_files[0]} -2 ${fastq_files[1]}" def unmapped = params.saveUnaligned ? "--writeUnmappedNames" : '' """ diff --git a/SortMeRNA/4.2.0/SortMeRNA.nf b/SortMeRNA/4.2.0/SortMeRNA.nf index 16215c05..ed244bc0 100644 --- a/SortMeRNA/4.2.0/SortMeRNA.nf +++ b/SortMeRNA/4.2.0/SortMeRNA.nf @@ -17,7 +17,7 @@ process SortMeRNA { script: def Refs = db_fasta.collect{ "$it" }.join(" -ref ") def report_title = fastq_files[0].simpleName.split("_R1_")[0] - if (params.singleEnd) { + if (params.single_end) { """ sortmerna -ref ${Refs} \ -reads ${fastq_files} \ @@ -31,6 +31,8 @@ process SortMeRNA { gzip -f < non-rRNA-reads.fastq > ${fastq_files[0].simpleName}_non_rRNA.fastq.gz gzip -f < rRNA-reads.fastq > ${fastq_files[0].simpleName}_filtered_rRNA.fastq.gz mv rRNA-reads.log ${report_title}_rRNA_report.txt + rm non-rRNA-reads.fastq + rm rRNA-reads.fastq """ } else { """ @@ -49,6 +51,10 @@ process SortMeRNA { gzip < rRNA-reads_fwd.fastq > ${fastq_files[0].simpleName}_filtered_rRNA.fastq.gz gzip < rRNA-reads_rev.fastq > ${fastq_files[1].simpleName}_filtered_rRNA.fastq.gz mv rRNA-reads.log ${report_title}_rRNA_report.txt + rm non-rRNA-reads_fwd.fastq + rm non-rRNA-reads_rev.fastq + rm rRNA-reads_fwd.fastq + rm rRNA-reads_rev.fastq """ } } diff --git a/SortMeRNA/4.3.3/SortMeRNA.nf b/SortMeRNA/4.3.3/SortMeRNA.nf new file mode 100755 index 00000000..ba669781 --- /dev/null +++ b/SortMeRNA/4.3.3/SortMeRNA.nf @@ -0,0 +1,55 @@ +process SortMeRNA { + tag {"SortMeRNA ${sample_id}"} + label 'SortMeRNA_4_3_3' + container = 'quay.io/biocontainers/sortmerna:4.3.3--h9ee0642_0' + shell = ['/bin/bash', '-euo', 'pipefail'] + + input: + tuple(sample_id, rg_id, path(fastq_files)) + path(db_fasta) + + output: + tuple(sample_id, rg_id, path("*_non_rRNA.fastq.gz"), emit: non_rRNA_fastqs) + path("*_filtered_rRNA.fastq.gz", emit: rRNA_fastqs) + path("*_rRNA_report.txt", emit: qc_report) + + script: + def refs = db_fasta.collect{ "$it" }.join(" -ref ") + def report_title = fastq_files[0].simpleName.split("_R1_")[0] + if (params.single_end) { + """ + sortmerna -ref ${refs} \ + -reads ${fastq_files} \ + --num_alignments 1 \ + --threads ${task.cpus} \ + --fastx \ + -workdir \${PWD} \ + --aligned rRNA-reads \ + --other non-rRNA-reads \ + --zip-out + + mv non-rRNA-reads.fq.gz ${fastq_files[0].simpleName}_non_rRNA.fastq.gz + mv rRNA-reads.fq.gz ${fastq_files[0].simpleName}_filtered_rRNA.fastq.gz + mv rRNA-reads.log ${report_title}_rRNA_report.txt + """ + } else { + """ + sortmerna -ref ${refs} \ + -reads ${fastq_files[0]} -reads ${fastq_files[1]} \ + --num_alignments 1 \ + --threads ${task.cpus} \ + -workdir \${PWD} \ + --fastx -paired_in \ + --aligned rRNA-reads \ + --other non-rRNA-reads \ + -out2 \ + --zip-out + + mv non-rRNA-reads_fwd.fq.gz ${fastq_files[0].simpleName}_non_rRNA.fastq.gz + mv non-rRNA-reads_rev.fq.gz ${fastq_files[1].simpleName}_non_rRNA.fastq.gz + mv rRNA-reads_fwd.fq.gz ${fastq_files[0].simpleName}_filtered_rRNA.fastq.gz + mv rRNA-reads_rev.fq.gz ${fastq_files[1].simpleName}_filtered_rRNA.fastq.gz + mv rRNA-reads.log ${report_title}_rRNA_report.txt + """ + } +} diff --git a/Subread/2.0.0/FeatureCounts.nf b/Subread/2.0.0/FeatureCounts.nf index 0392a587..32aad9b8 100644 --- a/Subread/2.0.0/FeatureCounts.nf +++ b/Subread/2.0.0/FeatureCounts.nf @@ -21,7 +21,7 @@ process FeatureCounts { def bam_list = bam_file.collect{ "$it" }.join(" ") def biotype = params.gencode ? "gene_type" : params.fc_group_features_type def extraAttributes = params.fc_extra_attributes ? "--extraAttributes ${params.fc_extra_attributes}" : '' - def fragment_mode = !params.singleEnd ? "-p": '' + def fragment_mode = !params.single_end ? "-p": '' //Get strandedness def featureCounts_direction = 0 if (params.stranded && !params.unstranded) { diff --git a/TrimGalore/0.6.5/TrimGalore.nf b/TrimGalore/0.6.5/TrimGalore.nf index 184e9482..66b8b332 100644 --- a/TrimGalore/0.6.5/TrimGalore.nf +++ b/TrimGalore/0.6.5/TrimGalore.nf @@ -13,7 +13,7 @@ process TrimGalore { path("*_fastqc.{zip,html}", optional: true, emit: fastqc_report) script: - if (params.singleEnd) { + if (params.single_end) { """ trim_galore ${fastq_files} --gzip ${params.optional} mv ${fastq_files[0].simpleName}_trimmed.fq.gz ${fastq_files[0].simpleName}_trimmed.fastq.gz diff --git a/Utils/MergeFastqLanes.nf b/Utils/MergeFastqLanes.nf index 56bb746f..6ae29345 100644 --- a/Utils/MergeFastqLanes.nf +++ b/Utils/MergeFastqLanes.nf @@ -14,7 +14,7 @@ process MergeFastqLanes { barcode = rg_id.split('_')[1] def R1_pattern="${sample_id}_*_S*_L00*_R1_001*.fastq.gz" def R2_pattern="${sample_id}_*_S*_L00*_R2_001*.fastq.gz" - if (params.singleEnd) { + if (params.single_end) { """ cat \$( ls ${R1_pattern} | sort | paste \$(printf "%0.s- " \$(seq 1 \$( ls ${R1_pattern} | wc -l)))) > ${sample_id}_${barcode}_merged_R1.fastq.gz """ diff --git a/Utils/workflow.nf b/Utils/workflow.nf new file mode 100644 index 00000000..3e9dcda9 --- /dev/null +++ b/Utils/workflow.nf @@ -0,0 +1,16 @@ +process ExportParams { + tag {"Workflow Export Params"} + label 'Workflow_Export_Params' + shell = ['/bin/bash', '-euo', 'pipefail'] + cache = false //Disable cache to force a new export when restarting the workflow. + + output: + path("workflow_params.txt") + + script: + def workflow_params = params.collect{param -> "$param.key\t$param.value"}.sort().join("\n") + """ + echo -e "param\tvalue" > workflow_params.txt + echo -e "${workflow_params}" >> workflow_params.txt + """ +}