Skip to content

Commit dfa786c

Browse files
Adds seq2hla (nf-core#8939)
* add seq2hla * circumvent empty checksums
1 parent 3351c21 commit dfa786c

File tree

5 files changed

+699
-0
lines changed

5 files changed

+699
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
3+
channels:
4+
- conda-forge
5+
- bioconda
6+
- defaults
7+
dependencies:
8+
- bioconda::seq2hla=2.3

modules/nf-core/seq2hla/main.nf

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
process SEQ2HLA {
2+
tag "${meta.id}"
3+
label 'process_medium'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
7+
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/5c/5c8c9c11302a03e4f8fc9bbd0ce818e9f798e38f872c3ec099b8bb1c444185e0/data'
8+
: 'community.wave.seqera.io/library/seq2hla:2.3--26344ebe67dd0e8e'}"
9+
10+
input:
11+
tuple val(meta), path(reads)
12+
13+
output:
14+
tuple val(meta), path("*ClassI-class.bowtielog") , emit: class1_bowtielog
15+
tuple val(meta), path("*ClassI-class.expression") , emit: class1_expression
16+
tuple val(meta), path("*ClassI-class.HLAgenotype2digits") , emit: class1_genotype_2d
17+
tuple val(meta), path("*ClassI-class.HLAgenotype4digits") , emit: class1_genotype_4d
18+
tuple val(meta), path("*ClassI-nonclass.bowtielog") , emit: class1_nonclass_bowtielog
19+
tuple val(meta), path("*ClassI-nonclass.expression") , emit: class1_nonclass_expression
20+
tuple val(meta), path("*ClassI-nonclass.HLAgenotype2digits"), emit: class1_nonclass_genotype_2d
21+
tuple val(meta), path("*ClassI-nonclass.HLAgenotype4digits"), emit: class1_nonclass_genotype_4d
22+
tuple val(meta), path("*ClassII.bowtielog") , emit: class2_bowtielog
23+
tuple val(meta), path("*ClassII.expression") , emit: class2_expression
24+
tuple val(meta), path("*ClassII.HLAgenotype2digits") , emit: class2_genotype_2d
25+
tuple val(meta), path("*ClassII.HLAgenotype4digits") , emit: class2_genotype_4d
26+
tuple val(meta), path("*.ambiguity") , emit: ambiguity, optional: true
27+
path "versions.yml" , emit: versions
28+
29+
when:
30+
task.ext.when == null || task.ext.when
31+
32+
script:
33+
def args = task.ext.args ?: ''
34+
def prefix = task.ext.prefix ?: "${meta.id}"
35+
"""
36+
[ ! -f ${prefix}_1.fastq.gz ] && ln -sf ${reads[0]} ${prefix}_1.fastq.gz
37+
[ ! -f ${prefix}_2.fastq.gz ] && ln -sf ${reads[1]} ${prefix}_2.fastq.gz
38+
39+
seq2HLA \\
40+
-1 ${prefix}_1.fastq.gz \\
41+
-2 ${prefix}_2.fastq.gz \\
42+
-r ${prefix} \\
43+
-p ${task.cpus} \\
44+
${args}
45+
46+
cat <<-END_VERSIONS > versions.yml
47+
"${task.process}":
48+
seq2hla: \$(seq2HLA --version |& sed 's/seq2HLA.py //')
49+
END_VERSIONS
50+
"""
51+
52+
stub:
53+
def args = task.ext.args ?: ''
54+
def prefix = task.ext.prefix ?: "${meta.id}"
55+
"""
56+
touch ${prefix}-ClassI-class.HLAgenotype2digits
57+
touch ${prefix}-ClassII.HLAgenotype2digits
58+
touch ${prefix}-ClassI-class.HLAgenotype4digits
59+
touch ${prefix}-ClassII.HLAgenotype4digits
60+
touch ${prefix}-ClassI-class.bowtielog
61+
touch ${prefix}-ClassII.bowtielog
62+
touch ${prefix}-ClassI-class.expression
63+
touch ${prefix}-ClassII.expression
64+
touch ${prefix}-ClassI-nonclass.HLAgenotype2digits
65+
touch ${prefix}-ClassI-nonclass.HLAgenotype4digits
66+
touch ${prefix}-ClassI-nonclass.bowtielog
67+
touch ${prefix}-ClassI-nonclass.expression
68+
touch ${prefix}.ambiguity
69+
70+
cat <<-END_VERSIONS > versions.yml
71+
"${task.process}":
72+
seq2hla: \$(seq2HLA --version |& sed 's/seq2HLA.py //')
73+
END_VERSIONS
74+
"""
75+
}

