kkonganti@11
|
1 process FASTP {
|
kkonganti@11
|
2 tag "$meta.id"
|
kkonganti@11
|
3 label 'process_low'
|
kkonganti@11
|
4
|
kkonganti@11
|
5 module (params.enable_module ? "${params.swmodulepath}${params.fs}fastp${params.fs}0.23.2" : null)
|
kkonganti@11
|
6 conda (params.enable_conda ? "bioconda::fastp=0.23.2 conda-forge::isa-l" : null)
|
kkonganti@11
|
7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
kkonganti@11
|
8 'https://depot.galaxyproject.org/singularity/fastp:0.23.2--h79da9fb_0' :
|
kkonganti@11
|
9 'quay.io/biocontainers/fastp:0.23.2--h79da9fb_0' }"
|
kkonganti@11
|
10
|
kkonganti@11
|
11 input:
|
kkonganti@11
|
12 tuple val(meta), path(reads)
|
kkonganti@11
|
13
|
kkonganti@11
|
14 output:
|
kkonganti@11
|
15 tuple val(meta), path('*.fastp.fastq.gz') , emit: passed_reads, optional: true
|
kkonganti@11
|
16 tuple val(meta), path('*.fail.fastq.gz') , emit: failed_reads, optional: true
|
kkonganti@11
|
17 tuple val(meta), path('*.merged.fastq.gz'), emit: merged_reads, optional: true
|
kkonganti@11
|
18 tuple val(meta), path('*.json') , emit: json
|
kkonganti@11
|
19 tuple val(meta), path('*.html') , emit: html
|
kkonganti@11
|
20 tuple val(meta), path('*.log') , emit: log
|
kkonganti@11
|
21 path "versions.yml" , emit: versions
|
kkonganti@11
|
22
|
kkonganti@11
|
23 when:
|
kkonganti@11
|
24 task.ext.when == null || task.ext.when
|
kkonganti@11
|
25
|
kkonganti@11
|
26 script:
|
kkonganti@11
|
27 def args = task.ext.args ?: ''
|
kkonganti@11
|
28 def prefix = task.ext.prefix ?: "${meta.id}"
|
kkonganti@11
|
29 def fail_fastq = params.fastp_failed_out && meta.single_end ? "--failed_out ${prefix}.fail.fastq.gz" : params.fastp_failed_out && !meta.single_end ? "--unpaired1 ${prefix}_1.fail.fastq.gz --unpaired2 ${prefix}_2.fail.fastq.gz" : ''
|
kkonganti@11
|
30 // Added soft-links to original fastqs for consistent naming in MultiQC
|
kkonganti@11
|
31 // Use single ended for interleaved. Add --interleaved_in in config.
|
kkonganti@11
|
32 if ( task.ext.args?.contains('--interleaved_in') ) {
|
kkonganti@11
|
33 """
|
kkonganti@11
|
34 [ ! -f ${prefix}.fastq.gz ] && ln -sf $reads ${prefix}.fastq.gz
|
kkonganti@11
|
35
|
kkonganti@11
|
36 fastp \\
|
kkonganti@11
|
37 --stdout \\
|
kkonganti@11
|
38 --in1 ${prefix}.fastq.gz \\
|
kkonganti@11
|
39 --thread $task.cpus \\
|
|