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

FEAT: add merge to cache checks #1261

Merged
merged 3 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- [#1248](https://github.com/nf-core/sarek/pull/1248) - Improve annotation-cache docs
- [#1261](https://github.com/nf-core/sarek/pull/1261) - Enable cache for annotation generation when using 'merge'

### Fixed

Expand Down
14 changes: 7 additions & 7 deletions workflows/sarek.nf
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def checkPathParamList = [
]

// only check if we are using the tools
if (params.tools && params.tools.contains("snpeff")) checkPathParamList.add(params.snpeff_cache)
if (params.tools && params.tools.contains("vep")) checkPathParamList.add(params.vep_cache)
if (params.tools && (params.tools.split(',').contains('snpeff') || params.tools.split(',').contains('merge'))) checkPathParamList.add(params.snpeff_cache)
if (params.tools && (params.tools.split(',').contains('vep') || params.tools.split(',').contains('merge'))) checkPathParamList.add(params.vep_cache)

// Validate input parameters
WorkflowSarek.initialise(params, log)
Expand Down Expand Up @@ -216,7 +216,7 @@ if (params.step == 'mapping' && params.aligner.contains("sentieon-bwamem") && pa
error("Sentieon BWA is currently not compatible with FGBio UMI handeling. Please choose a different aligner.")
}

if (params.tools && params.tools.contains("sentieon_haplotyper") && params.joint_germline && (!params.sentieon_haplotyper_emit_mode || !(params.sentieon_haplotyper_emit_mode.contains('gvcf')))) {
if (params.tools && params.tools.split(',').contains("sentieon_haplotyper") && params.joint_germline && (!params.sentieon_haplotyper_emit_mode || !(params.sentieon_haplotyper_emit_mode.contains('gvcf')))) {
error("When setting the option `--joint_germline` and including `sentieon_haplotyper` among the requested tools, please set `--sentieon_haplotyper_emit_mode` to include `gvcf`.")
}

Expand Down Expand Up @@ -323,7 +323,7 @@ vep_genome = params.vep_genome ?: Channel.empty()
vep_species = params.vep_species ?: Channel.empty()

// Initialize files channels based on params, not defined within the params.genomes[params.genome] scope
if (params.snpeff_cache && params.tools && params.tools.contains("snpeff")) {
if (params.snpeff_cache && params.tools && (params.tools.split(',').contains("snpeff") || params.tools.split(',').contains('merge'))) {
if (params.snpeff_cache == "s3://annotation-cache/snpeff_cache") {
def snpeff_annotation_cache_key = "${params.snpeff_genome}.${params.snpeff_db}/"
} else {
Expand All @@ -340,11 +340,11 @@ if (params.snpeff_cache && params.tools && params.tools.contains("snpeff")) {
}
snpeff_cache = Channel.fromPath(file("${params.snpeff_cache}/${snpeff_annotation_cache_key}"), checkIfExists: true).collect()
.map{ cache -> [ [ id:"${params.snpeff_genome}.${params.snpeff_db}" ], cache ] }
} else if (params.tools && params.tools.contains("snpeff") && !params.download_cache) {
} else if (params.tools && (params.tools.split(',').contains("snpeff") || params.tools.split(',').contains('merge')) && !params.download_cache) {
error("No cache for SnpEff or automatic download of said cache has been detected.\nPlease refer to https://nf-co.re/sarek/docs/usage/#how-to-customise-snpeff-and-vep-annotation for more information.")
} else snpeff_cache = []

if (params.vep_cache && params.tools && params.tools.contains("vep")) {
if (params.vep_cache && params.tools && (params.tools.split(',').contains("vep") || params.tools.split(',').contains('merge'))) {
if (params.vep_cache == "s3://annotation-cache/vep_cache") {
def vep_annotation_cache_key = "${params.vep_cache_version}_${params.vep_genome}/"
} else {
Expand All @@ -360,7 +360,7 @@ if (params.vep_cache && params.tools && params.tools.contains("vep")) {
}
}
vep_cache = Channel.fromPath(file("${params.vep_cache}/${vep_annotation_cache_key}"), checkIfExists: true).collect()
} else if (params.tools && params.tools.contains("vep") && !params.download_cache) {
} else if (params.tools && (params.tools.split(',').contains("vep") || params.tools.split(',').contains('merge')) && !params.download_cache) {
error("No cache for VEP or automatic download of said cache has been detected.\nPlease refer to https://nf-co.re/sarek/docs/usage/#how-to-customise-snpeff-and-vep-annotation for more information.")
} else vep_cache = []

Expand Down