modules/nf-core/seq2hla/meta.yml

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
3+
name: "seq2hla"
4+
description: Precision HLA typing and expression from RNA-seq data using seq2HLA
5+
keywords:
6+
- hla
7+
- typing
8+
- rna-seq
9+
- genomics
10+
- immunogenetics
11+
tools:
12+
- "seq2hla":
13+
description: "Precision HLA typing and expression from next-generation RNA sequencing data"
14+
homepage: "https://github.com/TRON-Bioinformatics/seq2HLA"
15+
documentation: "https://github.com/TRON-Bioinformatics/seq2HLA#readme"
16+
tool_dev_url: "https://github.com/TRON-Bioinformatics/seq2HLA"
17+
doi: "10.1186/s13073-015-0240-5"
18+
licence: ['MIT']
19+
identifier: biotools:seq2HLA
20+
21+
input:
22+
- - meta:
23+
type: map
24+
description: |
25+
Groovy Map containing sample information
26+
e.g. `[ id:'sample1', single_end:false ]`
27+
- reads:
28+
type: file
29+
description: Paired-end FASTQ files for RNA-seq data
30+
pattern: "*.{fastq.gz,fq.gz}"
31+
ontologies:
32+
- edam: http://edamontology.org/format_1930 # FASTQ
33+
34+
output:
35+
class1_genotype_2d:
36+
- - meta:
37+
type: map
38+
description: |
39+
Groovy Map containing sample information
40+
e.g. `[ id:'sample1', single_end:false ]`
41+
- "*ClassI-class.HLAgenotype2digits":
42+
type: file
43+
description: HLA Class I 2-digit genotype results
44+
pattern: "*ClassI-class.HLAgenotype2digits"
45+
ontologies: []
46+
class2_genotype_2d:
47+
- - meta:
48+
type: map
49+
description: |
50+
Groovy Map containing sample information
51+
e.g. `[ id:'sample1', single_end:false ]`
52+
- "*ClassII.HLAgenotype2digits":
53+
type: file
54+
description: HLA Class II 2-digit genotype results
55+
pattern: "*ClassII.HLAgenotype2digits"
56+
ontologies: []
57+
class1_genotype_4d:
58+
- - meta:
59+
type: map
60+
description: |
61+
Groovy Map containing sample information
62+
e.g. `[ id:'sample1', single_end:false ]`
63+
- "*ClassI-class.HLAgenotype4digits":
64+
type: file
65+
description: HLA Class I 4-digit genotype results
66+
pattern: "*ClassI-class.HLAgenotype4digits"
67+
ontologies: []
68+
class2_genotype_4d:
69+
- - meta:
70+
type: map
71+
description: |
72+
Groovy Map containing sample information
73+
e.g. `[ id:'sample1', single_end:false ]`
74+
- "*ClassII.HLAgenotype4digits":
75+
type: file
76+
description: HLA Class II 4-digit genotype results
77+
pattern: "*ClassII.HLAgenotype4digits"
78+
ontologies: []
79+
class1_bowtielog:
80+
- - meta:
81+
type: map
82+
description: |
83+
Groovy Map containing sample information
84+
e.g. `[ id:'sample1', single_end:false ]`
85+
- "*ClassI-class.bowtielog":
86+
type: file
87+
description: HLA Class I Bowtie alignment log
88+
pattern: "*ClassI-class.bowtielog"
89+
ontologies: []
90+
class2_bowtielog:
91+
- - meta:
92+
type: map
93+
description: |
94+
Groovy Map containing sample information
95+
e.g. `[ id:'sample1', single_end:false ]`
96+
- "*ClassII.bowtielog":
97+
type: file
98+
description: HLA Class II Bowtie alignment log
99+
pattern: "*ClassII.bowtielog"
100+
ontologies: []
101+
class1_expression:
102+
- - meta:
103+
type: map
104+
description: |
105+
Groovy Map containing sample information
106+
e.g. `[ id:'sample1', single_end:false ]`
107+
- "*ClassI-class.expression":
108+
type: file
109+
description: HLA Class I expression results
110+
pattern: "*ClassI-class.expression"
111+
ontologies: []
112+
class2_expression:
113+
- - meta:
114+
type: map
115+
description: |
116+
Groovy Map containing sample information
117+
e.g. `[ id:'sample1', single_end:false ]`
118+
- "*ClassII.expression":
119+
type: file
120+
description: HLA Class II expression results
121+
pattern: "*ClassII.expression"
122+
ontologies: []
123+
class1_nonclass_genotype_2d:
124+
- - meta:
125+
type: map
126+
description: |
127+
Groovy Map containing sample information
128+
e.g. `[ id:'sample1', single_end:false ]`
129+
- "*ClassI-nonclass.HLAgenotype2digits":
130+
type: file
131+
description: HLA Class I non-classical 2-digit genotype results
132+
pattern: "*ClassI-nonclass.HLAgenotype2digits"
133+
ontologies: []
134+
ambiguity:
135+
- - meta:
136+
type: map
137+
description: |
138+
Groovy Map containing sample information
139+
e.g. `[ id:'sample1', single_end:false ]`
140+
- "*.ambiguity":
141+
type: file
142+
description: HLA typing ambiguity results
143+
pattern: "*.ambiguity"
144+
ontologies: []
145+
class1_nonclass_genotype_4d:
146+
- - meta:
147+
type: map
148+
description: |
149+
Groovy Map containing sample information
150+
e.g. `[ id:'sample1', single_end:false ]`
151+
- "*ClassI-nonclass.HLAgenotype4digits":
152+
type: file
153+
description: HLA Class I non-classical 4-digit genotype results
154+
pattern: "*ClassI-nonclass.HLAgenotype4digits"
155+
ontologies: []
156+
class1_nonclass_bowtielog:
157+
- - meta:
158+
type: map
159+
description: |
160+
Groovy Map containing sample information
161+
e.g. `[ id:'sample1', single_end:false ]`
162+
- "*ClassI-nonclass.bowtielog":
163+
type: file
164+
description: HLA Class I non-classical Bowtie alignment log
165+
pattern: "*ClassI-nonclass.bowtielog"
166+
ontologies: []
167+
class1_nonclass_expression:
168+
- - meta:
169+
type: map
170+
description: |
171+
Groovy Map containing sample information
172+
e.g. `[ id:'sample1', single_end:false ]`
173+
- "*ClassI-nonclass.expression":
174+
type: file
175+
description: HLA Class I non-classical expression results
176+
pattern: "*ClassI-nonclass.expression"
177+
ontologies: []
178+
versions:
179+
- versions.yml:
180+
type: file
181+
description: File containing software versions
182+
pattern: "versions.yml"
183+
ontologies:
184+
- edam: http://edamontology.org/format_3750 # YAML
185+
186+
authors:
187+
- "@FriederikeHanssen"
188+
maintainers:
189+
- "@FriederikeHanssen"
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
nextflow_process {
2+
3+
name "Test Process SEQ2HLA"
4+
script "../main.nf"
5+
process "SEQ2HLA"
6+
7+
tag "modules"
8+
tag "modules_nfcore"
9+
tag "seq2hla"
10+
11+
test("homo_sapiens - fastq") {
12+
13+
when {
14+
process {
15+
"""
16+
input[0] = [
17+
[ id:'test', single_end:false ], // meta map
18+
[
19+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_rnaseq_1.fastq.gz', checkIfExists: true),
20+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_rnaseq_2.fastq.gz', checkIfExists: true)
21+
]
22+
]
23+
"""
24+
}
25+
}
26+
27+
then {
28+
assert process.success
29+
assertAll(
30+
{ assert snapshot(
31+
process.out.class1_bowtielog,
32+
process.out.class1_genotype_2d,
33+
process.out.class1_genotype_4d,
34+
process.out.class1_nonclass_bowtielog,
35+
process.out.class1_nonclass_genotype_2d,
36+
process.out.class1_nonclass_genotype_4d,
37+
process.out.class2_bowtielog,
38+
process.out.class2_genotype_2d,
39+
process.out.class2_genotype_4d,
40+
process.out.ambiguity,
41+
process.out.versions
42+
).match() },
43+
{ assert file(process.out.class1_expression[0][1]).name.endsWith("ClassI-class.expression") },
44+
{ assert file(process.out.class2_expression[0][1]).name.endsWith("ClassII.expression") },
45+
{ assert file(process.out.class1_nonclass_expression[0][1]).name.endsWith("ClassI-nonclass.expression") }
46+
)
47+
}
48+
49+
}
50+
51+
test("homo_sapiens - fastq - stub") {
52+
53+
options "-stub"
54+
55+
when {
56+
process {
57+
"""
58+
input[0] = [
59+
[ id:'test', single_end:false ], // meta map
60+
[
61+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_rnaseq_1.fastq.gz', checkIfExists: true),
62+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_rnaseq_2.fastq.gz', checkIfExists: true)
63+
]
64+
]
65+
"""
66+
}
67+
}
68+
69+
then {
70+
assert process.success
71+
assertAll(
72+
{ assert snapshot(process.out).match() }
73+
)
74+
}
75+
76+
}
77+
78+
}

0 commit comments

Comments
 (0)