diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fc13e42..41e4e8b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,14 +10,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added `cdmDir` to config +- Added process for adding IGV annotation tracks with PRP. +- Updated how `mycobacterium_tuberculosis` workflow adds IGV annotation tracks. ### Fixed - Fixed `--qc` argument filepath to be full filepath to output +- Fixed tbprofiler url in container Makefile +- Fixed TB installation steps in main Makefile ### Changed - Updated TbProfiler to version 6.3 +- Updated PRP to version 0.10.0 +- Removed delly annotation +- Updated vcf args in prp module ## [0.8.0] diff --git a/Makefile b/Makefile index 0043ffc0..343d8f4a 100644 --- a/Makefile +++ b/Makefile @@ -602,11 +602,11 @@ $(KPNEU_CGMLST_DIR)/alleles_rereffed: | $(KPNEU_CGMLST_DIR)/alleles/unpacking.do # M. tuberculosis # ----------------------------- MTUBE_GENOMES_DIR := $(ASSETS_DIR)/genomes/mycobacterium_tuberculosis -# MTUBE_TBDB_DIR := $(ASSETS_DIR)/tbdb -# MTUBE_TBPROFILER_DBS_DIR := $(ASSETS_DIR)/tbprofiler_dbs +MTUBE_TBDB_DIR := $(ASSETS_DIR)/tbdb +MTUBE_TBPROFILER_DBS_DIR := $(ASSETS_DIR)/tbprofiler_dbs MTUBE_REFSEQ_ACC := GCF_000195955.2 -mtuberculosis_all: mtuberculosis_download_reference mtuberculosis_faidx_reference mtuberculosis_bwaidx_reference #mtuberculosis_converged_who_fohm_tbdb mtuberculosis_bgzip_bed mtuberculosis_index_bed +mtuberculosis_all: mtuberculosis_download_reference mtuberculosis_faidx_reference mtuberculosis_bwaidx_reference mtuberculosis_converged_who_fohm_tbdb mtuberculosis_bgzip_bed mtuberculosis_index_bed mtuberculosis_download_reference: $(MTUBE_GENOMES_DIR)/$(MTUBE_REFSEQ_ACC).fasta diff --git a/configs/nextflow.base.config b/configs/nextflow.base.config index 4eee3c85..e2cbb770 100644 --- a/configs/nextflow.base.config +++ b/configs/nextflow.base.config @@ -77,6 +77,7 @@ profiles { mycobacterium_tuberculosis { params.species = 'mycobacterium tuberculosis' params.speciesDir = 'mtuberculosis' + params.resistantLociName = 'resistance_loci' params.referenceGenome = "${params.root}/assets/genomes/mycobacterium_tuberculosis/GCF_000195955.2.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/mycobacterium_tuberculosis/GCF_000195955.2.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/mycobacterium_tuberculosis/GCF_000195955.2.gff" @@ -106,6 +107,10 @@ process { memory='1 GB' cpus=2 + withName: add_igv_track { + container = "${params.containerDir}/bonsai-prp.sif" + publishDir = [ path: "${params.outdir}/${params.speciesDir}/analysis_result", mode: 'copy', overwrite: true ] + } withName: amrfinderplus { container = "${params.containerDir}/ncbi-amrfinderplus.sif" cpus = 4 diff --git a/configs/nextflow.ci.config b/configs/nextflow.ci.config index 37452336..1c416a29 100644 --- a/configs/nextflow.ci.config +++ b/configs/nextflow.ci.config @@ -81,6 +81,7 @@ profiles { mycobacterium_tuberculosis { params.species = 'mycobacterium tuberculosis' params.speciesDir = 'mtuberculosis' + params.resistantLociName = 'resistance_loci' params.referenceGenome = "${params.root}/assets/genomes/mycobacterium_tuberculosis/GCF_000195955.2.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/mycobacterium_tuberculosis/GCF_000195955.2.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/mycobacterium_tuberculosis/GCF_000195955.2.gff" @@ -95,6 +96,10 @@ process { memory='1 GB' cpus=2 + withName: add_igv_track { + container = "${params.containerDir}/bonsai-prp.sif" + publishDir = [ path: "${params.outdir}/${params.speciesDir}/analysis_result", mode: 'copy', overwrite: true ] + } withName: amrfinderplus { container = "${params.containerDir}/ncbi-amrfinderplus.sif" cpus = 4 diff --git a/configs/nextflow.dev.config b/configs/nextflow.dev.config index d4989737..1b2ef0fb 100644 --- a/configs/nextflow.dev.config +++ b/configs/nextflow.dev.config @@ -94,6 +94,7 @@ profiles { params.species = 'mycobacterium tuberculosis' params.speciesDir = 'mtuberculosis' params.symlinkDir = "/access/jasen/mtuberculosis/" + params.resistantLociName = 'resistance_loci' params.referenceGenome = "${params.root}/assets/genomes/mycobacterium_tuberculosis/GCF_000195955.2.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/mycobacterium_tuberculosis/GCF_000195955.2.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/mycobacterium_tuberculosis/GCF_000195955.2.gff" @@ -110,6 +111,10 @@ process { memory='1 GB' cpus=2 + withName: add_igv_track { + container = "${params.containerDir}/bonsai-prp.sif" + publishDir = [ path: "${params.outdir}/${params.speciesDir}/analysis_result", mode: 'copy', overwrite: true ] + } withName: amrfinderplus { container = "https://depot.galaxyproject.org/singularity/ncbi-amrfinderplus:3.11.11--h6e70893_0" cpus = 4 @@ -276,7 +281,7 @@ process { withName: tbprofiler_mergedb { cpus = 16 memory = '12 GB' - container = "https://depot.galaxyproject.org/singularity/tb-profiler%3A6.3.0--pyhdfd78af_0" + container = "https://depot.galaxyproject.org/singularity/tb-profiler:6.3.0--pyhdfd78af_0" publishDir = [ [ path: "${params.outdir}/${params.speciesDir}/tbprofiler_mergedb", mode: 'copy', overwrite: true, pattern: '*.json' ], [ path: "${params.outdir}/${params.speciesDir}/${params.vcfDir}", mode: 'copy', overwrite: true, pattern: '*.{vcf.gz}' ], [ path: "${params.outdir}/${params.speciesDir}/${params.bamDir}", mode: 'copy', overwrite: true, pattern: '*.bam*' ] ] ext.args = "--external_db ${params.root}/assets/tbdb/converged_who_fohm_tbdb --calling_params '-q 15'" } diff --git a/configs/nextflow.hopper.config b/configs/nextflow.hopper.config index d7d45598..355685bb 100644 --- a/configs/nextflow.hopper.config +++ b/configs/nextflow.hopper.config @@ -92,6 +92,7 @@ profiles { mycobacterium_tuberculosis { params.species = 'mycobacterium tuberculosis' params.speciesDir = 'mtuberculosis' + params.resistantLociName = 'resistance_loci' params.symlinkDir = "/access/jasen/mtuberculosis/ params.referenceGenome = "${params.root}/assets/genomes/mycobacterium_tuberculosis/GCF_000195955.2.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/mycobacterium_tuberculosis/GCF_000195955.2.fasta.fai" @@ -109,6 +110,10 @@ process { memory='1 GB' cpus=2 + withName: add_igv_track { + container = "${params.containerDir}/bonsai-prp.sif" + publishDir = [ path: "${params.outdir}/${params.speciesDir}/analysis_result", mode: 'copy', overwrite: true ] + } withName: amrfinderplus { container = "https://depot.galaxyproject.org/singularity/ncbi-amrfinderplus:3.11.11--h6e70893_0" cpus = 4 @@ -117,7 +122,7 @@ process { ext.args = "--plus" } withName: annotate_delly { - container = "docker://clinicalgenomicslund/bonsai-prp:0.9.3" + container = "${params.containerDir}/bonsai-prp.sif" publishDir = [ path: "${params.outdir}/${params.speciesDir}/${params.vcfDir}", mode: 'copy', overwrite: true ] } withName: assembly_trim_clean { @@ -291,7 +296,7 @@ process { withName: tbprofiler_mergedb { cpus = 16 memory = '12 GB' - container = "https://depot.galaxyproject.org/singularity/tb-profiler%3A6.3.0--pyhdfd78af_0" + container = "https://depot.galaxyproject.org/singularity/tb-profiler:6.3.0--pyhdfd78af_0" publishDir = [ [ path: "${params.outdir}/${params.speciesDir}/tbprofiler_mergedb", mode: 'copy', overwrite: true, pattern: '*.json' ], [ path: "${params.outdir}/${params.speciesDir}/${params.vcfDir}", mode: 'copy', overwrite: true, pattern: '*.{vcf.gz}' ], [ path: "${params.outdir}/${params.speciesDir}/${params.bamDir}", mode: 'copy', overwrite: true, pattern: '*.bam*' ] ] ext.args = "--external_db ${params.root}/assets/tbdb/converged_who_fohm_tbdb --calling_params '-q 15'" } diff --git a/configs/nextflow.ngp.config b/configs/nextflow.ngp.config index c60bc074..0434d6a3 100644 --- a/configs/nextflow.ngp.config +++ b/configs/nextflow.ngp.config @@ -103,6 +103,7 @@ profiles { mycobacterium_tuberculosis { params.species = 'mycobacterium tuberculosis' params.speciesDir = 'mtuberculosis' + params.resistantLociName = 'resistance_loci' params.referenceGenome = "${params.root}/assets/genomes/mycobacterium_tuberculosis/GCF_000195955.2.fasta" params.referenceGenomeIdx = "${params.root}/assets/genomes/mycobacterium_tuberculosis/GCF_000195955.2.fasta.fai" params.referenceGenomeGff = "${params.root}/assets/genomes/mycobacterium_tuberculosis/GCF_000195955.2.gff" @@ -119,6 +120,10 @@ process { memory='1 GB' cpus=params.cpus_small + withName: add_igv_track { + container = "${params.containerDir}/bonsai-prp.sif" + publishDir = [ path: "${params.outdir}/${params.speciesDir}/analysis_result", mode: 'copy', overwrite: true ] + } withName: amrfinderplus { container = "${params.containerDir}/ncbi-amrfinderplus.sif" cpus = params.cpus_medium diff --git a/container/Makefile b/container/Makefile index e5073428..904c0ac2 100644 --- a/container/Makefile +++ b/container/Makefile @@ -42,7 +42,7 @@ remote_containers := ncbi-amrfinderplus.sif \ virulencefinder.sif # URLs to Docker containers -DOCKER_bonsai-prp := docker://clinicalgenomicslund/bonsai-prp:0.9.3 +DOCKER_bonsai-prp := docker://clinicalgenomicslund/bonsai-prp:0.10.0 # URLs to remote containers URL_ncbi-amrfinderplus := https://depot.galaxyproject.org/singularity/ncbi-amrfinderplus:3.11.11--h6e70893_0 @@ -66,7 +66,7 @@ URL_skesa := https://depot.galaxyproject.org/singularity/skesa:2.5.1--hdcf5f25_0 URL_snippy := https://depot.galaxyproject.org/singularity/snippy:4.6.0--hdfd78af_2 URL_sourmash := https://depot.galaxyproject.org/singularity/sourmash:4.8.2--hdfd78af_0 URL_spades := https://depot.galaxyproject.org/singularity/spades:3.15.5--h95f258a_1 -URL_tb-profiler := https://depot.galaxyproject.org/singularity/tb-profiler%3A6.3.0--pyhdfd78af_0 +URL_tb-profiler := https://depot.galaxyproject.org/singularity/tb-profiler:6.3.0--pyhdfd78af_0 URL_virulencefinder := https://depot.galaxyproject.org/singularity/virulencefinder:2.0.4--hdfd78af_1 define log_message diff --git a/nextflow-modules/modules/prp/main.nf b/nextflow-modules/modules/prp/main.nf index 94f79647..43c30ee3 100644 --- a/nextflow-modules/modules/prp/main.nf +++ b/nextflow-modules/modules/prp/main.nf @@ -3,7 +3,7 @@ process create_analysis_result { scratch params.scratch input: - tuple val(sampleID), path(quast), path(postalignqc), path(mlst), path(cgmlst), path(amr), path(resistance), path(resfinderMeta), path(serotype), path(serotypefinderMeta), path(virulence), path(virulencefinderMeta), path(shigapass), path(bam), path(bai), path(runInfo), path(dellyVcf), path(mykrobe), path(tbprofiler), path(bracken) + tuple val(sampleID), path(quast), path(postalignqc), path(mlst), path(cgmlst), path(amr), path(resistance), path(resfinderMeta), path(serotype), path(serotypefinderMeta), path(virulence), path(virulencefinderMeta), path(shigapass), path(bam), path(bai), path(runInfo), path(vcf), path(mykrobe), path(tbprofiler), path(bracken) path referenceGenome path referenceGenomeIdx path referenceGenomeGff @@ -18,7 +18,7 @@ process create_analysis_result { brackenArgs = bracken ? "--kraken ${bracken}" : "" bamArgs = bam ? "--bam ${params.outdir}/${params.speciesDir}/${params.bamDir}/${bam}" : "" cgmlstArgs = cgmlst ? "--cgmlst ${cgmlst}" : "" - dellyVcfArgs = dellyVcf ? "--sv-vcf ${params.outdir}/${params.speciesDir}/${params.vcfDir}/${dellyVcf}" : "" + vcfArgs = vcf ? "--vcf ${params.outdir}/${params.speciesDir}/${params.vcfDir}/${vcf}" : "" mlstArgs = mlst ? "--mlst ${mlst}" : "" mykrobeArgs = mykrobe ? "--mykrobe ${mykrobe}" : "" postalignqcArgs = postalignqc ? "--quality ${postalignqc}" : "" @@ -42,7 +42,7 @@ process create_analysis_result { ${bamArgs} \\ ${brackenArgs} \\ ${cgmlstArgs} \\ - ${dellyVcfArgs} \\ + ${vcfArgs} \\ ${mlstArgs} \\ ${mykrobeArgs} \\ ${postalignqcArgs} \\ @@ -159,3 +159,28 @@ process annotate_delly { touch $output """ } + +process add_igv_track { + tag "${sampleID}" + scratch params.scratch + + input: + tuple val(sampleID), path(bonsaiInput) + val annotation + val trackName + + output: + tuple val(sampleID), path(output), emit: json + + script: + output = "${sampleID}_result.json" + """ + prp add-igv-annotation-track --track-name ${trackName} --annotation-file ${annotation} --bonsai-input-file ${bonsaiInput} --output ${output} + """ + + stub: + output = "${sampleID}_result.json" + """ + touch $output + """ +} diff --git a/workflows/mycobacterium_tuberculosis.nf b/workflows/mycobacterium_tuberculosis.nf index 7fae5463..fbd5b0ef 100644 --- a/workflows/mycobacterium_tuberculosis.nf +++ b/workflows/mycobacterium_tuberculosis.nf @@ -7,6 +7,8 @@ include { annotate_delly } from '../nextflow-modules/modu include { bracken } from '../nextflow-modules/modules/bracken/main.nf' include { copy_to_cron } from '../nextflow-modules/modules/cron/main.nf' include { create_analysis_result } from '../nextflow-modules/modules/prp/main.nf' +include { add_igv_track as add_variant_igv_track} from '../nextflow-modules/modules/prp/main.nf' +include { add_igv_track as add_locus_igv_track } from '../nextflow-modules/modules/prp/main.nf' include { create_cdm_input } from '../nextflow-modules/modules/prp/main.nf' include { create_yaml } from '../nextflow-modules/modules/yaml/main.nf' include { export_to_cdm } from '../nextflow-modules/modules/cmd/main.nf' @@ -14,7 +16,6 @@ include { kraken } from '../nextflow-modules/modu include { mykrobe } from '../nextflow-modules/modules/mykrobe/main.nf' include { post_align_qc } from '../nextflow-modules/modules/prp/main.nf' include { snippy } from '../nextflow-modules/modules/snippy/main.nf' -include { tbprofiler as tbprofiler_tbdb } from '../nextflow-modules/modules/tbprofiler/main.nf' include { tbprofiler as tbprofiler_mergedb } from '../nextflow-modules/modules/tbprofiler/main.nf' include { CALL_BACTERIAL_BASE } from '../workflows/bacterial_base.nf' @@ -97,7 +98,11 @@ workflow CALL_MYCOBACTERIUM_TUBERCULOSIS { create_analysis_result(combinedOutput, referenceGenome, referenceGenomeIdx, referenceGenomeGff) } - create_yaml(create_analysis_result.out.json.join(ch_sourmash), params.speciesDir) + // Add IGV annotation tracks + add_locus_igv_track(create_analysis_result.out.json, params.tbdbBed, params.resistantLociName) + + // Create yaml for uploading results to Bonsai + create_yaml(add_locus_igv_track.out.json.join(ch_sourmash), params.speciesDir) ch_quast .join(ch_qc) @@ -117,7 +122,7 @@ workflow CALL_MYCOBACTERIUM_TUBERCULOSIS { ch_versions = ch_versions.mix(tbprofiler_mergedb.out.versions) emit: - pipeline_result = create_analysis_result.out.json + pipeline_result = add_locus_igv_track.out.json cdm = export_to_cdm.out.cdm cron_yaml = copy_to_cron.out.yaml cron_cdm = copy_to_cron.out.cdm