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
7 changes: 7 additions & 0 deletions modules/nf-core/autocycler/cluster/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::autocycler=0.5.2"
51 changes: 51 additions & 0 deletions modules/nf-core/autocycler/cluster/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
process AUTOCYCLER_CLUSTER {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/autocycler:0.5.2--h3ab6199_0':
'biocontainers/autocycler:0.5.2--h3ab6199_0' }"

input:
tuple val(meta), path(gfa)

output:
tuple val(meta), path("clustering/qc_pass/*/*.gfa"), emit: clusters
tuple val(meta), path("clustering/qc_pass/*/*.yaml"), emit: clusterstats
tuple val(meta), path("clustering/*.newick"), emit: newick
tuple val(meta), path("clustering/*.tsv"), emit: tsv
tuple val(meta), path("clustering/*.phylip"), emit: pairwisedistances
tuple val(meta), path("clustering/*.yaml"), emit: stats
path "versions.yml", emit: versions

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

script:
def args = task.ext.args ?: ''
"""
autocycler cluster \\
$args \\
-a .

cat <<-END_VERSIONS > versions.yml
"${task.process}":
autocycler: \$(autocycler --version | sed 's/^[^ ]* //')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
"""
mkdir clustering/qc_pass/cluster_000 -p
touch clustering/clustering.{newick,yaml,tsv}
touch clustering/pairwise_distances.phylip
touch clustering/qc_pass/cluster_000/0_untrimmed.{gfa,yaml}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
autocycler: \$(autocycler --version | sed 's/^[^ ]* //')
END_VERSIONS
"""
}
109 changes: 109 additions & 0 deletions modules/nf-core/autocycler/cluster/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "autocycler_cluster"
description: Cluster replicons in compressed assemblies with Autocycler.
keywords:
- autocycler
- genome-assembly
- clustering
- long-read
tools:
- autocycler:
description: "A tools for generating consensus long-read assemblies for bacterial genomes."
homepage: "https://github.com/rrwick/Autocycler/wiki"
documentation: "https://github.com/rrwick/Autocycler/wiki"
tool_dev_url: "https://github.com/rrwick/Autocycler"
doi: "10.1093/bioinformatics/btaf474"
licence: ["GPL-3.0"]

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- gfa:
type: file
description: |
Assembly graph files produced by the compression step.
pattern: "*/*.gfa"

output:
clusters:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "clustering/qc_pass/*/*.gfa":
type: file
description: Aassembly graphs of clustered contigs.
pattern: "clustering/qc_pass/*/*.gfa"
ontologies:
- edam: "http://edamontology.org/format_3975" #GFA1
clusterstats:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "clustering/qc_pass/*/*.yaml":
type: file
description: Per-cluster metrics reported by Autocycler.
pattern: "clustering/qc_pass/*/*.yaml"
ontologies:
- edam: "http://edamontology.org/format_3750" # YAML
newick:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "clustering/*.newick":
type: file
description: Newick tree relating contigs.
pattern: "clustering/*.newick"
tsv:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "clustering/*.tsv":
type: file
description: Tabular summary of cluster relationships.
pattern: "clustering/*.tsv"
pairwisedistances:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "clustering/*.phylip":
type: file
description: Pairwise distance matrix in PHYLIP format.
pattern: "clustering/*.phylip"
stats:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "clustering/*.yaml":
type: file
description: Run-level statistics for the clustering step.
pattern: "clustering/*.yaml"
ontologies:
- edam: "http://edamontology.org/format_3750" # YAML
versions:
- "versions.yml":
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: "http://edamontology.org/format_3750" # YAML

authors:
- "@dwells-eit"
maintainers:
- "@dwells-eit"
73 changes: 73 additions & 0 deletions modules/nf-core/autocycler/cluster/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "autocycler"
tag "autocycler/compress"
tag "autocycler/cluster"

test("sarscov2 - assembly - fasta") {

setup {
run("AUTOCYCLER_COMPRESS") {
script "../../compress/main.nf"
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/scaffolds.fasta', checkIfExists: true),
] // assemblies
]
"""
}
}
}

when {
process {
"""
input[0] = AUTOCYCLER_COMPRESS.out.gfa
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

test("sarscov2 - assembly - fasta - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}

}
Loading
Loading