From f6b07b1711a313f78e1b11d71175370bc0643872 Mon Sep 17 00:00:00 2001 From: Matt Parker Date: Thu, 9 Jun 2022 13:43:53 +0000 Subject: [PATCH] Restrict assembly to only reads from mpx --- CHANGELOG.md | 3 ++- main.nf | 9 +++++---- nextflow.config | 2 +- nextflow_schema.json | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19d8018..a764161 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [unreleased] +## [v0.0.2] ### Changed - Tidied up docs +- Restricting assembly to only reads that map to mpx ## [v0.0.1] diff --git a/main.nf b/main.nf index aa36b08..03eda6c 100644 --- a/main.nf +++ b/main.nf @@ -110,17 +110,18 @@ process flyeAssembly { label "wfmpx" cpus params.threads input: - tuple val(sample_id), val(type), path(sample_fastq), path(sample_stats) + tuple val(sample_id), val(type), path("${sample_id}.bam"), path("${sample_id}.bam.bai") path reference output: tuple val(sample_id), val(type), path("medaka/consensus.fasta"), path("${sample_id}_assembly_mapped.bam"), path("${sample_id}_assembly.bed") script: """ - flye --nano-raw ${sample_fastq} -g 197k -t ${params.threads} --meta -o flye + samtools bam2fq ${sample_id}.bam > ${sample_id}_restricted.fastq + flye --nano-raw ${sample_id}_restricted.fastq -g 197k -t ${params.threads} --meta -o flye # polish assembly with medaka - medaka_consensus -i ${sample_fastq} -t ${params.threads} -d flye/assembly.fasta ${params.medaka_options} + medaka_consensus -i ${sample_id}_restricted.fastq -t ${params.threads} -d flye/assembly.fasta ${params.medaka_options} minimap2 -ax map-ont ${reference} medaka/consensus.fasta | samtools view -bh - | samtools sort - > ${sample_id}_assembly_mapped.bam @@ -221,7 +222,7 @@ workflow pipeline { workflow_params = getParams() if (params.assembly == true) { - assembly = flyeAssembly(summary.sample, reference) + assembly = flyeAssembly(alignment.alignment, reference) } diff --git a/nextflow.config b/nextflow.config index 3c20614..3ca81c5 100644 --- a/nextflow.config +++ b/nextflow.config @@ -17,7 +17,7 @@ params { sample = null sample_sheet = null sanitize_fastq = false - wfversion = "v0.0.1" + wfversion = "v0.0.2" threads = 4 assembly = true medaka_options = null diff --git a/nextflow_schema.json b/nextflow_schema.json index a0a045a..6fa230c 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -127,7 +127,7 @@ }, "wfversion": { "type": "string", - "default": "v0.0.1", + "default": "v0.0.2", "hidden": true }, "monochrome_logs": {