Skip to content
Merged
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
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ resolution
### New components

- Added component `abyss`.
- Added component `bandage`.
- Added component `unicycler`.

### Minor/Other changes

Expand Down
26 changes: 26 additions & 0 deletions flowcraft/generator/components/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,29 @@ def __init__(self, **kwargs):
"version": "2.1.1",
"scratch": "true"
}}

class Unicycler(Process):
"""Unicycler process template interface

This process is set with:

- ``input_type``: fastq
- ``output_type``: assembly
- ``ptype``: assembly

"""

def __init__(self, **kwargs):

super().__init__(**kwargs)

self.input_type = "fastq"
self.output_type = "fasta"
self.link_start.append("gfa1")

self.directives = {"unicycler": {
"cpus": 4,
"container": "quay.io/biocontainers/unicycler",
"version": "0.4.7--py36hdbcaa40_0",
"scratch": "true"
}}
1 change: 1 addition & 0 deletions flowcraft/generator/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"split_assembly": meta.SplitAssembly,
"trimmomatic": readsqc.Trimmomatic,
"true_coverage": readsqc.TrueCoverage,
"unicycler": assembly.Unicycler,
"viral_assembly": assembly.ViralAssembly,
}

Expand Down
22 changes: 22 additions & 0 deletions flowcraft/generator/templates/unicycler.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
process unicycler_{{pid}} {
{% include "post.txt" ignore missing %}

tag { sample_id }
publishDir 'results/assembly/unicycler_{{pid}}/', pattern: 'assembly.fasta'
publishDir 'results/assembly/unicycler_{{pid}}/', pattern: 'assembly.gfa'

input:
set sample_id, file(fastq_pair) from {{input_channel}}

output:
set sample_id, file('assembly.fasta') into {{output_channel}}
file "assembly.gfa" into gfa1_{{pid}}
{% with task_name="unicycler" %}
{%- include "compiler_channels.txt" ignore missing -%}
{% endwith %}

script:
"unicycler -t $task.cpus -o . --no_correct --no_pilon -1 ${fastq_pair[0]} -2 ${fastq_pair[1]}"
}

{{forks}}