-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started adding kneaddata_readcount module
- Loading branch information
Showing
2 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
""" | ||
} |
41 changes: 41 additions & 0 deletions
41
subworkflows/local/fastq_read_preprocessing_kneaddata/tests/main.nf.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() } | ||
) | ||
} | ||
} | ||
} |