From cfb6edb9840789db27dad7f436c6bfad25dd2ce8 Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Mon, 26 Jun 2023 16:16:44 +0200 Subject: [PATCH 1/5] add chromograph [skip ci] --- conf/modules/annotate_snvs.config | 26 ++++++++++- modules.json | 5 +++ modules/nf-core/chromograph/main.nf | 65 ++++++++++++++++++++++++++++ modules/nf-core/chromograph/meta.yml | 63 +++++++++++++++++++++++++++ subworkflows/local/annotate_snvs.nf | 9 +++- 5 files changed, 165 insertions(+), 3 deletions(-) create mode 100644 modules/nf-core/chromograph/main.nf create mode 100644 modules/nf-core/chromograph/meta.yml diff --git a/conf/modules/annotate_snvs.config b/conf/modules/annotate_snvs.config index 80c8fd6f..093e94a1 100644 --- a/conf/modules/annotate_snvs.config +++ b/conf/modules/annotate_snvs.config @@ -48,7 +48,31 @@ process { withName: '.*ANNOTATE_SNVS:UPD_REGIONS' { ext.prefix = { "${meta.id}_rohann_vcfanno_upd_regions" } - ext.args = {"--af-tag GNOMADAF --proband ${meta.upd_child} --mother ${meta.mother} --father ${meta.father} regions"} + ext.args = {"--af-tag GNOMADAF --proband ${meta.upd_child} --mother ${meta.mother} --father ${meta.father} regions --min-size 5 --min-sites 1"} + ext.when = { !(workflow.profile.tokenize(',').intersect(['test', 'test_one_sample']).size() >= 1) || workflow.stubRun } + } + + withName: '.*ANNOTATE_SNVS:CHROMOGRAPH_SITES' { + ext.prefix = { "${meta7.id}_rohann_vcfanno_upd_sites_chromograph" } + ext.args = { "--euploid" } + tag = {"${meta7.id}"} + publishDir = [ + path: { "${params.outdir}/annotate_snv" }, + mode: params.publish_dir_mode, + saveAs: { filename -> filename.equals('versions.yml') ? null : filename } + ] + } + + withName: '.*ANNOTATE_SNVS:CHROMOGRAPH_REGIONS' { + ext.prefix = { "${meta6.id}_rohann_vcfanno_upd_regions_chromograph" } + ext.args = { '--euploid' } + ext.when = { !(workflow.profile.tokenize(',').intersect(['test', 'test_one_sample']).size() >= 1) || workflow.stubRun } + tag = {"${meta6.id}"} + publishDir = [ + path: { "${params.outdir}/annotate_snv" }, + mode: params.publish_dir_mode, + saveAs: { filename -> filename.equals('versions.yml') ? null : filename } + ] } withName: '.*ANNOTATE_SNVS:BCFTOOLS_VIEW' { diff --git a/modules.json b/modules.json index 523143c5..654c81af 100644 --- a/modules.json +++ b/modules.json @@ -70,6 +70,11 @@ "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", "installed_by": ["modules"] }, + "chromograph": { + "branch": "master", + "git_sha": "2513c3ee7bbab3c283050068f3118dfed2bbbd12", + "installed_by": ["modules"] + }, "custom/dumpsoftwareversions": { "branch": "master", "git_sha": "911696ea0b62df80e900ef244d7867d177971f73", diff --git a/modules/nf-core/chromograph/main.nf b/modules/nf-core/chromograph/main.nf new file mode 100644 index 00000000..b15d40c7 --- /dev/null +++ b/modules/nf-core/chromograph/main.nf @@ -0,0 +1,65 @@ +process CHROMOGRAPH { + tag "$meta.id" + label 'process_single' + + conda "bioconda::chromograph=1.3.1" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/chromograph:1.3.1--pyhdfd78af_1': + 'biocontainers/chromograph:1.3.1--pyhdfd78af_1' }" + + input: + tuple val(meta), path(autozyg) + tuple val(meta), path(coverage) + tuple val(meta), path(exome) + tuple val(meta), path(fracsnp) + tuple val(meta), path(ideogram) + tuple val(meta), path(regions) + tuple val(meta), path(sites) + + output: + tuple val(meta), path("${prefix}"), emit: plots + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + def autozyg_param = autozyg ? "--autozyg ${autozyg}" : '' + def coverage_param = coverage ? "--coverage ${coverage}" : '' + def exome_param = exome ? "--exom ${exome}" : '' + def fracsnp_param = fracsnp ? "--fracsnp ${fracsnp}" : '' + def ideogram_param = ideogram ? "--ideogram ${ideogram}" : '' + def regions_param = regions ? "--regions ${regions}" : '' + def sites_param = sites ? "--sites ${sites}" : '' + """ + chromograph \\ + $args \\ + $autozyg_param \\ + $coverage_param \\ + $exome_param \\ + $fracsnp_param \\ + $ideogram_param \\ + $regions_param \\ + $sites_param \\ + --outd ${prefix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + chromograph: \$(echo \$(chromograph --version 2>&1) | sed 's/chromograph //' ) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + prefix = task.ext.prefix ?: "${meta.id}" + """ + mkdir ${prefix} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + chromograph: \$(echo \$(chromograph --version 2>&1) | sed 's/chromograph //' ) + END_VERSIONS + """ +} diff --git a/modules/nf-core/chromograph/meta.yml b/modules/nf-core/chromograph/meta.yml new file mode 100644 index 00000000..3890d0d5 --- /dev/null +++ b/modules/nf-core/chromograph/meta.yml @@ -0,0 +1,63 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json +name: "chromograph" +description: Chromograph is a python package to create PNG images from genetics data such as BED and WIG files. +keywords: + - chromosome_visualization + - bed + - wig + - png +tools: + - "chromograph": + description: "Chromograph is a python package to create PNG images from genetics data such as BED and WIG files." + homepage: "https://github.com/Clinical-Genomics/chromograph" + documentation: "https://github.com/Clinical-Genomics/chromograph/blob/master/README.md" + licence: "['MIT']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - autozyg: + type: file + description: Bed file containing the regions of autozygosity + - coverage: + type: file + description: Wig file containing the coverage information + - exome: + type: file + description: Bed file containing the coverage for exome. + - fracsnp: + type: file + description: Wig file containing the fraction of homozygous SNPs + - ideogram: + type: file + description: | + Bed file containing information necessary for ideogram plots. + Format ['chrom', 'start', 'end', 'name', 'gStain'] + - regions: + type: file + description: Bed file containing UPD regions + - sites: + type: file + description: Bed file containing UPD sites + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - plots: + type: file + description: Directory containing the plots in png format + pattern: "*.png" + +authors: + - "@ramprasadn" diff --git a/subworkflows/local/annotate_snvs.nf b/subworkflows/local/annotate_snvs.nf index 8e61a46e..bd5fdfb8 100644 --- a/subworkflows/local/annotate_snvs.nf +++ b/subworkflows/local/annotate_snvs.nf @@ -9,6 +9,8 @@ include { BCFTOOLS_VIEW } from '../../modules/nf-core/bc include { RHOCALL_ANNOTATE } from '../../modules/nf-core/rhocall/annotate/main' include { UPD as UPD_SITES } from '../../modules/nf-core/upd/main' include { UPD as UPD_REGIONS } from '../../modules/nf-core/upd/main' +include { CHROMOGRAPH as CHROMOGRAPH_SITES } from '../../modules/nf-core/chromograph/main' +include { CHROMOGRAPH as CHROMOGRAPH_REGIONS } from '../../modules/nf-core/chromograph/main' include { ENSEMBLVEP as ENSEMBLVEP_SNV } from '../../modules/local/ensemblvep/main' include { TABIX_BGZIPTABIX as ZIP_TABIX_ROHCALL } from '../../modules/nf-core/tabix/bgziptabix/main' include { TABIX_BGZIPTABIX as ZIP_TABIX_VCFANNO } from '../../modules/nf-core/tabix/bgziptabix/main' @@ -66,10 +68,11 @@ workflow ANNOTATE_SNVS { .flatten() .buffer (size: 2) .set { ch_upd_in } - - UPD_SITES(ch_upd_in) + UPD_SITES(ch_upd_in) UPD_REGIONS(ch_upd_in) + CHROMOGRAPH_SITES([[],[]], [[],[]], [[],[]], [[],[]], [[],[]], [[],[]], UPD_SITES.out.bed) + CHROMOGRAPH_REGIONS([[],[]], [[],[]], [[],[]], [[],[]], [[],[]], UPD_REGIONS.out.bed, [[],[]]) ZIP_TABIX_VCFANNO (VCFANNO.out.vcf) @@ -150,6 +153,8 @@ workflow ANNOTATE_SNVS { ch_versions = ch_versions.mix(VCFANNO.out.versions) ch_versions = ch_versions.mix(UPD_SITES.out.versions) ch_versions = ch_versions.mix(UPD_REGIONS.out.versions) + ch_versions = ch_versions.mix(CHROMOGRAPH_SITES.out.versions) + ch_versions = ch_versions.mix(CHROMOGRAPH_REGIONS.out.versions) ch_versions = ch_versions.mix(ZIP_TABIX_VCFANNO.out.versions) ch_versions = ch_versions.mix(BCFTOOLS_VIEW.out.versions) ch_versions = ch_versions.mix(TABIX_BCFTOOLS_VIEW.out.versions) From 3d8227a7264726a691d4bcc81fc11a2679cbaf60 Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Mon, 26 Jun 2023 18:27:36 +0200 Subject: [PATCH 2/5] update chromograph --- modules.json | 2 +- modules/nf-core/chromograph/main.nf | 62 +++++++++++++++++++++------- modules/nf-core/chromograph/meta.yml | 30 ++++++++++++++ 3 files changed, 77 insertions(+), 17 deletions(-) diff --git a/modules.json b/modules.json index 4871d930..f3bd866a 100644 --- a/modules.json +++ b/modules.json @@ -72,7 +72,7 @@ }, "chromograph": { "branch": "master", - "git_sha": "2513c3ee7bbab3c283050068f3118dfed2bbbd12", + "git_sha": "aad210ba51500be029740d088b4b4827f6f41509", "installed_by": ["modules"] }, "custom/dumpsoftwareversions": { diff --git a/modules/nf-core/chromograph/main.nf b/modules/nf-core/chromograph/main.nf index b15d40c7..9049dbfa 100644 --- a/modules/nf-core/chromograph/main.nf +++ b/modules/nf-core/chromograph/main.nf @@ -9,12 +9,12 @@ process CHROMOGRAPH { input: tuple val(meta), path(autozyg) - tuple val(meta), path(coverage) - tuple val(meta), path(exome) - tuple val(meta), path(fracsnp) - tuple val(meta), path(ideogram) - tuple val(meta), path(regions) - tuple val(meta), path(sites) + tuple val(meta2), path(coverage) + tuple val(meta3), path(exome) + tuple val(meta4), path(fracsnp) + tuple val(meta5), path(ideogram) + tuple val(meta6), path(regions) + tuple val(meta7), path(sites) output: tuple val(meta), path("${prefix}"), emit: plots @@ -25,14 +25,29 @@ process CHROMOGRAPH { script: def args = task.ext.args ?: '' - prefix = task.ext.prefix ?: "${meta.id}" - def autozyg_param = autozyg ? "--autozyg ${autozyg}" : '' - def coverage_param = coverage ? "--coverage ${coverage}" : '' - def exome_param = exome ? "--exom ${exome}" : '' - def fracsnp_param = fracsnp ? "--fracsnp ${fracsnp}" : '' - def ideogram_param = ideogram ? "--ideogram ${ideogram}" : '' - def regions_param = regions ? "--regions ${regions}" : '' - def sites_param = sites ? "--sites ${sites}" : '' + def autozyg_param = autozyg ? "--autozyg ${autozyg}" : '' + def coverage_param = coverage ? "--coverage ${coverage}" : '' + def exome_param = exome ? "--exom ${exome}" : '' + def fracsnp_param = fracsnp ? "--fracsnp ${fracsnp}" : '' + def ideogram_param = ideogram ? "--ideogram ${ideogram}" : '' + def regions_param = regions ? "--regions ${regions}" : '' + def sites_param = sites ? "--sites ${sites}" : '' + + if (autozyg) { + prefix = task.ext.prefix ?: "${meta.id}" + } else if (coverage) { + prefix = task.ext.prefix ?: "${meta2.id}" + } else if (exome) { + prefix = task.ext.prefix ?: "${meta3.id}" + } else if (fracsnp) { + prefix = task.ext.prefix ?: "${meta4.id}" + } else if (ideogram) { + prefix = task.ext.prefix ?: "${meta5.id}" + } else if (regions) { + prefix = task.ext.prefix ?: "${meta6.id}" + } else { + prefix = task.ext.prefix ?: "${meta7.id}" + } """ chromograph \\ $args \\ @@ -52,8 +67,23 @@ process CHROMOGRAPH { """ stub: - def args = task.ext.args ?: '' - prefix = task.ext.prefix ?: "${meta.id}" + def args = task.ext.args ?: '' + + if (autozyg) { + prefix = task.ext.prefix ?: "${meta.id}" + } else if (coverage) { + prefix = task.ext.prefix ?: "${meta2.id}" + } else if (exome) { + prefix = task.ext.prefix ?: "${meta3.id}" + } else if (fracsnp) { + prefix = task.ext.prefix ?: "${meta4.id}" + } else if (ideogram) { + prefix = task.ext.prefix ?: "${meta5.id}" + } else if (regions) { + prefix = task.ext.prefix ?: "${meta6.id}" + } else { + prefix = task.ext.prefix ?: "${meta7.id}" + } """ mkdir ${prefix} diff --git a/modules/nf-core/chromograph/meta.yml b/modules/nf-core/chromograph/meta.yml index 3890d0d5..cac5c7aa 100644 --- a/modules/nf-core/chromograph/meta.yml +++ b/modules/nf-core/chromograph/meta.yml @@ -20,6 +20,36 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] + - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - meta3: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - meta4: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - meta5: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - meta6: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - meta7: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] - autozyg: type: file description: Bed file containing the regions of autozygosity From 7483d7e2bfa5ff73f0a22143b6a0fae7485105d1 Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Mon, 26 Jun 2023 19:16:11 +0200 Subject: [PATCH 3/5] update readme and output --- README.md | 2 ++ docs/output.md | 24 ++++++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 841d5aa7..2feae6bb 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,8 @@ On release, automated continuous integration tests run the pipeline on a full-si - [vcfanno](https://github.com/brentp/vcfanno) - [CADD](https://cadd.gs.washington.edu/) - [VEP](https://www.ensembl.org/info/docs/tools/vep/index.html) +- [UPD](https://github.com/bjhall/upd) +- [chromograph](https://github.com/Clinical-Genomics/chromograph) **6. Annotation - SV:** diff --git a/docs/output.md b/docs/output.md index 04107dd0..856b0a79 100644 --- a/docs/output.md +++ b/docs/output.md @@ -42,6 +42,8 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d - [vcfanno](#vcfanno) - [CADD](#cadd) - [VEP](#vep) + - [UPD](#upd) + - [Chromograph](#chromograph) - [Annotation - SV](#annotation---sv) - [SVDB query](#svdb-query) - [VEP](#vep-1) @@ -331,6 +333,24 @@ Based on VEP annotations, custom scripts used by the pipeline further annotate e +#### UPD + +[UPD](https://github.com/bjhall/upd) calls regions of uniparental disomy from germline exome/wgs trios. Output from UPD is passed to chromograph for making plots. + +#### Chromograph + +[Chromograph](https://github.com/Clinical-Genomics/chromograph) is a python package to create PNG images from genetics data such as BED and WIG files. + +
+Output files + +- `annotate_snv/*sites_chromograph` + - `_rohann_vcfanno_upd_sites_.png`: file containing a plot showing upd sites across chromosomes. +- `annotate_snv/*regions_chromograph` + - `_rohann_vcfanno_upd_regions_.png`: file containing a plot showing upd regions across chromosomes. + +
+ ### Annotation - SV #### SVDB query @@ -407,10 +427,6 @@ We recommend using vcfanno to annotate SNVs with precomputed CADD scores (files -### Call UPD regions - -[UPD](https://github.com/bjhall/upd) calls regions of uniparental disomy from germline exome/wgs trios. Output from UPD is passed to chromograph for making plots. - ### Rank variants and filtering #### GENMOD From 8dc606b8431f6e03f6d022650f53241b402f324e Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Mon, 26 Jun 2023 19:31:23 +0200 Subject: [PATCH 4/5] update changelog --- CHANGELOG.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db28ce74..13232758 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Added` -- Add `public_aws_ecr` profile for using AWS ECR public gallery images -- GATK's ShiftFasta to generate all the files required for mitochondrial analysis -- Feature to calculate CADD scores for indels -- HmtNote to annotate mitochondria -- MT del script to detect mitochondrial deltions +- Add `public_aws_ecr` profile for using AWS ECR public gallery images [#360](https://github.com/nf-core/raredisease/pull/360) +- GATK's ShiftFasta to generate all the files required for mitochondrial analysis [#354](https://github.com/nf-core/raredisease/pull/354) +- Feature to calculate CADD scores for indels [#325](https://github.com/nf-core/raredisease/pull/325) +- HmtNote to annotate mitochondria [#355](https://github.com/nf-core/raredisease/pull/355) +- MT del script to detect mitochondrial deletions [#349](https://github.com/nf-core/raredisease/pull/349) +- eKLIPse to identify large mitochondrial deletions [#365](https://github.com/nf-core/raredisease/pull/365) +- UPD+Chromograph to identify and visualize UPD sites and regions in the chromosomes [#364](https://github.com/nf-core/raredisease/pull/364) and [#366](https://github.com/nf-core/raredisease/pull/366) ## v1.0.0 - [2023-06-01] From 34679117eb6befe68572aedca9bc4ef49fd8d92b Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Mon, 26 Jun 2023 19:33:17 +0200 Subject: [PATCH 5/5] update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2feae6bb..6a60f7a0 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ On release, automated continuous integration tests run the pipeline on a full-si - [CADD](https://cadd.gs.washington.edu/) - [VEP](https://www.ensembl.org/info/docs/tools/vep/index.html) - [UPD](https://github.com/bjhall/upd) -- [chromograph](https://github.com/Clinical-Genomics/chromograph) +- [Chromograph](https://github.com/Clinical-Genomics/chromograph) **6. Annotation - SV:** @@ -141,7 +141,7 @@ For more details about the output files and reports, please refer to the nf-core/raredisease was written in a collaboration between the Clinical Genomics nodes in Sweden, with major contributions from [Ramprasad Neethiraj](https://github.com/ramprasadn), [Anders Jemt](https://github.com/jemten), [Lucia Pena Perez](https://github.com/Lucpen), and [Mei Wu](https://github.com/projectoriented) at Clinical Genomics Stockholm. -Additional contributors were [Sima Rahimi](https://github.com/sima-r), [Gwenna Breton](https://github.com/Gwennid) and [Emma Västerviga](https://github.com/EmmaCAndersson) (Clinical Genomics Gothenburg); [Lauri Mesilaakso](https://github.com/ljmesi) (Clinical Genomics Linköping); [Subazini Thankaswamy Kosalai](https://github.com/sysbiocoder) (Clinical Genomics Örebro); [Annick Renevey](https://github.com/rannick) and [Peter Pruisscher](https://github.com/peterpru) (Clinical Genomics Stockholm); [Ryan Kennedy](https://github.com/ryanjameskennedy) (Clinical Genomics Lund); and [Lucas Taniguti](https://github.com/lmtani). +Additional contributors were [Sima Rahimi](https://github.com/sima-r), [Gwenna Breton](https://github.com/Gwennid) and [Emma Västerviga](https://github.com/EmmaCAndersson) (Clinical Genomics Gothenburg); [Halfdan Rydbeck](https://github.com/hrydbeck) and [Lauri Mesilaakso](https://github.com/ljmesi) (Clinical Genomics Linköping); [Subazini Thankaswamy Kosalai](https://github.com/sysbiocoder) (Clinical Genomics Örebro); [Annick Renevey](https://github.com/rannick) and [Peter Pruisscher](https://github.com/peterpru) (Clinical Genomics Stockholm); [Ryan Kennedy](https://github.com/ryanjameskennedy) (Clinical Genomics Lund); and [Lucas Taniguti](https://github.com/lmtani). We thank the nf-core community for their extensive assistance in the development of this pipeline.