Skip to content

Commit

Permalink
Add SNV annotation to test profile (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
fellen31 authored Apr 17, 2024
1 parent 5313950 commit 3ebc4e8
Show file tree
Hide file tree
Showing 17 changed files with 278 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Initial release of genomic-medicine-sweden/skierfe, created with the [nf-core](h

### `Added`

- Added SNV annotation subworkflow to test profile [#75](https://github.com/genomic-medicine-sweden/skierfe/pull/75)
- Refactored conditionally required parameters validation [#69](https://github.com/genomic-medicine-sweden/skierfe/pull/69)
- Added CNV workflow to test profile [#68](https://github.com/genomic-medicine-sweden/skierfe/pull/68)
- Updated and rename output directories [#65](https://github.com/genomic-medicine-sweden/skierfe/pull/65)
Expand Down
1 change: 1 addition & 0 deletions assets/test_data/snp_dbs.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
sample,file
cadd,https://raw.githubusercontent.com/genomic-medicine-sweden/skierfe/dev/assets/test_data/cadd.v1.6.hg38.test_data.zip

6 changes: 5 additions & 1 deletion conf/modules/prepare_genome.config
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ process {
}

withName: '.*:PREPARE_GENOME:MINIMAP2_INDEX_DIPCALL' {
ext.args = "-x asm5"
ext.args = "-x asm5"
}

withName: '.*:PREPARE_GENOME:UNTAR_VEP_CACHE' {
ext.when = { (params.vep_cache && params.vep_cache.endsWith("tar.gz")) }
}
}
8 changes: 1 addition & 7 deletions conf/modules/snv_annotation.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,12 @@ process {
]
}

withName: '.*:SNV_ANNOTATION:BCFTOOLS_NORM' {
withName: '.*:SNV_ANNOTATION:BCFTOOLS_NORM_SINGLESAMPLE' {
ext.args = "-m - --output-type b -w 10000"
}

withName: '.*:SNV_ANNOTATION:ECHTVAR_ANNO' {

// Do we want to filter variants here?
//ext.args = ""

publishDir = [
path: { "${params.outdir}/snv_annotation/echtvar/anno/${meta.id}" },
mode: params.publish_dir_mode,
Expand All @@ -42,9 +39,6 @@ process {

withName: '.*:SNV_ANNOTATION:ECHTVAR_ENCODE' {

// Do we want to filter variants here?
//ext.args = ""

publishDir = [
path: { "${params.outdir}/snv_annotation/echtvar/encode/${meta.id}" },
mode: params.publish_dir_mode,
Expand Down
5 changes: 3 additions & 2 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ params {
// TRGT
trgt_repeats = "https://raw.githubusercontent.com/genomic-medicine-sweden/skierfe/dev/assets/external/pathogenic_repeats.hg38.bed"

// Not tested
skip_snv_annotation = true
// SNV Annotation
vep_cache = "https://raw.githubusercontent.com/genomic-medicine-sweden/skierfe/dev/assets/test_data/vep_cache_test_data.tar.gz"
snp_db = "https://raw.githubusercontent.com/genomic-medicine-sweden/skierfe/dev/assets/test_data/snp_dbs.csv"

parallel_snv = 3 // Create 3 parallel DeepVariant processes
preset = "revio"
Expand Down
5 changes: 5 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@
"branch": "master",
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
"installed_by": ["modules"]
},
"untar": {
"branch": "master",
"git_sha": "5caf7640a9ef1d18d765d55339be751bb0969dfa",
"installed_by": ["modules"]
}
}
},
Expand Down
11 changes: 11 additions & 0 deletions modules/nf-core/untar/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions modules/nf-core/untar/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions modules/nf-core/untar/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions modules/nf-core/untar/tests/main.nf.test

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions modules/nf-core/untar/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions modules/nf-core/untar/tests/tags.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ params {
trgt_repeats = null
snp_db = null
vep_cache = null
vep_cache_version = 110

// HiFiCNV
hificnv_xy = null
Expand Down
7 changes: 6 additions & 1 deletion nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@
"default": 13,
"description": "Split SNV calling into n chunks",
"minimum": 1
},
"vep_cache_version": {
"type": "integer",
"default": 110,
"description": "VEP cache version"
}
},
"required": ["preset"]
Expand Down Expand Up @@ -412,7 +417,7 @@
"vep_cache": {
"type": "string",
"description": "Path to directory of vep_cache",
"format": "directory-path",
"format": "path",
"exists": true
},
"bed": {
Expand Down
27 changes: 19 additions & 8 deletions subworkflows/local/prepare_genome.nf
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
include { SAMTOOLS_FAIDX } from '../../modules/nf-core/samtools/faidx/main'
include { MINIMAP2_INDEX } from '../../modules/nf-core/minimap2/index/main'
include { GUNZIP as GUNZIP_FASTA } from '../../modules/nf-core/gunzip/main'
include { SAMTOOLS_FAIDX } from '../../modules/nf-core/samtools/faidx/main'
include { MINIMAP2_INDEX } from '../../modules/nf-core/minimap2/index/main'
include { GUNZIP as GUNZIP_FASTA } from '../../modules/nf-core/gunzip/main'
include { UNTAR as UNTAR_VEP_CACHE } from '../../modules/nf-core/untar/main'

workflow PREPARE_GENOME {

take:
fasta_in // channel: [ val(meta), fasta ]
fasta_in // channel: [ val(meta), fasta ]
ch_vep_cache // channel: [mandatory for annotation] [ path(cache) ]

main:
ch_versions = Channel.empty()
Expand All @@ -29,13 +31,22 @@ workflow PREPARE_GENOME {
SAMTOOLS_FAIDX ( ch_fasta )
MINIMAP2_INDEX ( ch_fasta )

UNTAR_VEP_CACHE (ch_vep_cache)

UNTAR_VEP_CACHE.out.untar
.map { meta, files -> [files] }
.collect()
.set { untarred_vep }

// Gather versions
ch_versions = ch_versions.mix(SAMTOOLS_FAIDX.out.versions.first())
ch_versions = ch_versions.mix(MINIMAP2_INDEX.out.versions.first())
ch_versions = ch_versions.mix(UNTAR_VEP_CACHE.out.versions)

emit:
fasta = ch_fasta // channel: [ val(meta), fasta ]
fai = SAMTOOLS_FAIDX.out.fai.collect() // channel: [ val(meta), fai ]
mmi = MINIMAP2_INDEX.out.index.collect() // channel: [ val(meta), mmi ]
versions = ch_versions // channel: [ versions.yml ]
fasta = ch_fasta // channel: [ val(meta), fasta ]
fai = SAMTOOLS_FAIDX.out.fai.collect() // channel: [ val(meta), fai ]
vep_resources = untarred_vep // channel: [ path(cache) ]
mmi = MINIMAP2_INDEX.out.index.collect() // channel: [ val(meta), mmi ]
versions = ch_versions // channel: [ versions.yml ]
}
3 changes: 2 additions & 1 deletion subworkflows/local/snv_annotation.nf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ workflow SNV_ANNOTATION {
ch_databases
ch_fasta
ch_vep_cache
val_vep_cache_version // string: [mandatory] default: 110

main:
ch_versions = Channel.empty()
Expand Down Expand Up @@ -51,7 +52,7 @@ workflow SNV_ANNOTATION {
vep_in,
"GRCh38",
"homo_sapiens",
"110",
val_vep_cache_version,
ch_vep_cache,
ch_fasta,
[]
Expand Down
Loading

0 comments on commit 3ebc4e8

Please sign in to comment.