Newer
Older
version = "6.4.6"
container_url = "xgrand/ont-guppy:${version}"
params.basecalling_out = ""
params.flowcell = "FLO-MIN106"
params.kit = "SQK-PBK004"
params.min_qscore = 7.0
params.gpu_runners_per_device = 1
params.num_callers = 1
params.chunks_per_runner = 1
tag "$fast5_folder"
if (params.basecalling_out != "") {
publishDir "results/${params.basecalling_out}", mode: 'copy'
}
if (params.flowcell == "") {
errorFlowcell << "WARNING ! No Flowcell type given..."
errorFlowcell.view()
}
if (params.kit == "") {
errorKit "WARNING ! No kit type given..."
errorKit.view()
}
if (params.config_file != "") {
options = "-c /opt/ont/guppy/data/${params.config_file}"
}
else {
options = "--flowcell ${params.flowcell} \
--kit ${params.kit} "
}
output:
path "pass", emit: pass
path "fail", emit: fail
path "sequencing_summary.txt", emit: sequencing_summary
path "sequencing_telemetry.js", emit: sequencing_telemetry
script:
"""
echo "Start basecalling using GPUs."
# guppy_basecaller --print_workflows
path=\$(readlink -f ${fast5_folder})
find \${path} -type f -name "*.fast5" > allfast5files.txt
-s . \
-x "cuda:all" \
--min_qscore ${params.min_qscore} \
--gpu_runners_per_device ${params.gpu_runners_per_device} \
--num_callers ${params.num_callers} \
--chunks_per_runner ${params.chunks_per_runner} \
// A modifier quand le process gpu marchera
process basecall_fast5_cpu {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$fast5_folder"
if (params.basecalling_out != "") {
publishDir "results/${params.basecalling_out}", mode: 'copy'
}
if (params.flowcell == "") {
errorFlowcell << "WARNING ! No Flowcell type given..."
errorFlowcell.view()
}
if (params.kit == "") {
errorKit "WARNING ! No kit type given..."
errorKit.view()
}
input:
val(fast5_folder)
output:
path "pass", emit: pass
path "fail", emit: fail
path "sequencing_summary.txt", emit: sequencing_summary
path "sequencing_telemetry.js", emit: sequencing_telemetry
script:
"""
echo "Start basecalling using CPUs."
find ${fast5_folder} -type f -name "*.fast5" > allfast5files.txt
-i / \
--input_file_list allfast5files.txt \
-s . \
--cpu_threads_per_caller ${params.cpu_threads_per_caller} \
--num_callers ${params.num_callers} \
--flowcell ${params.flowcell} \
--kit ${params.kit}
"""
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
params.kit_barcoding = "EXP-PBC001"
process barcoding_gpu {
container = "${container_url}"
label "gpus"
tag "$fast5_folder"
if (params.barcoding_out != "") {
publishDir "results/${params.barcoding_out}", mode: 'copy'
}
input:
path(pass_path)
output:
path("*")
script:
"""
guppy_barcoder \
--input_path ${pass_path} \
--save_path . \
-t ${params.gpu_threads_per_caller} \
--barcode_kits ${params.kit_barcoding} \
--progress_stats_frequency 60 \
--enable_trim_barcodes \
--trim_adapters \
--compress_fastq
"""
}
process barcoding_cpu {
container = "${container_url}"
label "big_mem_multi_cpus"
tag "$fast5_folder"
if (params.barcoding_out != "") {
publishDir "results/${params.barcoding_out}", mode: 'copy'
}
input:
path(pass_path)
output:
script:
"""
guppy_barcoder \
--input_path ${pass_path} \
--save_path . \
-t ${task.cpus} \
--barcode_kits ${params.kit_barcoding} \
--progress_stats_frequency 60 \
--enable_trim_barcodes \
--trim_adapters \
--compress_fastq
"""