Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

299 add qc for nanopore data #344

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added ska filepath to yaml
- Added optional read downsampling using seqtk
- Added `tbGradingRulesBed` to IGV track
- Added module NanoPlot to check quality of raw reads from ONT

### Fixed

Expand Down Expand Up @@ -51,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added `samplelist_nanopore.csv` for running long-read test data
- Added location of documentation to `README`
- Added `cdmDir` to config
- Added NanoPlot module
- Added process for adding IGV annotation tracks with PRP.
- Updated how `mycobacterium_tuberculosis` workflow adds IGV annotation tracks.

Expand Down
5 changes: 5 additions & 0 deletions configs/nextflow.base.config
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ process {
publishDir = [ path: "${params.outdir}/${params.speciesDir}/mykrobe", mode: 'copy', overwrite: true ]
ext.args = "--species tb --format csv"
}
withName: nanoplot {
ryanjameskennedy marked this conversation as resolved.
Show resolved Hide resolved
container = "${params.containerDir}/nanoplot.sif"
publishDir = [ path: "${params.outdir}/${params.speciesDir}/nanoplot", mode: 'copy', overwrite: true ]
ext.args = "-t 8"
}
withName: post_align_qc {
memory = '2 GB'
container = "${params.containerDir}/bonsai-prp.sif"
Expand Down
5 changes: 5 additions & 0 deletions configs/nextflow.ci.config
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ process {
publishDir = [ path: "${params.outdir}/${params.speciesDir}/mykrobe", mode: 'copy', overwrite: true ]
ext.args = "--species tb --format csv"
}
withName: nanoplot {
container = "${params.containerDir}/nanoplot.sif"
publishDir = [ path: "${params.outdir}/${params.speciesDir}/nanoplot", mode: 'copy', overwrite: true ]
ext.args = "-t 8"
}
withName: post_align_qc {
memory = '2 GB'
container = "${params.containerDir}/bonsai-prp.sif"
Expand Down
5 changes: 5 additions & 0 deletions configs/nextflow.dev.config
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ process {
publishDir = [ path: "${params.outdir}/${params.speciesDir}/mykrobe", mode: 'copy', overwrite: true ]
ext.args = "--species tb --format csv"
}
withName: nanoplot {
container = "https://depot.galaxyproject.org/singularity/nanoplot:1.43.0--pyhdfd78af_1"
publishDir = [ path: "${params.outdir}/${params.speciesDir}/nanoplot", mode: 'copy', overwrite: true ]
ext.args = "-t 8"
}
withName: post_align_qc {
memory = '2 GB'
container = "${params.containerDir}/bonsai-prp.sif"
Expand Down
5 changes: 5 additions & 0 deletions configs/nextflow.hopper.config
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ process {
publishDir = [ path: "${params.outdir}/${params.speciesDir}/mykrobe", mode: 'copy', overwrite: true ]
ext.args = "--species tb --format csv"
}
withName: nanoplot {
container = "https://depot.galaxyproject.org/singularity/nanoplot:1.43.0--pyhdfd78af_1"
publishDir = [ path: "${params.outdir}/${params.speciesDir}/nanoplot", mode: 'copy', overwrite: true ]
ext.args = "-t 8"
}
withName: post_align_qc {
memory = '2 GB'
container = "docker://clinicalgenomicslund/bonsai-prp:0.11.1"
Expand Down
5 changes: 5 additions & 0 deletions configs/nextflow.ngp.config
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ process {
publishDir = [ path: "${params.outdir}/${params.speciesDir}/mykrobe", mode: 'copy', overwrite: true ]
ext.args = "--species tb --format csv"
}
withName: nanoplot {
container = "${params.containerDir}/nanoplot.sif"
publishDir = [ path: "${params.outdir}/${params.speciesDir}/nanoplot", mode: 'copy', overwrite: true ]
ext.args = "-t 8"
}
withName: post_align_qc {
cpus = params.cpus_medium
memory = params.mem_small
Expand Down
2 changes: 2 additions & 0 deletions container/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ remote_containers := ncbi-amrfinderplus.sif \
freebayes.sif \
kraken2.sif \
medaka.sif \
nanoplot.sif \
mlst.sif \
mykrobe.sif \
perl-json.sif \
Expand Down Expand Up @@ -60,6 +61,7 @@ URL_kraken2 := https://depot.galaxyproject.org/singularity/kraken2:2.1.2--pl5321
URL_medaka := https://depot.galaxyproject.org/singularity/medaka:1.11.3--py39h05d5c5e_0
URL_mlst := https://depot.galaxyproject.org/singularity/mlst:2.23.0--hdfd78af_1
URL_mykrobe := https://depot.galaxyproject.org/singularity/mykrobe:0.12.2--py39h70e0db4_0
URL_nanoplot := https://depot.galaxyproject.org/singularity/nanoplot:1.43.0--pyhdfd78af_1
URL_perl-json := https://depot.galaxyproject.org/singularity/perl-json:4.10--pl5321hdfd78af_0
URL_quast := https://depot.galaxyproject.org/singularity/quast:5.2.0--py310pl5321hc8f18ef_2
URL_resfinder := https://depot.galaxyproject.org/singularity/resfinder:4.4.2--pyhdfd78af_1
Expand Down
41 changes: 41 additions & 0 deletions nextflow-modules/modules/nanoplot/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
process nanoplot {
tag "${sampleID}"
scratch params.scratch

input:
tuple val(sampleID), path(reads), val(platform)

output:
tuple val(sampleID), path(output), emit: html
path "*versions.yml" , emit: versions

when:
platform == "nanopore"

script:
def args = task.ext.args ?: ''
output = "${sampleID}_NanoPlot-report.html"
"""
NanoPlot $args --prefix ${sampleID}_ --fastq $reads

cat <<-END_VERSIONS > ${sampleID}_${task.process}_versions.yml
${task.process}:
nanoplot:
version: \$(echo \$(NanoPlot --version 2>&1))
container: ${task.container}
END_VERSIONS
"""

stub:
output = "${sampleID}_NanoPlot-report.html"
"""
touch $output

cat <<-END_VERSIONS > ${sampleID}_${task.process}_versions.yml
${task.process}:
nanoplot:
version: \$(echo \$(NanoPlot --version 2>&1))
container: ${task.container}
END_VERSIONS
"""
}
5 changes: 5 additions & 0 deletions workflows/bacterial_base.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ include { assembly_trim_clean } from '../nextflow-modules/modu
include { bwa_mem as bwa_mem_ref } from '../nextflow-modules/modules/bwa/main.nf'
include { flye } from '../nextflow-modules/modules/flye/main.nf'
include { medaka } from '../nextflow-modules/modules/medaka/main.nf'
include { nanoplot } from '../nextflow-modules/modules/nanoplot/main.nf'
include { post_align_qc } from '../nextflow-modules/modules/prp/main.nf'
include { quast } from '../nextflow-modules/modules/quast/main.nf'
include { samtools_index as samtools_index_ref } from '../nextflow-modules/modules/samtools/main.nf'
Expand Down Expand Up @@ -90,13 +91,16 @@ workflow CALL_BACTERIAL_BASE {

post_align_qc(bwa_mem_ref.out.bam, referenceGenome, coreLociBed)

nanoplot(ch_reads_w_meta)

sourmash(ch_assembly)

ska_build(ch_reads)

ch_versions = ch_versions.mix(bwa_mem_ref.out.versions)
ch_versions = ch_versions.mix(flye.out.versions)
ch_versions = ch_versions.mix(medaka.out.versions)
ch_versions = ch_versions.mix(nanoplot.out.versions)
ch_versions = ch_versions.mix(quast.out.versions)
ch_versions = ch_versions.mix(samtools_index_ref.out.versions)
ch_versions = ch_versions.mix(skesa.out.versions)
Expand All @@ -112,6 +116,7 @@ workflow CALL_BACTERIAL_BASE {
bai = samtools_index_ref.out.bai // channel: [ val(meta), path(bai)]
metadata = save_analysis_metadata.out.meta // channel: [ val(meta), path(json)]
qc = post_align_qc.out.qc // channel: [ val(meta), path(fasta)]
qc_nano = nanoplot.out.html // channel: [ val(meta), path(html)]
quast = quast.out.qc // channel: [ val(meta), path(qc)]
reads = ch_reads // channel: [ val(meta), path(json)]
ska_build = ska_build.out.skf // channel: [ val(meta), path(skf)]
Expand Down
Loading