Skip to content

Commit 4c63ced

Browse files
authored
Merge pull request #156 from sjackman/unicycler
Add unicycler
2 parents 4d494f5 + e210082 commit 4c63ced

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ resolution
1717
### New components
1818

1919
- Added component `abyss`.
20+
- Added component `bandage`.
21+
- Added component `unicycler`.
2022

2123
### Minor/Other changes
2224

flowcraft/generator/components/assembly.py

+26
Original file line numberDiff line numberDiff line change
@@ -216,3 +216,29 @@ def __init__(self, **kwargs):
216216
"version": "2.1.1",
217217
"scratch": "true"
218218
}}
219+
220+
class Unicycler(Process):
221+
"""Unicycler process template interface
222+
223+
This process is set with:
224+
225+
- ``input_type``: fastq
226+
- ``output_type``: assembly
227+
- ``ptype``: assembly
228+
229+
"""
230+
231+
def __init__(self, **kwargs):
232+
233+
super().__init__(**kwargs)
234+
235+
self.input_type = "fastq"
236+
self.output_type = "fasta"
237+
self.link_start.append("gfa1")
238+
239+
self.directives = {"unicycler": {
240+
"cpus": 4,
241+
"container": "quay.io/biocontainers/unicycler",
242+
"version": "0.4.7--py36hdbcaa40_0",
243+
"scratch": "true"
244+
}}

flowcraft/generator/engine.py

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
"split_assembly": meta.SplitAssembly,
105105
"trimmomatic": readsqc.Trimmomatic,
106106
"true_coverage": readsqc.TrueCoverage,
107+
"unicycler": assembly.Unicycler,
107108
"viral_assembly": assembly.ViralAssembly,
108109
}
109110

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
process unicycler_{{pid}} {
2+
{% include "post.txt" ignore missing %}
3+
4+
tag { sample_id }
5+
publishDir 'results/assembly/unicycler_{{pid}}/', pattern: 'assembly.fasta'
6+
publishDir 'results/assembly/unicycler_{{pid}}/', pattern: 'assembly.gfa'
7+
8+
input:
9+
set sample_id, file(fastq_pair) from {{input_channel}}
10+
11+
output:
12+
set sample_id, file('assembly.fasta') into {{output_channel}}
13+
file "assembly.gfa" into gfa1_{{pid}}
14+
{% with task_name="unicycler" %}
15+
{%- include "compiler_channels.txt" ignore missing -%}
16+
{% endwith %}
17+
18+
script:
19+
"unicycler -t $task.cpus -o . --no_correct --no_pilon -1 ${fastq_pair[0]} -2 ${fastq_pair[1]}"
20+
}
21+
22+
{{forks}}

0 commit comments

Comments
 (0)