diff --git a/changelog.md b/changelog.md index 63eac4f2..e12d4be4 100644 --- a/changelog.md +++ b/changelog.md @@ -17,6 +17,8 @@ resolution ### New components - Added component `abyss`. +- Added component `bandage`. +- Added component `unicycler`. ### Minor/Other changes diff --git a/flowcraft/generator/components/assembly.py b/flowcraft/generator/components/assembly.py index e91dccec..c010eca7 100644 --- a/flowcraft/generator/components/assembly.py +++ b/flowcraft/generator/components/assembly.py @@ -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" + }} diff --git a/flowcraft/generator/engine.py b/flowcraft/generator/engine.py index 0eadba21..4f509d38 100644 --- a/flowcraft/generator/engine.py +++ b/flowcraft/generator/engine.py @@ -104,6 +104,7 @@ "split_assembly": meta.SplitAssembly, "trimmomatic": readsqc.Trimmomatic, "true_coverage": readsqc.TrueCoverage, + "unicycler": assembly.Unicycler, "viral_assembly": assembly.ViralAssembly, } diff --git a/flowcraft/generator/templates/unicycler.nf b/flowcraft/generator/templates/unicycler.nf new file mode 100644 index 00000000..89b31ef1 --- /dev/null +++ b/flowcraft/generator/templates/unicycler.nf @@ -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}}