Skip to content

Commit

Permalink
Merge pull request #338 from genomic-medicine-sweden/update-prp-to-ve…
Browse files Browse the repository at this point in the history
…rsion-010

Updated JASEN to support PRP v0.10.0
  • Loading branch information
ryanjameskennedy authored Aug 29, 2024
2 parents dcfcde4 + 0d15356 commit f4b02b7
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 14 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@ 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 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]

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions configs/nextflow.base.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions configs/nextflow.ci.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion configs/nextflow.dev.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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'"
}
Expand Down
9 changes: 7 additions & 2 deletions configs/nextflow.hopper.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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'"
}
Expand Down
5 changes: 5 additions & 0 deletions configs/nextflow.ngp.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions container/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
31 changes: 28 additions & 3 deletions nextflow-modules/modules/prp/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}" : ""
Expand All @@ -42,7 +42,7 @@ process create_analysis_result {
${bamArgs} \\
${brackenArgs} \\
${cgmlstArgs} \\
${dellyVcfArgs} \\
${vcfArgs} \\
${mlstArgs} \\
${mykrobeArgs} \\
${postalignqcArgs} \\
Expand Down Expand Up @@ -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
"""
}
11 changes: 8 additions & 3 deletions workflows/mycobacterium_tuberculosis.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ 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'
include { kraken } from '../nextflow-modules/modules/kraken/main.nf'
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'

Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit f4b02b7

Please sign in to comment.