Verified Commit 5af36606 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

cutadapt: update to last contributing guide version

parent 451c10bb
version = "2.1"
container_url = "lbmc/cutadapt:${version}"
adapter_3_prim = "AGATCGGAAGAG"
adapter_5_prim = "CTCTTCCGATCT"
trim_quality = "20"
params.adaptor_removal = "-a ${adapter_3_prim} -g ${adapter_5_prim} -A ${adapter_3_prim} -G ${adapter_5_prim}"
params.adapter_3_prim = "AGATCGGAAGAG"
params.adapter_5_prim = "CTCTTCCGATCT"
params.adaptor_removal = "-a ${params.adapter_3_prim} -g ${params.adapter_5_prim} -A ${params.adapter_3_prim} -G ${params.adapter_5_prim}"
params.adaptor_removal_out = ""
process adaptor_removal {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$pair_id"
tag "$file_id"
if (params.adaptor_removal_out != "") {
publishDir "results/${params.adaptor_removal_out}", mode: 'copy'
}
input:
tuple val(pair_id), path(reads)
tuple val(file_id), path(reads)
output:
tuple val(pair_id), path("*_cut_R{1,2}.fastq.gz"), emit: fastq
tuple val(file_id), path("*_cut_R{1,2}.fastq.gz"), emit: fastq
path "*_report.txt", emit: report
script:
if (reads instanceof List)
if (file_id instanceof List){
file_prefix = file_id[0]
} else {
file_prefix = file_id
}
if (reads.size() == 2)
"""
cutadapt ${params.adaptor_removal} \
-o ${pair_id}_cut_R1.fastq.gz -p ${pair_id}_cut_R2.fastq.gz \
${reads[0]} ${reads[1]} > ${pair_id}_report.txt
-o ${file_id}_cut_R1.fastq.gz -p ${file_id}_cut_R2.fastq.gz \
${reads[0]} ${reads[1]} > ${file_id}_report.txt
"""
else
"""
......@@ -33,112 +40,40 @@ process adaptor_removal {
"""
}
params.adaptor_removal_pairedend = "-a ${adapter_3_prim} -g ${adapter_5_prim} -A ${adapter_3_prim} -G ${adapter_5_prim}"
process adaptor_removal_pairedend {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$pair_id"
input:
tuple val(pair_id), path(reads)
output:
tuple val(pair_id), path("*_cut_R{1,2}.fastq.gz"), emit: fastq
path "*_report.txt", emit: report
script:
"""
cutadapt ${params.adaptor_removal_pairedend} \
-o ${pair_id}_cut_R1.fastq.gz -p ${pair_id}_cut_R2.fastq.gz \
${reads[0]} ${reads[1]} > ${pair_id}_report.txt
"""
}
params.adaptor_removal_singleend = "-a ${adapter_3_prim} -g ${adapter_5_prim}"
process adaptor_removal_singleend {
params.trim_quality = "20"
params.trimming = "-q ${params.trim_quality},${params.trim_quality}"
params.trimming_out = ""
process trimming {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$file_id"
if (params.trimming_out != "") {
publishDir "results/${params.trimming_out}", mode: 'copy'
}
input:
tuple val(file_id), path(reads)
output:
tuple val(file_id), path("*_cut.fastq.gz"), emit: fastq
path "*_report.txt", emit: report
script:
"""
cutadapt ${params.adaptor_removal_singleend} \
-o ${file_id}_cut.fastq.gz \
${reads} > ${file_id}_report.txt
"""
}
process trimming {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$pair_id"
input:
tuple val(pair_id), path(reads)
output:
tuple val(pair_id), path("*_trim_R{1,2}.fastq.gz"), emit:fastq
tuple val(file_id), path("*_trim_R{1,2}.fastq.gz"), emit:fastq
path "*_report.txt", emit: report
script:
if (reads instanceof List)
if (file_id instanceof List){
file_prefix = file_id[0]
} else {
file_prefix = file_id
}
if (reads.size() == 2)
"""
cutadapt -q ${trim_quality},${trim_quality} \
-o ${pair_id}_trim_R1.fastq.gz -p ${pair_id}_trim_R2.fastq.gz \
${reads[0]} ${reads[1]} > ${pair_id}_report.txt
cutadapt ${params.trimming} \
-o ${file_id}_trim_R1.fastq.gz -p ${file_id}_trim_R2.fastq.gz \
${reads[0]} ${reads[1]} > ${file_id}_report.txt
"""
else
"""
cutadapt -q ${trim_quality},${trim_quality} \
-o ${file_id}_trim.fastq.gz \
${reads} > ${file_id}_report.txt
"""
}
process trimming_pairedend {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$pair_id"
input:
tuple val(pair_id), path(reads)
output:
tuple val(pair_id), path("*_trim_R{1,2}.fastq.gz"), emit:fastq
path "*_report.txt", emit: report
script:
"""
cutadapt -q ${trim_quality},${trim_quality} \
-o ${pair_id}_trim_R1.fastq.gz -p ${pair_id}_trim_R2.fastq.gz \
${reads[0]} ${reads[1]} > ${pair_id}_report.txt
"""
}
process trimming_singleend {
container = "${container_url}"
label "big_mem_mono_cpus"
tag "$file_id"
input:
tuple val(file_id), path(reads)
output:
tuple val(file_id), path("*_trim.fastq.gz"), emit: fastq
path "*_report.txt", emit: report
script:
"""
cutadapt -q ${trim_quality},${trim_quality} \
cutadapt ${params.trimming} \
-o ${file_id}_trim.fastq.gz \
${reads} > ${file_id}_report.txt
"""
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment