Skip to content

Commit

Permalink
idemux test_data.config (#5391)
Browse files Browse the repository at this point in the history
* idemux test_data.config

* add idemux module

* idemux test bugfix

* update idemux stub

* fix typos

* test_data.config update

* updated test snapshot

* fix conda version specification

---------

Co-authored-by: vsc41362 vscuser <vsc41362@gligar08.gastly.os>
  • Loading branch information
jaanckae and vsc41362 vscuser committed May 13, 2024
1 parent 28a8115 commit ccdcf9c
Show file tree
Hide file tree
Showing 8 changed files with 678 additions and 0 deletions.
30 changes: 30 additions & 0 deletions modules/nf-core/idemux/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Software License
Lexogen software on github.com

This license governs use of the Lexogen RNA-Seq kit product accompanying idemux software ("software"). If you use the software, you accept this license. If you do not accept the license, do not use the software.

1. Definitions

The terms "reproduction" ("Vervielfältigung"), "derivative works" ("bearbeitete Werke") and "distribution" ("Verbreitung") have the same meaning here as under mandatory applicable Austrian copyright law.

A "contribution" is the original software, or any additions or changes to the software.

A "contributor" is any person that distributes its contribution under this license.

2. Grant of License

Subject to the terms of this license, including the license conditions and limitations in section 3, for any non-commercial usage each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.

Commercial usage shall be allowed exclusively in connection with Lexogen RNA-Seq kit products.

3. Conditions and Limitations

(A) This license does not grant you rights to use any contributors' name, logo, or trademarks.

(B) This license does not grant you rights to use any contributors' patent or patent application.

(C) If you distribute any portion of the software, you must retain all copyright, trademark, and attribution notices that are present in the software.

(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.

(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
9 changes: 9 additions & 0 deletions modules/nf-core/idemux/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
name: "idemux"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- "bioconda::idemux=0.1.6"
61 changes: 61 additions & 0 deletions modules/nf-core/idemux/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
process IDEMUX {
tag "$meta.id"
label 'process_high'

conda "bioconda::idemux=0.1.6"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/idemux:0.1.6--pyhdfd78af_0':
'biocontainers/idemux:0.1.6--pyhdfd78af_0' }"

input:
tuple val(meta), path(reads), path(samplesheet)

output:
tuple val(meta), path("[!undetermined]*.fastq.gz") , emit: fastq
tuple val(meta), path("undetermined_R?.fastq.gz") , optional:true, emit: undetermined
path "demultipexing_stats.tsv" , emit: stats
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''

"""
idemux \\
--r1 ${reads[0]} \\
--r2 ${reads[1]} \\
--sample-sheet ${samplesheet} \\
--out . \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
idemux: \$(idemux --version |& sed '1!d ; s/idemux //')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''

"""
echo -e "sample_name\twritten_reads" > demultipexing_stats.tsv
sed 1d ${samplesheet} | while IFS=, read -r sampleName _ _ _; do
touch "\${sampleName}_R1.fastq"
touch "\${sampleName}_R2.fastq"
echo -e "\${sampleName}\t100" >> demultipexing_stats.tsv
done
touch undetermined_R1.fastq
touch undetermined_R2.fastq
gzip *.fastq
cat <<-END_VERSIONS > versions.yml
"${task.process}":
idemux: \$(idemux --version |& sed '1!d ; s/idemux //')
END_VERSIONS
"""
}
50 changes: 50 additions & 0 deletions modules/nf-core/idemux/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: idemux
description: Demultiplex paired-end FASTQ files from QuantSeq-Pool
keywords:
- demultiplex
- lexogen
- fastq
tools:
- idemux:
description: |
A Lexogen tool for demultiplexing and index error correcting fastq files. Works with Lexogen i7, i5 and i1 barcodes.
homepage: https://github.com/Lexogen-Tools/idemux
documentation: https://github.com/Lexogen-Tools/idemux
tool_dev_url: https://github.com/Lexogen-Tools/idemux
licence: ["LEXOGEN"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'NVQ', lane:1 ]
- reads:
type: file
description: |
List of input FastQ files
pattern: "Undetermined_S*.fastq.gz"
- samplesheet:
type: file
description: Input samplesheet
pattern: "*.{csv}"
output:
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- fastq:
type: file
description: Demultiplexed sample FASTQ files
pattern: "*.fastq.gz"
- undetermined:
type: file
description: Optional undetermined sample FASTQ files
pattern: "Undetermined_R?.fastq.gz"
- stats:
type: file
description: Demultiplexing Stats
pattern: "demultipexing_stats.tsv"
authors:
- "@jaanckae"
maintainers:
- "@jaanckae"
73 changes: 73 additions & 0 deletions modules/nf-core/idemux/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
nextflow_process {

name "Test Process IDEMUX"
script "../main.nf"
process "IDEMUX"

tag "modules"
tag "modules_nfcore"
tag "idemux"


test("idemux - fastq") {
when {
process {
"""
input[0] = [
[ id:'NVQ', lane:1 ],
[
file(params.test_data['homo_sapiens']['lexogen']['i7_i5_i1_read_1'], checkIfExists: true),
file(params.test_data['homo_sapiens']['lexogen']['i7_i5_i1_read_2'], checkIfExists: true)
],
file(params.test_data['homo_sapiens']['lexogen']['i7_i5_i1_sample_sheet'])
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.stats,
process.out.versions,
process.out.fastq,
).match() }
)
}

}

test("idemux - fastq - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'NVQ', lane:1 ],
[
file(params.test_data['homo_sapiens']['lexogen']['i7_i5_i1_read_1'], checkIfExists: true),
file(params.test_data['homo_sapiens']['lexogen']['i7_i5_i1_read_2'], checkIfExists: true)
],
file(params.test_data['homo_sapiens']['lexogen']['i7_i5_i1_sample_sheet'])
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.stats,
process.out.versions,
process.out.fastq,
).match() }
)
}

}

}

0 comments on commit ccdcf9c

Please sign in to comment.