diff --git a/src/bolero.nf b/src/bolero.nf index 5c37e4dccd4ca1d4a58e43dae8935d258349e0f3..cd2387ae0197a6ee786f5b731621a92cc6131a05 100755 --- a/src/bolero.nf +++ b/src/bolero.nf @@ -91,7 +91,7 @@ params.gpu_runners_per_device = 32 params.num_callers = 16 params.chunks_per_runner = 512 params.chunk_size = 1900 - +params.config_file = "" /* Params out */ @@ -156,6 +156,11 @@ Channel .map(it -> [it.baseName, it]) .set{barcodes} +// Test pour barcoding process +Channel + .fromPath(params.pass) + .set{pass} + /* **************************************************************** Imports @@ -164,6 +169,7 @@ Channel if(!params.skipBC) { /* Hardware configuration, if Nvidia CUDA compatible graphic card is installed, use guppy-gpu, else guppy-cpu (much slower)*/ + include { barcoding } from "./nf_modules/ont-guppy/main.nf" if(params.gpu_mode) { include { basecall_fast5_gpu } from "./nf_modules/ont-guppy/main.nf" } @@ -194,9 +200,11 @@ include { rna_count } from "./nf_modules/rna_count/main.nf" */ workflow { + pass.view() + barcoding(pass) //######################## BASECALLING ######################## - +/* if(params.skipBC) { // we take fastq files as input and skip basecalling concatenate(barcodes) } diff --git a/src/nf_modules/ont-guppy/main.nf b/src/nf_modules/ont-guppy/main.nf index 5c615eb418620709319790bff584c89d734b0dba..c4f82781215aad4fc07c361544a3a4432b7a7911 100644 --- a/src/nf_modules/ont-guppy/main.nf +++ b/src/nf_modules/ont-guppy/main.nf @@ -9,6 +9,7 @@ params.min_qscore = 7.0 params.gpu_runners_per_device = 1 params.num_callers = 1 params.chunks_per_runner = 1 +options = "" process basecall_fast5_gpu { container = "${container_url}" label "gpu" @@ -27,6 +28,14 @@ process basecall_fast5_gpu { errorKit.view() } + if (params.config_file != "") { + options = "-c /opt/ont/guppy/data/${params.config_file}" + } + else { + options = "--flowcell ${params.flowcell} \ +--kit ${params.kit} " + } + input: path(fast5_folder) @@ -46,14 +55,12 @@ guppy_basecaller --compress_fastq \ -i / \ --input_file_list fichier.txt \ -s . \ - --flowcell ${params.flowcell} \ - --kit ${params.kit} \ -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} \ - -c ${params.config_file} + ${options} """ } @@ -97,4 +104,33 @@ guppy_basecaller --compress_fastq \ --flowcell ${params.flowcell} \ --kit ${params.kit} """ +} + +process barcoding { + 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: + path("barcode") + + script: +""" +guppy_barcoder \ + --input_path ${pass_path} \ + --save_path barcode/ \ + -c /opt/ont/guppy/data/${params.config_file} \ + --barcode_kits ${params.kit} \ + --progress_stats_frequency 60 \ + -x "cuda:all" \ + --enable_trim_barcodes \ + --trim_adapters \ + --compress_fastq +""" } \ No newline at end of file