Skip to content

Commit 4be6257

Browse files
committed
merge master branch
2 parents a064a2c + f047a4f commit 4be6257

File tree

26 files changed

+2298
-88
lines changed

26 files changed

+2298
-88
lines changed

.devcontainer/devcontainer.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "nfcore-modules",
3+
"image": "nfcore/devcontainer:dev",
4+
5+
"remoteEnv": {
6+
// Workspace path on the host for mounting with docker-outside-of-docker
7+
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
8+
},
9+
10+
"onCreateCommand": "./.devcontainer/setup.sh",
11+
12+
"remoteUser": "root",
13+
"privileged": true,
14+
15+
"hostRequirements": {
16+
"cpus": 4,
17+
"memory": "16gb",
18+
"storage": "32gb"
19+
}
20+
}

.devcontainer/setup.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
# Customise the terminal command prompt
4+
echo "export PROMPT_DIRTRIM=2" >> $HOME/.bashrc
5+
echo "export PS1='\[\e[3;36m\]\w ->\[\e[0m\\] '" >> $HOME/.bashrc
6+
export PS1='\[\e[3;36m\]\w ->\[\e[0m\\] '
7+
8+
# Update Nextflow
9+
nextflow self-update
10+
11+
# Install pre-commit hooks
12+
pre-commit install --install-hooks
13+
14+
# Update welcome message
15+
echo "Welcome to nf-core/modules devcontainer!" > /usr/local/etc/vscode-dev-containers/first-run-notice.txt
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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+
dependencies:
7+
- bioconda::deacon=0.5.0
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
process DEACON_FILTER {
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://depot.galaxyproject.org/singularity/deacon:0.5.0--h4349ce8_0':
8+
'biocontainers/deacon:0.5.0--h4349ce8_0' }"
9+
10+
input:
11+
tuple val(meta), path(index), path(reads)
12+
13+
output:
14+
tuple val(meta), path("${prefix}*.fq") , emit: fastq_filtered
15+
tuple val(meta), path("${prefix}.json"), emit: log
16+
path "versions.yml" , emit: versions
17+
18+
when:
19+
task.ext.when == null || task.ext.when
20+
21+
script:
22+
def args = task.ext.args ?: ''
23+
prefix = task.ext.prefix ?: "${meta.id}"
24+
def read_type = (reads instanceof List) ? "-o ${prefix}_1.fq -O ${prefix}_2.fq" : "> ${prefix}.fq"
25+
26+
"""
27+
deacon \\
28+
filter \\
29+
--threads ${task.cpus} \\
30+
$args \\
31+
--summary ${prefix}.json \\
32+
-d $index \\
33+
$reads \\
34+
${read_type}
35+
36+
cat <<-END_VERSIONS > versions.yml
37+
"${task.process}":
38+
deacon: \$(deacon --version | head -n1 | sed 's/deacon //g')
39+
END_VERSIONS
40+
"""
41+
42+
stub:
43+
prefix = task.ext.prefix ?: "${meta.id}"
44+
"""
45+
touch ${prefix}.fq
46+
touch ${prefix}.json
47+
48+
cat <<-END_VERSIONS > versions.yml
49+
"${task.process}":
50+
deacon: \$(deacon --version | head -n1 | sed 's/deacon //g')
51+
END_VERSIONS
52+
"""
53+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
2+
name: "deacon_filter"
3+
description: Filter DNA sequences using index of reference genome
4+
keywords:
5+
- filter
6+
- index
7+
- fasta
8+
- fastq
9+
- genome
10+
- reference
11+
- minimizer
12+
- decontamination
13+
tools:
14+
- "deacon":
15+
description: "Fast alignment-free sequence filter"
16+
homepage: "https://github.com/bede/deacon"
17+
documentation: "https://github.com/bede/deacon#readme"
18+
tool_dev_url: "https://github.com/bede/deacon"
19+
doi: "10.1093/bioinformatics/btae004"
20+
licence: ["MIT"]
21+
identifier: "biotools:deacon"
22+
23+
input:
24+
- - meta:
25+
type: map
26+
description: |
27+
Groovy Map containing reference information.
28+
e.g. [ id:'test', single_end:false ]
29+
- index:
30+
type: file
31+
description: Deacon minimizer index file
32+
pattern: "*.idx"
33+
ontologies:
34+
- edam: "http://edamontology.org/data_3210" # Genome index
35+
- reads:
36+
type: file
37+
description: List of input FastQ files of size 1 and 2 for single-end and paired-end data, respectively.
38+
pattern: "*.{fastq,fastq.gz,fqs,fqs.gz,fq,fq.gz}"
39+
ontologies:
40+
- edam: "http://edamontology.org/format_1930" # FASTQ
41+
42+
output:
43+
fastq_filtered:
44+
- - meta:
45+
type: map
46+
description: |
47+
Groovy Map containing reference information.
48+
e.g. [ id:'test', single_end:false ]
49+
- "${prefix}*.fq":
50+
type: file
51+
description: List of output filtered FastQ files of size 1 and 2 for single-end and paired-end data, respectively.
52+
pattern: "*.fq"
53+
ontologies:
54+
- edam: "http://edamontology.org/format_1930" # FASTQ
55+
log:
56+
- - meta:
57+
type: map
58+
description: |
59+
Groovy Map containing reference information.
60+
e.g. [ id:'test', single_end:false ]
61+
- "${prefix}.json":
62+
type: file
63+
description: JSON file containing summary of results.
64+
pattern: "*.json"
65+
ontologies:
66+
- edam: "http://edamontology.org/format_3464" # JSON
67+
68+
versions:
69+
- versions.yml:
70+
type: file
71+
description: File containing software versions
72+
pattern: "versions.yml"
73+
ontologies:
74+
- edam: http://edamontology.org/format_3750 # YAML
75+
76+
authors:
77+
- "@Baksic-Ivan"
78+
- "@Omer0191"
79+
maintainers:
80+
- "@Baksic-Ivan"
81+
- "@Omer0191"
82+
- "@vagkaratzas"
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
nextflow_process {
2+
3+
name "Test Process DEACON_FILTER"
4+
script "../main.nf"
5+
process "DEACON_FILTER"
6+
7+
tag "modules"
8+
tag "modules_nfcore"
9+
tag "deacon"
10+
tag "deacon/filter"
11+
tag "deacon/index"
12+
13+
test("sarscov2 - fastq - single-end") {
14+
15+
setup {
16+
run("DEACON_INDEX") {
17+
script "../../index/main.nf"
18+
process {
19+
"""
20+
input[0] = [
21+
[ id:'test', single_end:true ], // meta map
22+
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
23+
]
24+
"""
25+
}
26+
}
27+
}
28+
29+
when {
30+
process {
31+
"""
32+
filter_fastq_ch = Channel.of(
33+
[
34+
[ id:'test', single_end:true ], // meta map
35+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
36+
]
37+
)
38+
input[0] = DEACON_INDEX.out.index.join(filter_fastq_ch)
39+
"""
40+
}
41+
}
42+
43+
then {
44+
assertAll(
45+
{ assert process.success },
46+
{ assert snapshot(
47+
file(process.out.log[0][1]).name,
48+
process.out.fastq_filtered,
49+
process.out.versions.collect { path(it).yaml }
50+
).match()}
51+
)
52+
}
53+
54+
}
55+
56+
test("sarscov2 - fastq - paired-end") {
57+
58+
setup {
59+
run("DEACON_INDEX") {
60+
script "../../index/main.nf"
61+
process {
62+
"""
63+
input[0] = [
64+
[ id:'test', single_end:false ], // meta map
65+
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
66+
]
67+
"""
68+
}
69+
}
70+
}
71+
72+
when {
73+
process {
74+
"""
75+
filter_fastq_ch = Channel.of(
76+
[
77+
[ id:'test', single_end:false ], // meta map
78+
[
79+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
80+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
81+
]
82+
]
83+
)
84+
input[0] = DEACON_INDEX.out.index.join(filter_fastq_ch)
85+
"""
86+
}
87+
}
88+
89+
then {
90+
assertAll(
91+
{ assert process.success },
92+
{ assert snapshot(
93+
file(process.out.log[0][1]).name,
94+
process.out.fastq_filtered
95+
).match()},
96+
{ assert snapshot(process.out.versions).match("versions") }
97+
)
98+
}
99+
100+
}
101+
102+
test("sarscov2 - fastq - single-end - stub") {
103+
104+
options "-stub"
105+
106+
setup {
107+
run("DEACON_INDEX") {
108+
script "../../index/main.nf"
109+
process {
110+
"""
111+
input[0] = [
112+
[ id:'test', single_end:true ], // meta map
113+
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
114+
]
115+
"""
116+
}
117+
}
118+
}
119+
120+
when {
121+
process {
122+
"""
123+
filter_fastq_ch = Channel.of(
124+
[
125+
[ id:'test', single_end:true ], // meta map
126+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
127+
]
128+
)
129+
input[0] = DEACON_INDEX.out.index.join(filter_fastq_ch)
130+
"""
131+
}
132+
}
133+
134+
then {
135+
assertAll(
136+
{ assert process.success },
137+
{ assert snapshot(
138+
process.out,
139+
process.out.versions.collect { path(it).yaml }
140+
).match()}
141+
)
142+
}
143+
}
144+
145+
}

0 commit comments

Comments
 (0)