Skip to content
Open
18 changes: 18 additions & 0 deletions AGAT/0.8.1/ConvertGffToGtf.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
process ConvertGffToGtf {
tag {"AGAT ConvertGffToGtf ${gff}"}
label 'AGAT_0_8_1'
label 'AGAT_0_8_1_ConvertGffToGtf'
container = 'quay.io/biocontainers/agat:0.8.1--pl5262hdfd78af_0'
shell = ['/bin/bash', '-euo', 'pipefail']

input:
path(gff)

output:
path("${gff.simpleName}.gtf", emit: gtf)

script:
"""
agat_convert_sp_gff2gtf.pl -gff ${gff} -o ${gff.simpleName}.gtf
"""
}
10 changes: 5 additions & 5 deletions BCFtools/1.10.2/View.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ process View_bcf_vcf {
shell = ['/bin/bash', '-euo', 'pipefail']

input:
tuple(val(sample_id), file(bcf_file))
tuple(val(sample_id), file(bcf_file))

output:
tuple(val(sample_id), file("${bcf_file.baseName}.vcf"))
tuple(val(sample_id), file("${bcf_file.baseName}.vcf"))

script:
"""
bcftools view ${params.optional} ${bcf_file} > ${bcf_file.baseName}.vcf
"""
"""
bcftools view ${params.optional} ${bcf_file} > ${bcf_file.baseName}.vcf
"""
}
20 changes: 20 additions & 0 deletions BCFtools/1.17/View.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
process View_bcf_vcf {
// BCFtools view can use different input and output files, this process converts bcf to vcf files.
tag {"BCFtools View_BCF_VCF ${sample_id}"}
label 'BCFtools_1_17'
label 'BCFtools_1_17_View_BCF_VCF'
container = 'quay.io/biocontainers/bcftools:1.17--h3cc50cf_1'
shell = ['/bin/bash', '-euo', 'pipefail']

input:
tuple(val(sample_id), file(input_file))

output:
tuple(val(sample_id), file("${input_file.baseName}.${extension}"))

script:
extension = input_file.getExtension() == "vcf" ? "bcf" : "vcf"
"""
bcftools view ${params.optional} ${input_file} > ${input_file.baseName}.${extension}
"""
}
18 changes: 18 additions & 0 deletions BWA-Mem2/bwa-mem2_samtools-1.12_2.2.1/BWASW.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
process BWASW {
tag {"BWA_MEM2 BWASW ${sample_id} - ${rg_id}"}
label 'BWA_MEM2_2_2_1'
label 'BWA_MEM2_2_2_1_BWASW'
container = 'blcdsdockerregistry/bwa-mem2_samtools-1.12:2.2.1'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need an container with samtools? Maybe just use bwa biocontainer?

shell = ['/bin/bash', '-euo', 'pipefail']

input:
tuple(val(sample_id), val(rg_id), path(fastq))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rg_id not used?


output:
tuple(val(sample_id), val(rg_id_), path("${fastq[0].simpleName}.sam"), emit: sam_file)

script:
"""
bwa-mem2 bwasw -t ${task.cpus} ${params.optional} ${params.genome} ${fastq} > ${fastq[0].simpleName}.sam
"""
}
22 changes: 22 additions & 0 deletions BWA-Mem2/bwa-mem2_samtools-1.12_2.2.1/Index.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
index_loc = file("${params.genome_fasta}").toRealPath().toString().split("/")[0..-2].join("/")

