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
26 changes: 26 additions & 0 deletions modules/nf-core/stitchr/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ---- Base image ----
FROM python:3.14

LABEL authors="Clara Bierwirth" \
description="Stitchr container with IMGT human and mouse data"

# ---- Environment settings ----
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PATH="/usr/local/bin:${PATH}"

# ---- System dependencies ----
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
build-essential \
wget \
&& rm -rf /var/lib/apt/lists/*

# ---- Install Stitchr and IMGTgeneDL ----
RUN pip install --no-cache-dir --upgrade --force-reinstall \
stitchr==1.3.1 \
IMGTgeneDL==0.6.1

# ---- Download human and mouse IMGT data ----
RUN stitchrdl -s human
RUN stitchrdl -s mouse
50 changes: 50 additions & 0 deletions modules/nf-core/stitchr/thimble/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
process STITCHR_THIMBLE {
tag "$meta.id"
label 'process_single'


container "ghcr.io/qbic-pipelines/stitchr:1.3.1"


input:
tuple val(meta), path(samplesheet)
tuple val(meta2), path(alt_codon_usage)
tuple val(meta3), path(allele_preferences)
val(species)


output:
tuple val(meta), path("${meta.id}.tsv"), emit: thimble
tuple val("${task.process}"), val('stitchr'), eval("stitchr --version"), topic: versions, emit: versions_stitchr
tuple val("${task.process}"), val('imgtgenedl'), val("0.6.1"), topic: versions, emit: versions_imgtgenedl

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
//optional files:
def codon_usage = alt_codon_usage ? "-cu ${alt_codon_usage}" : ""
def allele_preference = allele_preferences ? "-p ${allele_preferences}" : ""

"""
thimble \
$args \
-in ${samplesheet} \
-o ${prefix}.tsv \
${codon_usage} \
${allele_preference} \
-s ${species}
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
echo $args

touch ${prefix}.tsv
"""
}
117 changes: 117 additions & 0 deletions modules/nf-core/stitchr/thimble/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: "stitchr_thimble"
description: Automatic TCR nucleotide sequence generation from V, J and CDR3
information
keywords:
- TCR
- sequence
- immunology
tools:
- "stitchr":
description: "Automatic TCR nucleotide sequence generation from V, J and CDR3
information"
homepage: "https://github.com/JamieHeather/stitchr"
documentation: "https://jamieheather.github.io/stitchr/index.html"
tool_dev_url: "https://github.com/JamieHeather/stitchr"
doi: "10.1093/nar/gkac190"
licence:
- "MIT"
identifier: ""
- "imgtgenedl":
description: "provides access to TCR and IG genes stored in IMGT/GENE-DB"
homepage: "https://github.com/JamieHeather/IMGTgeneDL"
documentation: "https://github.com/JamieHeather/IMGTgeneDL/blob/main/README.md"
tool_dev_url: "https://github.com/JamieHeather/IMGTgeneDL"
doi: "10.1093/nar/gkab1136"
licence:
- "MIT"
identifier: ""
input:
- - meta:
type: map
description: |
Groovy Map containing per sample information
e.g. `[ id:'sample1' ]`
- samplesheet:
type: file
description: tsv containing J,V and CDR3 information
pattern: "*.tsv"
ontologies:
- edam: http://edamontology.org/format_3475
- - meta2:
type: map
description: |
Information about codon usage
- alt_codon_usage:
type: file
description: txt containing alternative codon usage in kazusa-like format
pattern: "*.txt"
ontologies: []
- - meta3:
type: map
description: |
Information about non-standard allele preferences
- allele_preferences:
type: file
description: tsv containing alternative allele preferences
pattern: "*.tsv"
ontologies:
- edam: http://edamontology.org/format_3475
- species:
type: string
description: Species ("mouse" or "human")
output:
thimble:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- ${meta.id}.tsv:
type: file
description: |
tsv containing full TCR sequences
ontologies: []
versions_stitchr:
- - ${task.process}:
type: string
description: The name of the process
- stitchr:
type: string
description: The name of the tool
- stitchr --version:
type: eval
description: The expression to obtain the version of the tool
versions_imgtgenedl:
- - ${task.process}:
type: string
description: The name of the process
- imgtgenedl:
type: string
description: The name of the tool
- 0.6.1:
type: string
description: The expression to obtain the version of the tool
topics:
versions:
- - ${task.process}:
type: string
description: The name of the process
- stitchr:
type: string
description: The name of the tool
- stitchr --version:
type: eval
description: The expression to obtain the version of the tool
- - ${task.process}:
type: string
description: The name of the process
- imgtgenedl:
type: string
description: The name of the tool
- 0.6.1:
type: string
description: The expression to obtain the version of the tool
authors:
- "@Clara0611"
maintainers:
- "@Clara0611"
82 changes: 82 additions & 0 deletions modules/nf-core/stitchr/thimble/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "stitchr"
tag "stitchr/thimble"

test("human - tsv") {

when {
process {
"""
input[0] = [
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/stitchr/stitchr_vdjdb.tsv', checkIfExists: true),
]
input[1] = [
[ id: 'alt_codon_usage' ],
[]
]
input[2] = [
[ id: 'allele_preference' ],
[]
]
input[3] = "human"
"""
}
}

then {
assert process.success
assertAll(
{ assert snapshot(
process.out,
process.out.findAll { key, val -> key.startsWith('versions') }
).match() }
)
}

}

test("human - tsv - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/stitchr/stitchr_vdjdb.tsv', checkIfExists: true),
]
input[1] = [
[ id: 'alt_codon_usage' ],
[]
]
input[2] = [
[ id: 'allele_preference' ],
[]
]
input[3] = "human"
"""
}
}

then {
assert process.success
assertAll(
{ assert snapshot(
process.out,
process.out.findAll { key, val -> key.startsWith('versions') }
).match() }
)
}

}

}
Loading
Loading