Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new module: star/indexversion #7512

Merged
merged 3 commits into from
Feb 25, 2025
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
10 changes: 10 additions & 0 deletions modules/nf-core/star/indexversion/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- bioconda::htslib=1.21
- bioconda::samtools=1.21
- bioconda::star=2.7.11b
- conda-forge::gawk=5.1.0
41 changes: 41 additions & 0 deletions modules/nf-core/star/indexversion/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
process STAR_INDEXVERSION {
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/26/268b4c9c6cbf8fa6606c9b7fd4fafce18bf2c931d1a809a0ce51b105ec06c89d/data' :
'community.wave.seqera.io/library/htslib_samtools_star_gawk:ae438e9a604351a4' }"

output:
path("*.txt") , emit: index_version
path "versions.yml" , emit: versions

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

script:
def prefix = task.ext.prefix ?: "index_version"
"""
STAR --help | grep 'versionGenome' | sed -e 's/versionGenome[ \t]*//' | sed -e 's/ .*//' > ${prefix}.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
star: \$(STAR --version | sed -e "s/STAR_//g")
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
gawk: \$(echo \$(gawk --version 2>&1) | sed 's/^.*GNU Awk //; s/, .*\$//')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "index_version"
"""
STAR --help | grep 'versionGenome' | sed -e 's/versionGenome[ \t]*//' | sed -e 's/ .*//' > ${prefix}.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
star: \$(STAR --version | sed -e "s/STAR_//g")
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
gawk: \$(echo \$(gawk --version 2>&1) | sed 's/^.*GNU Awk //; s/, .*\$//')
END_VERSIONS
"""
}
36 changes: 36 additions & 0 deletions modules/nf-core/star/indexversion/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "star_indexversion"
description: Get the minimal allowed index version from STAR
keywords:
- index
- version
- rna
tools:
- star:
description: |
STAR is a software package for mapping DNA sequences against
a large reference genome, such as the human genome.
homepage: https://github.com/alexdobin/STAR
manual: https://github.com/alexdobin/STAR/blob/master/doc/STARmanual.pdf
doi: 10.1093/bioinformatics/bts635
licence: ["MIT"]
identifier: biotools:star

output:
- index_version:
- "*.txt":
type: file
description: File with the minimal index version
pattern: "*.txt"

- versions:
- "versions.yml":
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@nvnieuwk"
maintainers:
- "@nvnieuwk"
36 changes: 36 additions & 0 deletions modules/nf-core/star/indexversion/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "star"
tag "star/indexversion"

test("normal run") {

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

}

test("stub run") {

options "-stub"

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

}

}
48 changes: 48 additions & 0 deletions modules/nf-core/star/indexversion/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"normal run": {
"content": [
{
"0": [
"index_version.txt:md5,184a6b325b4ac98bd08ffc0bd8f046cd"
],
"1": [
"versions.yml:md5,003e8e66b98a702010f209d5049eeabc"
],
"index_version": [
"index_version.txt:md5,184a6b325b4ac98bd08ffc0bd8f046cd"
],
"versions": [
"versions.yml:md5,003e8e66b98a702010f209d5049eeabc"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-25T13:06:11.149770431"
},
"stub run": {
"content": [
{
"0": [
"index_version.txt:md5,184a6b325b4ac98bd08ffc0bd8f046cd"
],
"1": [
"versions.yml:md5,003e8e66b98a702010f209d5049eeabc"
],
"index_version": [
"index_version.txt:md5,184a6b325b4ac98bd08ffc0bd8f046cd"
],
"versions": [
"versions.yml:md5,003e8e66b98a702010f209d5049eeabc"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.4"
},
"timestamp": "2025-02-25T13:06:16.834272136"
}
}
Loading