Skip to content

Commit

Permalink
Merge branch 'nf-core:master' into merfin_hist_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
rodtheo authored Apr 2, 2024
2 parents 0e34b36 + b77db98 commit 05e9290
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/nf-core/xengsort/index/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: "xengsort_index"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- "bioconda::xengsort=2.0.5"
54 changes: 54 additions & 0 deletions modules/nf-core/xengsort/index/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
process XENGSORT_INDEX {
tag "$host_fasta"
label 'process_medium'

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

input:
path(host_fasta, stageAs: "host/*")
path(graft_fasta, stageAs: "graft/*")
val index
val nobjects
val mask

output:
path "${index}.hash" , emit: hash
path "${index}.info" , emit: info
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
"""
xengsort \\
index \\
$args \\
--index $index \\
--host $host_fasta \\
--graft $graft_fasta \\
--nobjects $nobjects \\
--mask '$mask' \\
cat <<-END_VERSIONS > versions.yml
"${task.process}":
xengsort: \$(xengsort --version)
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
"""
touch ${index}.info
touch ${index}.hash
cat <<-END_VERSIONS > versions.yml
"${task.process}":
xengsort: \$(xengsort --version)
END_VERSIONS
"""
}
61 changes: 61 additions & 0 deletions modules/nf-core/xengsort/index/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "xengsort_index"
description: Fast lightweight accurate xenograft sorting
keywords:
- index
- QC
- reference
- fasta
- xenograft
- sort
- k-mer
tools:
- "xengsort":
description: "A fast xenograft read sorter based on space-efficient k-mer hashing"
homepage: "https://gitlab.com/genomeinformatics/xengsort"
documentation: "https://gitlab.com/genomeinformatics/xengsort"
tool_dev_url: "https://gitlab.com/genomeinformatics/xengsort"
doi: "10.4230/LIPIcs.WABI.2020.4"
licence: ["MIT"]

input:
- host_fasta:
type: file
description: |
Reference genome fasta file from host, compressed or uncompressed.
- graft_fasta:
type: file
description: |
Reference genome fasta file from graft, compressed or uncompressed.
- index:
type: string
description: |
File name prefix to store index files.
- nobjects:
type: string
description: |
Number of k-mers that will be stored in the hash table. Underscore should be used, i.e for 1000000, it should be typed 1_000_000.
- mask:
type: string
description: |
Gapped k-mer mask (quoted string like '#__##_##__#').
output:
- hash:
type: file
description: File with index hash file.
pattern: "*hash"
- info:
type: file
description: File with index info file.
pattern: "*info"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@diegomscoelho"
maintainers:
- "@diegomscoelho"
37 changes: 37 additions & 0 deletions modules/nf-core/xengsort/index/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "xengsort"
tag "xengsort/index"

test("homo_sapiens - sarscov2 - stub") {

options "-stub"

when {
process {
"""
input[0] = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
input[1] = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
input[2] = 'index'
input[3] = '10_000_000'
input[4] = '###__#_##__#_#_###__#__###_#_#__##_#__###'
"""
}
}

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

}

}
31 changes: 31 additions & 0 deletions modules/nf-core/xengsort/index/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions modules/nf-core/xengsort/index/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
xengsort/index:
- "modules/nf-core/xengsort/index/**"

0 comments on commit 05e9290

Please sign in to comment.