Skip to content

Commit

Permalink
Started adding kneaddata_readcount module
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonJM committed Jan 19, 2024
1 parent 69470d4 commit 01acdca
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
48 changes: 48 additions & 0 deletions modules/local/kneaddata/readcounts/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
process KNEADDATA_KNEADDATA {
tag "${meta.id}"
label 'process_high'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/kneaddata:0.12.0--pyhdfd78af_1':
'biocontainers/kneaddata:0.12.0--pyhdfd78af_1' }"

input:
tuple val(meta), path(fastq_gz)
path (kneaddata_db)

output:
tuple val(meta), path("${prefix}_kneaddata_paired_{1,2}.fastq.gz") , emit: preprocessed_reads
tuple val(meta), path("${prefix}_kneaddata.log") , emit: kneaddata_log
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
kneaddata_read_count_table \\
--input ./ \\
--output ${prefix}_kneaddata_read_count.tsv \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
kneaddata: \$(echo \$(kneaddata --version 2>&1 | sed 's/^.*v//' ))
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
${prefix}_kneaddata_read_count.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
kneaddata: \$(echo \$(kneaddata --version 2>&1 | sed 's/^.*v//' ))
END_VERSIONS
"""
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
nextflow_workflow {

name "Test Subworkflow: FASTQ_READ_PREPROCESSING_KNEADDATA"
script "../main.nf"
workflow "FASTQ_READ_PREPROCESSING_KNEADDATA"

tag "subworkflows"
tag "subworkflows_local"
tag "fastq_read_preprocessing_kneaddata"
tag "fastq_read_preprocessing_kneaddata_default"


test("Parameters: default") {

when {
params {
outdir = "$outputDir"
}
workflow {
"""
input[0] = Channel.of(
[
[ id: 'test' ],
[
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true)
]
]
)
"""
}
}

then {
assertAll(
{ assert workflow.success },
{ assert snapshot(workflow.out).match() }
)
}
}
}

0 comments on commit 01acdca

Please sign in to comment.