Skip to content
Open
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/pcgr/getref/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:
- conda-forge::coreutils=9.5
- conda-forge::gzip=1.14
- conda-forge::tar=1.35
- conda-forge::curl=8.16.0
48 changes: 48 additions & 0 deletions modules/nf-core/pcgr/getref/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
process PCGR_GETREF {
tag "${meta.id}"
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/51/517cc3a46129fc586191412f29246889124f4654640a53230aa203a2bcc1d7dc/data'
: 'community.wave.seqera.io/library/coreutils_curl_gzip_tar:17a6ea9a6766c02a'}"

input:
tuple val(meta), val(bundleversion), val(genome)

output:
tuple val(meta), path("${bundleversion}"), emit: pcgrref
path "versions.yml", emit: versions

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

script:
def bundle = "pcgr_ref_data.${bundleversion}.${genome}.tgz"
"""
curl -O https://insilico.hpc.uio.no/pcgr/${bundle}
gzip -dc ${bundle} | tar xvf -

mkdir ${bundleversion}
mv data/ ${bundleversion}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
curl: \$(curl --version | head -1 | cut -d ' ' -f 2)
tar: \$(tar --version | head -1 | cut -d ' ' -f 4)
gzip: \$(gzip --version | head -1 | cut -d ' ' -f 2)
END_VERSIONS
"""

stub:
"""
mkdir ${bundleversion}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
curl: \$(curl --version | head -1 | cut -d ' ' -f 2)
tar: \$(tar --version | head -1 | cut -d ' ' -f 4)
gzip: \$(gzip --version | head -1 | cut -d ' ' -f 2)
END_VERSIONS
"""
}
59 changes: 59 additions & 0 deletions modules/nf-core/pcgr/getref/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "pcgr_getref"
description: Get reference to run Personal Cancer Genome Reporter (PCGR)
keywords:
- cancer
- reference
- pcgr
- mtb
tools:
- pcgr:
description: "The Personal Cancer Genome Reporter (PCGR) is a stand-alone software package for functional annotation and translation of individual tumor genomes for precision cancer medicine"
homepage: "https://sigven.github.io/pcgr/index.html"
documentation: "https://sigven.github.io/pcgr/articles/running.html"
tool_dev_url: "https://github.com/sigven/pcgr/"
doi: "10.1093/bioinformatics/btx817"
licence: ["MIT"]
identifier: ""

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- bundleversion:
type: string
description: PCGR reference data bundle version
pattern: "*[0-9]*"
ontologies: []
- genome:
type: string
description: PCGR reference genome version
pattern: "grch37|grch38"
ontologies: []

output:
pcgrref:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "${bundleversion}":
type: directory
description: PCGR reference data directory
pattern: "{bundleversion}/"
ontologies: []
versions:
- "versions.yml":
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: "http://edamontology.org/format_3750" # YAML

authors:
- "@famosab"
maintainers:
- "@famosab"
66 changes: 66 additions & 0 deletions modules/nf-core/pcgr/getref/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "pcgr"
tag "pcgr/getref"

// test("human - 20250314 - grch38") {

// when {
// process {
// """
// input[0] = [
// [ id:'test' ],
// '20250314',
// 'grch38'
// ]
// """
// }
// }

// then {
// assert process.success
// assertAll(
// { assert snapshot(
// process.out,
// path(process.out.versions[0]).yaml
// ).match() }
// )
// }

// }

test("human - 20250314 - grch38 - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test' ],
'20250314',
'grch38'
]
"""
}
}

then {
assert process.success
assertAll(
{ assert snapshot(
process.out,
path(process.out.versions[0]).yaml
).match() }
)
}

}

}
46 changes: 46 additions & 0 deletions modules/nf-core/pcgr/getref/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"human - 20250314 - grch38 - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
[

]
]
],
"1": [
"versions.yml:md5,25b668e4db59e455ba5a5b1fde55dc76"
],
"pcgrref": [
[
{
"id": "test"
},
[

]
]
],
"versions": [
"versions.yml:md5,25b668e4db59e455ba5a5b1fde55dc76"
]
},
{
"PCGR_GETREF": {
"curl": "8.16.0",
"tar": 1.35,
"gzip": 1.14
}
}
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.04.8"
},
"timestamp": "2025-10-29T14:11:26.824317"
}
}
Loading