Skip to content

Commit 2b22ffe

Browse files
committed
Add autocycler modules
1 parent 01bfb37 commit 2b22ffe

File tree

24 files changed

+1277
-0
lines changed

24 files changed

+1277
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
# TODO nf-core: List required Conda package(s).
8+
# Software MUST be pinned to channel (i.e. "bioconda"), version (i.e. "1.10").
9+
# For Conda, the build (i.e. "h9402c20_2") must be EXCLUDED to support installation on different operating systems.
10+
- "bioconda::autocycler=0.5.2"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
process AUTOCYCLER_CLUSTER {
2+
tag "$meta.id"
3+
label 'process_low'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7+
'https://depot.galaxyproject.org/singularity/autocycler:0.5.2--h3ab6199_0':
8+
'biocontainers/autocycler:0.5.2--h3ab6199_0' }"
9+
10+
input:
11+
tuple val(meta), path(gfa)
12+
13+
output:
14+
tuple val(meta), path("clustering/qc_pass/*/*.gfa"), emit: clusters
15+
tuple val(meta), path("clustering/qc_pass/*/*.yaml"), emit: clusterstats
16+
tuple val(meta), path("clustering/*.newick"), emit: newick
17+
tuple val(meta), path("clustering/*.tsv"), emit: tsv
18+
tuple val(meta), path("clustering/*.phylip"), emit: pairwisedistances
19+
tuple val(meta), path("clustering/*.yaml"), emit: stats
20+
21+
path "versions.yml" , emit: versions
22+
23+
when:
24+
task.ext.when == null || task.ext.when
25+
26+
script:
27+
def args = task.ext.args ?: ''
28+
def prefix = task.ext.prefix ?: "${meta.id}"
29+
"""
30+
autocycler cluster \\
31+
$args \\
32+
-a .
33+
34+
cat <<-END_VERSIONS > versions.yml
35+
"${task.process}":
36+
autocycler: \$(autocycler --version | sed 's/^[^ ]* //')
37+
END_VERSIONS
38+
"""
39+
40+
stub:
41+
def args = task.ext.args ?: ''
42+
def prefix = task.ext.prefix ?: "${meta.id}"
43+
"""
44+
mkdir clustering/qc_pass/cluster_000 -p
45+
touch clustering.{newick,yaml,tsv}
46+
touch pairwise_distances.phylip
47+
touch clustering/qc_pass/cluster_000/0_untrimmed.{gfa,yaml}
48+
49+
cat <<-END_VERSIONS > versions.yml
50+
"${task.process}":
51+
autocycler: \$(autocycler --version | sed 's/^[^ ]* //')
52+
END_VERSIONS
53+
"""
54+
}
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
3+
name: "autocycler_cluster"
4+
description: Cluster replicons in compressed assemblies with Autocycler.
5+
keywords:
6+
- autocycler
7+
- genome-assembly
8+
- clustering
9+
- long-read
10+
tools:
11+
- autocycler:
12+
description: "A tools for generating consensus long-read assemblies for bacterial genomes."
13+
homepage: "https://github.com/rrwick/Autocycler/wiki"
14+
documentation: "https://github.com/rrwick/Autocycler/wiki"
15+
tool_dev_url: "https://github.com/rrwick/Autocycler"
16+
doi: "10.1093/bioinformatics/btaf474"
17+
licence: ["GPL-3.0"]
18+
19+
input:
20+
- - meta:
21+
type: map
22+
description: |
23+
Groovy Map containing sample information
24+
e.g. `[ id:'sample1' ]`
25+
- gfa:
26+
type: file
27+
description: |
28+
Assembly graph files produced by the compression step.
29+
pattern: "*/*.gfa"
30+
31+
output:
32+
clusters:
33+
- - meta:
34+
type: map
35+
description: |
36+
Groovy Map containing sample information
37+
e.g. `[ id:'sample1' ]`
38+
- "clustering/qc_pass/*/*.gfa":
39+
type: file
40+
description: Aassembly graphs of clustered contigs.
41+
pattern: "clustering/qc_pass/*/*.gfa"
42+
ontologies:
43+
- edam: "http://edamontology.org/format_3975" #GFA1
44+
clusterstats:
45+
- - meta:
46+
type: map
47+
description: |
48+
Groovy Map containing sample information
49+
e.g. `[ id:'sample1' ]`
50+
- "clustering/qc_pass/*/*.yaml":
51+
type: file
52+
description: Per-cluster metrics reported by Autocycler.
53+
pattern: "clustering/qc_pass/*/*.yaml"
54+
ontologies:
55+
- edam: "http://edamontology.org/format_3750" # YAML
56+
newick:
57+
- - meta:
58+
type: map
59+
description: |
60+
Groovy Map containing sample information
61+
e.g. `[ id:'sample1' ]`
62+
- "clustering/*.newick":
63+
type: file
64+
description: Newick tree relating contigs.
65+
pattern: "clustering/*.newick"
66+
tsv:
67+
- - meta:
68+
type: map
69+
description: |
70+
Groovy Map containing sample information
71+
e.g. `[ id:'sample1' ]`
72+
- "clustering/*.tsv":
73+
type: file
74+
description: Tabular summary of cluster relationships.
75+
pattern: "clustering/*.tsv"
76+
pairwisedistances:
77+
- - meta:
78+
type: map
79+
description: |
80+
Groovy Map containing sample information
81+
e.g. `[ id:'sample1' ]`
82+
- "clustering/*.phylip":
83+
type: file
84+
description: Pairwise distance matrix in PHYLIP format.
85+
pattern: "clustering/*.phylip"
86+
stats:
87+
- - meta:
88+
type: map
89+
description: |
90+
Groovy Map containing sample information
91+
e.g. `[ id:'sample1' ]`
92+
- "clustering/*.yaml":
93+
type: file
94+
description: Run-level statistics for the clustering step.
95+
pattern: "clustering/*.yaml"
96+
ontologies:
97+
- edam: "http://edamontology.org/format_3750" # YAML
98+
versions:
99+
- "versions.yml":
100+
type: file
101+
description: File containing software versions
102+
pattern: "versions.yml"
103+
ontologies:
104+
- edam: "http://edamontology.org/format_3750" # YAML
105+
106+
authors:
107+
- "@dwells-eit"
108+
maintainers:
109+
- "@dwells-eit"
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// TODO nf-core: Once you have added the required tests, please run the following command to build this file:
2+
// nf-core modules test autocycler/cluster
3+
nextflow_process {
4+
5+
name "Test Process AUTOCYCLER_CLUSTER"
6+
script "../main.nf"
7+
process "AUTOCYCLER_CLUSTER"
8+
9+
tag "modules"
10+
tag "modules_"
11+
tag "autocycler"
12+
tag "autocycler/cluster"
13+
14+
// TODO nf-core: Change the test name preferably indicating the test-data and file-format used
15+
test("sarscov2 - bam") {
16+
17+
// TODO nf-core: If you are created a test for a chained module
18+
// (the module requires running more than one process to generate the required output)
19+
// add the 'setup' method here.
20+
// You can find more information about how to use a 'setup' method in the docs (https://nf-co.re/docs/contributing/modules#steps-for-creating-nf-test-for-chained-modules).
21+
22+
when {
23+
process {
24+
"""
25+
// TODO nf-core: define inputs of the process here. Example:
26+
27+
input[0] = [
28+
[ id:'test', single_end:false ], // meta map
29+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
30+
]
31+
"""
32+
}
33+
}
34+
35+
then {
36+
assertAll(
37+
{ assert process.success },
38+
{ assert snapshot(process.out).match() }
39+
//TODO nf-core: Add all required assertions to verify the test output.
40+
// See https://nf-co.re/docs/contributing/tutorials/nf-test_assertions for more information and examples.
41+
)
42+
}
43+
44+
}
45+
46+
// TODO nf-core: Change the test name preferably indicating the test-data and file-format used but keep the " - stub" suffix.
47+
test("sarscov2 - bam - stub") {
48+
49+
options "-stub"
50+
51+
when {
52+
process {
53+
"""
54+
// TODO nf-core: define inputs of the process here. Example:
55+
56+
input[0] = [
57+
[ id:'test', single_end:false ], // meta map
58+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
59+
]
60+
"""
61+
}
62+
}
63+
64+
then {
65+
assertAll(
66+
{ assert process.success },
67+
{ assert snapshot(process.out).match() }
68+
//TODO nf-core: Add all required assertions to verify the test output.
69+
)
70+
}
71+
72+
}
73+
74+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
# TODO nf-core: List required Conda package(s).
8+
# Software MUST be pinned to channel (i.e. "bioconda"), version (i.e. "1.10").
9+
# For Conda, the build (i.e. "h9402c20_2") must be EXCLUDED to support installation on different operating systems.
10+
- "bioconda::autocycler=0.5.2"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
process AUTOCYCLER_COMBINE {
2+
tag "$meta.id"
3+
label 'process_single'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7+
'https://depot.galaxyproject.org/singularity/autocycler:0.5.2--h3ab6199_0':
8+
'biocontainers/autocycler:0.5.2--h3ab6199_0' }"
9+
10+
input:
11+
tuple val(meta), path(clusters)
12+
13+
output:
14+
tuple val(meta), path("$prefix/consensus_assembly.fasta"), emit: fasta
15+
tuple val(meta), path("$prefix/consensus_assembly.gfa"), emit: gfa
16+
tuple val(meta), path("$prefix/consensus_assembly.yaml"), emit: stats
17+
path "versions.yml" , emit: versions
18+
19+
when:
20+
task.ext.when == null || task.ext.when
21+
22+
script:
23+
def args = task.ext.args ?: ''
24+
prefix = task.ext.prefix ?: "${meta.id}"
25+
"""
26+
autocycler combine \\
27+
$args \\
28+
-i $clusters \\
29+
-a $prefix
30+
31+
cat <<-END_VERSIONS > versions.yml
32+
"${task.process}":
33+
autocycler: \$(autocycler --version | sed 's/^[^ ]* //')
34+
END_VERSIONS
35+
"""
36+
37+
stub:
38+
def args = task.ext.args ?: ''
39+
prefix = task.ext.prefix ?: "${meta.id}"
40+
"""
41+
mkdir $prefix
42+
touch $prefix/consensus_assembly.{fasta,gfa,yaml}
43+
44+
cat <<-END_VERSIONS > versions.yml
45+
"${task.process}":
46+
autocycler: \$(autocycler --version | sed 's/^[^ ]* //')
47+
END_VERSIONS
48+
"""
49+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
3+
name: "autocycler_combine"
4+
description: Merge resolved cluster assemblies into final consensus outputs with Autocycler.
5+
keywords:
6+
- autocycler
7+
- genome-assembly
8+
- consensus
9+
- long-read
10+
tools:
11+
- autocycler:
12+
description: "A tools for generating consensus long-read assemblies for bacterial genomes."
13+
homepage: "https://github.com/rrwick/Autocycler/wiki"
14+
documentation: "https://github.com/rrwick/Autocycler/wiki"
15+
tool_dev_url: "https://github.com/rrwick/Autocycler"
16+
doi: "10.1093/bioinformatics/btaf474"
17+
licence: ["GPL-3.0"]
18+
19+
input:
20+
- - meta:
21+
type: map
22+
description: |
23+
Groovy Map containing sample information
24+
e.g. `[ id:'sample1' ]`
25+
- clusters:
26+
type: file
27+
description: |
28+
Final cluster assembly graphs (GFA) to be combined into consensus sequences.
29+
pattern: "*.gfa"
30+
31+
output:
32+
fasta:
33+
- - meta:
34+
type: map
35+
description: |
36+
Groovy Map containing sample information
37+
e.g. `[ id:'sample1' ]`
38+
- "*/consensus_assembly.fasta":
39+
type: file
40+
description: Consensus genome sequence generated by Autocycler.
41+
pattern: "*/consensus_assembly.fasta"
42+
ontologies:
43+
- edam: "http://edamontology.org/format_1929" # FASTA
44+
gfa:
45+
- - meta:
46+
type: map
47+
description: |
48+
Groovy Map containing sample information
49+
e.g. `[ id:'sample1' ]`
50+
- "*/consensus_assembly.gfa":
51+
type: file
52+
description: Consensus assembly graph generated by Autocycler.
53+
pattern: "*/consensus_assembly.gfa"
54+
ontologies:
55+
- edam: "http://edamontology.org/format_3975" #GFA1 stats:
56+
- - meta:
57+
type: map
58+
description: |
59+
Groovy Map containing sample information
60+
e.g. `[ id:'sample1' ]`
61+
- "*/consensus_assembly.yaml":
62+
type: file
63+
description: Run statistics for the combine step.
64+
pattern: "*/consensus_assembly.yaml"
65+
ontologies:
66+
- edam: "http://edamontology.org/format_3750" # YAML
67+
versions:
68+
- "versions.yml":
69+
type: file
70+
description: File containing software versions
71+
pattern: "versions.yml"
72+
ontologies:
73+
- edam: "http://edamontology.org/format_3750" # YAML
74+
75+
authors:
76+
- "@dwells-eit"
77+
maintainers:
78+
- "@dwells-eit"

0 commit comments

Comments
 (0)