Skip to content
2 changes: 1 addition & 1 deletion Fastp/0.14.1/Fastp.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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}
"""
Expand Down
2 changes: 1 addition & 1 deletion Fastp/0.20.1/Fastp.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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}
"""
Expand Down
24 changes: 24 additions & 0 deletions Pandocker/21.02/MarkdownToPdf.nf
Original file line number Diff line number Diff line change
@@ -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
"""
}
2 changes: 1 addition & 1 deletion STARFusion/1.8.1/STARFusion.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand Down
8 changes: 4 additions & 4 deletions Salmon/1.2.1/Quant.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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" : ''

"""
Expand Down
8 changes: 7 additions & 1 deletion SortMeRNA/4.2.0/SortMeRNA.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand All @@ -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 {
"""
Expand All @@ -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
"""
}
}
55 changes: 55 additions & 0 deletions SortMeRNA/4.3.3/SortMeRNA.nf
Original file line number Diff line number Diff line change
@@ -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
"""
}
}
2 changes: 1 addition & 1 deletion Subread/2.0.0/FeatureCounts.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion TrimGalore/0.6.5/TrimGalore.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Utils/MergeFastqLanes.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down
16 changes: 16 additions & 0 deletions Utils/workflow.nf
Original file line number Diff line number Diff line change
@@ -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
"""
}