Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 9 additions & 19 deletions modules/nf-core/mageck/count/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,32 @@ process MAGECK_COUNT {
path(library)

output:
tuple val(meta), path("*count.txt") , emit: count
tuple val(meta), path("*count.txt") , emit: count
tuple val(meta), path("*.count_normalized.txt"), emit: norm
path "versions.yml" , emit: versions
tuple val("${task.process}"), val("mageck"), eval("mageck -v"), emit: versions_mageck, topic: versions

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def input_file = ("$inputfile".endsWith(".fastq.gz")) ? "--fastq ${inputfile}" : "-k ${inputfile}"
def sample_label = ("$inputfile".endsWith(".fastq.gz") || "$inputfile".endsWith(".fq.gz")) ? "--sample-label ${meta.id}" : ''
def input_file = ("${inputfile}".endsWith(".fastq.gz")) ? "--fastq ${inputfile}" : "-k ${inputfile}"
def sample_label = ("${inputfile}".endsWith(".fastq.gz") || "${inputfile}".endsWith(".fq.gz")) ? "--sample-label ${meta.id}" : ''

"""
mageck \\
count \\
$args \\
-l $library \\
-n $prefix \\
$sample_label \\
$input_file \\


cat <<-END_VERSIONS > versions.yml
"${task.process}":
mageck: \$(mageck -v)
END_VERSIONS
${args} \\
-l ${library} \\
-n ${prefix} \\
${sample_label} \\
${input_file}
"""
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.count.txt
touch ${prefix}.count_normalized.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
mageck: \$(mageck -v)
END_VERSIONS
"""
}
39 changes: 28 additions & 11 deletions modules/nf-core/mageck/count/meta.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "mageck_count"
description: mageck count for functional genomics, reads are usually mapped to a specific
sgRNA
description: mageck count for functional genomics, reads are usually mapped to a
specific sgRNA
keywords:
- sort
- functional genomics
Expand All @@ -13,7 +13,8 @@ tools:
homepage: "https://sourceforge.net/p/mageck/wiki/Home/"
documentation: "https://sourceforge.net/p/mageck/wiki/demo/#step-4-run-the-mageck-count-command"
doi: "10.1186/s13059-014-0554-4"
licence: ["BSD License"]
licence:
- "BSD License"
identifier: biotools:mageck
input:
- - meta:
Expand All @@ -23,8 +24,8 @@ input:
e.g. [ id:'test', single_end:false ]
- inputfile:
type: file
description: library fastq file containing the sgRNA and gene name or count
table containing the sgRNA and number of reads to per sample
description: library fastq file containing the sgRNA and gene name or
count table containing the sgRNA and number of reads to per sample
pattern: "*.{fq,fastq,fastq.gz,fq.gz,csv,txt,tsv}"
ontologies:
- edam: http://edamontology.org/format_1930 # FASTQ
Expand Down Expand Up @@ -60,13 +61,29 @@ output:
description: File containing normalized read counts
pattern: "*.count_normalized.txt"
ontologies: []
versions_mageck:
- - ${task.process}:
type: string
description: The name of the process
- mageck:
type: string
description: The name of the tool
- mageck -v:
type: eval
description: The expression to obtain the version of the tool

topics:
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
- - ${task.process}:
type: string
description: The name of the process
- mageck:
type: string
description: The name of the tool
- mageck -v:
type: eval
description: The expression to obtain the version of the tool

authors:
- "@LaurenceKuhl"
maintainers:
Expand Down
23 changes: 14 additions & 9 deletions modules/nf-core/mageck/count/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ nextflow_process {
when {
process {
"""
input[0] = [ [ id:'test,test2', single_end:true] , // meta map
[file(params.modules_testdata_base_path + 'genomics/mus_musculus/mageck/ERR376998.small.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/mus_musculus/mageck/ERR376999.small.fastq.gz', checkIfExists: true)]
input[0] = [
[ id:'test,test2' ],
[
file(params.modules_testdata_base_path + 'genomics/mus_musculus/mageck/ERR376998.small.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/mus_musculus/mageck/ERR376999.small.fastq.gz', checkIfExists: true)
]
]
input[1] = file(params.modules_testdata_base_path + 'genomics/mus_musculus/mageck/yusa_library.csv')
"""
Expand All @@ -26,7 +29,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

Expand All @@ -39,9 +42,12 @@ nextflow_process {
when {
process {
"""
input[0] = [ [ id:'test,test2', single_end:true] , // meta map
[file(params.modules_testdata_base_path + 'genomics/mus_musculus/mageck/ERR376998.small.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/mus_musculus/mageck/ERR376999.small.fastq.gz', checkIfExists: true)]
input[0] = [
[ id:'test,test2' ],
[
file(params.modules_testdata_base_path + 'genomics/mus_musculus/mageck/ERR376998.small.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/mus_musculus/mageck/ERR376999.small.fastq.gz', checkIfExists: true)
]
]
input[1] = file(params.modules_testdata_base_path + 'genomics/mus_musculus/mageck/yusa_library.csv')
"""
Expand All @@ -51,8 +57,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match()
}
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

Expand Down
82 changes: 26 additions & 56 deletions modules/nf-core/mageck/count/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,99 +2,69 @@
"mus_musculus - fastq": {
"content": [
{
"0": [
[
{
"id": "test,test2",
"single_end": true
},
"test,test2.count.txt:md5,2759bdc010998f863518cf7a2df812dc"
]
],
"1": [
[
{
"id": "test,test2",
"single_end": true
},
"test,test2.count_normalized.txt:md5,d79f3863168ee0f0750a59d94f70ce1a"
]
],
"2": [
"versions.yml:md5,8fd54f61f3c77976003f79397f6b12d9"
],
"count": [
[
{
"id": "test,test2",
"single_end": true
"id": "test,test2"
},
"test,test2.count.txt:md5,2759bdc010998f863518cf7a2df812dc"
]
],
"norm": [
[
{
"id": "test,test2",
"single_end": true
"id": "test,test2"
},
"test,test2.count_normalized.txt:md5,d79f3863168ee0f0750a59d94f70ce1a"
]
],
"versions": [
"versions.yml:md5,8fd54f61f3c77976003f79397f6b12d9"
"versions_mageck": [
[
"MAGECK_COUNT",
"mageck",
"0.5.9.5"
]
]
}
],
"timestamp": "2024-06-14T17:31:00.990366"
"timestamp": "2026-06-19T14:46:05.983468802",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.3"
}
},
"mus_musculus - fastq - stub": {
"content": [
{
"0": [
[
{
"id": "test,test2",
"single_end": true
},
"test,test2.count.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
{
"id": "test,test2",
"single_end": true
},
"test,test2.count_normalized.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
"versions.yml:md5,8fd54f61f3c77976003f79397f6b12d9"
],
"count": [
[
{
"id": "test,test2",
"single_end": true
"id": "test,test2"
},
"test,test2.count.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"norm": [
[
{
"id": "test,test2",
"single_end": true
"id": "test,test2"
},
"test,test2.count_normalized.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,8fd54f61f3c77976003f79397f6b12d9"
"versions_mageck": [
[
"MAGECK_COUNT",
"mageck",
"0.5.9.5"
]
]
}
],
"timestamp": "2024-06-14T17:31:12.173269"
"timestamp": "2026-06-19T14:46:14.042271757",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.3"
}
}
}
22 changes: 6 additions & 16 deletions modules/nf-core/mageck/mle/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ process MAGECK_MLE {
output:
tuple val(meta), path("*.gene_summary.txt") , emit: gene_summary
tuple val(meta), path("*.sgrna_summary.txt"), emit: sgrna_summary
path "versions.yml" , emit: versions
tuple val("${task.process}"), val("mageck"), eval("mageck -v"), emit: versions_mageck, topic: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -26,28 +26,18 @@ process MAGECK_MLE {
"""
mageck \\
mle \\
$args \\
--threads $task.cpus \\
-k $count_table \\
-d $design_matrix \\
-n $prefix

cat <<-END_VERSIONS > versions.yml
"${task.process}":
mageck: \$(mageck -v)
END_VERSIONS
${args} \\
--threads ${task.cpus} \\
-k ${count_table} \\
-d ${design_matrix} \\
-n ${prefix}
"""
stub:
def prefix = task.ext.prefix ?: "${meta.id}"

"""
touch ${prefix}.gene_summary.txt
touch ${prefix}.sgrna_summary.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
mageck: \$(mageck -v)
END_VERSIONS
"""


Expand Down
31 changes: 24 additions & 7 deletions modules/nf-core/mageck/mle/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ tools:
documentation: "https://sourceforge.net/p/mageck/wiki/Home/"
tool_dev_url: "https://bitbucket.org/liulab/mageck/src"
doi: "10.1186/s13059-015-0843-6"
licence: ["BSD"]
licence:
- "BSD"
identifier: biotools:mageck
input:
- - meta:
Expand Down Expand Up @@ -63,13 +64,29 @@ output:
associated gene
pattern: "*.{gene_summary}"
ontologies: []
versions_mageck:
- - ${task.process}:
type: string
description: The name of the process
- mageck:
type: string
description: The name of the tool
- mageck -v:
type: eval
description: The expression to obtain the version of the tool

topics:
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
- - ${task.process}:
type: string
description: The name of the process
- mageck:
type: string
description: The name of the tool
- mageck -v:
type: eval
description: The expression to obtain the version of the tool

authors:
- "@LaurenceKuhl"
maintainers:
Expand Down
Loading