process Index {
tag {"BWA_MEM2 Index $fasta"}
label 'BWA_MEM2_2_2_1'
label 'BWA_MEM2_2_2_1_Index'
container = 'library://blcdsdockerregistry/bwa-mem2_samtools-1.12:2.2.1'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment on BWASW.

shell = ['/bin/bash', '-euo', 'pipefail']

storeDir = index_loc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should configure cache in config files not in code.


input:
path(fasta)

output:
path("${fasta}.{alt,amb,ann,bwt,pac,sa}", emit: bwa_index)

script:
"""
bwa-mem2 index $params.optional $fasta
"""
}
21 changes: 21 additions & 0 deletions BWA-Mem2/bwa-mem2_samtools-1.12_2.2.1/MEM.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
process MEM {
tag {"BWA_MEM2 MEM ${sample_id} - ${rg_id}"}
label 'BWA_MEM2_2_2_1'
label 'BWA_MEM2_2_2_1_MEM'
container = 'quay.io/blcdsdockerregistry/bwa-mem2_samtools-1.12:2.2.1'
shell = ['/bin/bash', '-euo', 'pipefail']

input:
tuple(val(sample_id), val(rg_id), path(fastq))

output:
tuple(val(sample_id), val(rg_id), path("${fastq[0].simpleName}.sam"), emit: sam_file)

script:
def barcode = rg_id.split('_')[1]
def readgroup = "\"@RG\\tID:${rg_id}\\tSM:${sample_id}\\tPL:ILLUMINA\\tLB:${sample_id}\\tPU:${barcode}\""

"""
bwa-mem2 mem -t ${task.cpus} -R ${readgroup} ${params.optional} ${params.genome} ${fastq} > ${fastq[0].simpleName}.sam
"""
}
23 changes: 23 additions & 0 deletions BWA-Mem2/bwa-mem2_samtools-1.12_2.2.1/Mapping.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
process BWAMapping {
tag {"BWA_MEM2 Mem ${sample_id} - ${rg_id}"}
label 'BWA_MEM2_2_2_1'
label 'BWA_MEM2_2_2_1_Mem'
container = 'library://blcdsdockerregistry/bwa-mem2_samtools-1.12:2.2.1'
shell = ['/bin/bash', '-euo', 'pipefail']

input:
tuple(val(sample_id), val(rg_id), path(fastq))

output:
tuple(val(sample_id), val(rg_id), path("${rg_id}_sorted.bam"), path("${rg_id}_sorted.bai"), emit: mapped_bams)

script:
def barcode = rg_id.split('_')[1]
def bwa_readgroup = "\"@RG\\tID:${rg_id}\\tSM:${sample_id}\\tPL:ILLUMINA\\tLB:${sample_id}\\tPU:${barcode}\""

"""
bwa-mem2 mem $params.optional -t ${task.cpus} -R $bwa_readgroup $params.genome_fasta $fastq | \
samtools sort > ${rg_id}_sorted.bam
samtools index ${rg_id}_sorted.bam ${rg_id}_sorted.bai
"""
}
18 changes: 18 additions & 0 deletions ControlFREEC/11.6/AssessSignificance.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
process AssessSignificance {
tag {"Control Freec AssessSignificance ${sample_id}"}
label 'ControlFreec_11_6'
label 'ControlFreec_11_6_AssessSignificance'
container = 'quay.io/biocontainers/control-freec:11.6--h87f3376_2'
shell = ['/bin/bash', '-euo', 'pipefail']

input:
tuple(val(sample_id), path(ratio_file), path(cnv_file))

output:
tuple(val(sample_id), path("${cnv_file.name}.p.value.txt"), emit: cnv_pvalue)

script:
"""
cat /usr/local/bin/assess_significance.R | R --slave --args ${cnv_file} ${ratio_file}
"""
}
35 changes: 35 additions & 0 deletions ControlFREEC/11.6/Freec.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
process Freec {
tag {"Control Freec ${sample_id}"}
label 'ControlFreec_11_6'
label 'ControlFreec_11_6_Freec'
container = 'quay.io/biocontainers/control-freec:11.6--h87f3376_2'
shell = ['/bin/bash', '-euo', 'pipefail']

input:
tuple(val(sample_id), path(bam_file), path(bai_file))

output:
tuple(val(sample_id), path("${bam_file.name}_ratio.txt"), path("${bam_file.name}_CNVs"), emit: cnv)
tuple(val(sample_id), path("${bam_file.name}_sample.cpn"), path("${bam_file.name}_ratio.BedGraph"), path("${bam_file.name}_info.txt"), emit: other)

script:
def config = "${sample_id}.config"
"""
touch ${config}
echo "[general]" >> ${config}
echo "chrLenFile = ${params.chr_len_file}" >> ${config}
echo "chrFiles = ${params.chr_files}" >> ${config}
echo "gemMappabilityFile = ${params.gem_mappability_file}" >> ${config}
echo "ploidy = ${params.ploidy}" >> ${config}
echo "window = ${params.window}" >> ${config}
echo "telocentromeric = ${params.telocentromeric}" >> ${config}
echo "BedGraphOutput=TRUE" >> ${config}
echo "maxThreads=${task.cpus}" >> ${config}

echo "[sample]" >> ${config}
echo "inputFormat = BAM" >> ${config}
echo "mateFile = ${bam_file}" >> ${config}

freec -conf ${config}
"""
}
18 changes: 18 additions & 0 deletions ControlFREEC/11.6/MakeGraph.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
process MakeGraph {
tag {"Control Freec MakeGraph ${sample_id}"}
label 'ControlFreec_11_6'
label 'ControlFreec_11_6_MakeGraph'
container = 'quay.io/biocontainers/control-freec:11.6--h87f3376_2'
shell = ['/bin/bash', '-euo', 'pipefail']

input:
tuple(val(sample_id), path(ratio_file), path(cnv_file))

output:
tuple(val(sample_id), path("${ratio_file.name}.png"), path("${ratio_file.name}.log2.png"), emit: ratio_png)

script:
"""
cat /usr/local/bin/makeGraph.R | R --slave --args ${params.ploidy} ${ratio_file}
"""
}
18 changes: 18 additions & 0 deletions ControlFREEC/11.6/MakeGraphChromosome.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
process MakeGraphChromosome {
tag {"Control Freec MakeGraphChromosome ${sample_id}"}
label 'ControlFreec_11_6'
label 'ControlFreec_11_6_MakeGraphChromosome'
container = 'quay.io/biocontainers/control-freec:11.6--h87f3376_2'
shell = ['/bin/bash', '-euo', 'pipefail']

input:
tuple(val(sample_id), path(ratio_file), path(cnv_file))

output:
tuple(val(sample_id), path("${ratio_file.name}*.png"), emit: ratio_png)

script:
"""
cat /usr/local/bin/makeGraph_Chromosome.R | R --slave --args 1 ${params.ploidy} ${ratio_file}
"""
}
18 changes: 18 additions & 0 deletions ControlFREEC/11.6/MakeKaryotype.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
process MakeKaryotype {
tag {"Control Freec MakeKaryotype ${sample_id}"}
label 'ControlFreec_11_6'
label 'ControlFreec_11_6_MakeKaryotype'
container = 'quay.io/biocontainers/control-freec:11.6--h87f3376_2'
shell = ['/bin/bash', '-euo', 'pipefail']

input:
tuple(val(sample_id), path(ratio_file), path(cnv_file))

output:
tuple(val(sample_id), path("*_karyotype.pdf"), emit: karyotype_pdf)

script:
"""
cat makeKaryotype.R | R --slave --args ${params.ploidy} ${params.maxlevel} ${params.telocentromeric} ${ratio_file}
"""
}
20 changes: 20 additions & 0 deletions DESeq2/1.28.0/deseq2Normalize.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
process Deseq2Normalize {
tag "deseq2normalize ${run_id}"
label 'biconductor_1_28_0'
label 'biconductor_1_28_0_deseq2normalize'
container = 'quay.io/biocontainers/bioconductor-deseq2:1.28.0--r40h5f743cb_0'
shell = ['/bin/bash', '-euo', 'pipefail']

input:
val(run_id)
file(counts)

output:
file("${run_id}_featureCounts_deseq2.txt")

script:
"""
deseq2Normalize.R ${counts} ${run_id}
"""

}
19 changes: 19 additions & 0 deletions DESeq2/1.38.0/deseq2Normalize.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
process Deseq2Normalize {
tag "deseq2normalize ${run_id}"
label 'biconductor_1_38_0'
label 'biconductor_1_38_0_deseq2normalize'
container = 'quay.io/biocontainers/bioconductor-deseq2:1.38.0--r42hc247a5b_0'
shell = ['/bin/bash', '-euo', 'pipefail']

input:
val(run_id)
file(counts)

output:
file("${run_id}_featureCounts_deseq2.txt")

script:
"""
deseq2Normalize.R ${counts} ${run_id}
"""
}
25 changes: 25 additions & 0 deletions Deeplexicon/1.2.0/dmux.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
process dmux {
tag {"Deeplexicon_dmux"}
label 'Deeplexicon_1_2_0'
label 'Deeplexicon_1_2_0_dmux'
container = 'lpryszcz/deeplexicon:1.2.0'
shell = ['/bin/bash', '-euo', 'pipefail']

input:
tuple(val(sample), val(chunk), path(fast5))

output:
tuple(val(sample), val(chunk), path("${sample}_${chunk}.demux2.tsv"), emit:tsv)

script:
"""
#deeplexicon only works when folder is passed, not when fast5 itself is used so put file in folder for further processing
mkdir fast5_folder
cp -P ${fast5} fast5_folder/
deeplexicon_multi.py dmux \
--threads 2 \
-p ./fast5_folder/ \
-m /deeplexicon/models/resnet20-final.h5 \
> ${sample}_${chunk}.demux2.tsv
"""
}
18 changes: 18 additions & 0 deletions Deeplexicon/1.2.0/fastq.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
process deeplexicon_concatFastq {
tag {"Deeplexicon_concat_fastq"}
label 'Deeplexicon_1_2_0'
label 'Deeplexicon_1_2_0_concat_fastq'
shell = ['/bin/bash', '-euo', 'pipefail']

input:
tuple(val(id), val(chunk), path(fastq))

output:
tuple(val(id), path("${id}_combined.fastq"), emit:fastq)

script:
"""
cat *.fastq.gz > ${id}_combined.fastq.gz
gunzip ${id}_combined.fastq.gz
"""
}
25 changes: 25 additions & 0 deletions Deeplexicon/1.2.0/split.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
process split {
tag {"Deeplexicon_split"}
label 'Deeplexicon_1_2_0'
label 'Deeplexicon_1_2_0_split'
container = 'lpryszcz/deeplexicon:1.2.0'
shell = ['/bin/bash', '-euo', 'pipefail']

input:
tuple(val(id), path(tsv),path(fastq))

output:
path("*.fastq.gz")

script:
"""
deeplexicon_multi.py split \
-i ${tsv} \
-o . \
-s ${id} \
-q ${fastq}

#deeplexicon outputs plain fastq, so gzip them
gzip ${id}_bc_*.fastq
"""
}
Loading