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

Patch to dev #565

Merged
merged 14 commits into from
Feb 18, 2025
3 changes: 0 additions & 3 deletions .github/workflows/ci_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ on:
- synchronize
branches:
- master
pull_request_target:
branches:
- master

env:
NXF_ANSI_LOG: false
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
> Version has been added if just the new version information is present.
> Version has been removed if new version information isn't present.

## 0.4.1 - [2025-02-17]

### `Fixed`

- [#553](https://github.com/genomic-medicine-sweden/nallo/pull/553) - Fixed pipeline always requiring `--vep_cache` to run, and clarified documentation
- [#553](https://github.com/genomic-medicine-sweden/nallo/pull/553) - Fixed `process.shell` in `nextflow.config` causing CI runners to fail

## 0.4.0 - [2025-01-15]

### `Added`
Expand Down
20 changes: 17 additions & 3 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,12 @@ Turned off with `--skip_rank_variants`.

This subworkflow relies on the alignment subworkflow, and requires the following additional files:

| Parameter | Description |
| -------------------------------- | --------------------------------------------------------------------- |
| `svdb_sv_databases` <sup>1</sup> | Csv file with databases (VCFs) used for structural variant annotation |
| Parameter | Description |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `svdb_sv_databases` <sup>1</sup> | Csv file with databases (VCFs) used for structural variant annotation |
| `vep_cache` | VEP cache matching your reference genome, either as a `.tar.gz` archive or path to a directory (e.g. [homo_sapiens_vep_110_GRCh38.tar.gz](https://ftp.ensembl.org/pub/release-110/variation/vep/homo_sapiens_vep_110_GRCh38.tar.gz)) |
| `vep_plugin_files` <sup>2</sup> | A csv file with VEP plugin files, pLI and LoFtool are required. Example provided below. |
| `variant_consequences_svs` | A list of SO terms listed in the order of severity from most severe to lease severe for annotating SVs. Sample file [here](https://github.com/nf-core/test-datasets/blob/raredisease/reference/variant_consequences_v2.txt). You can learn more about these terms [here](https://ensembl.org/info/genome/variation/prediction/predicted_data.html) |

<sup>1</sup> Example file for input with `--svdb_sv_databases`:

Expand All @@ -303,6 +306,17 @@ https://github.com/genomic-medicine-sweden/test-datasets/raw/b9ff54b59cdd39df5b6

These databases could for example come from [CoLoRSdb](https://zenodo.org/records/13145123).

<sup>2</sup> Example file for input with `--vep_plugin_files`

```
vep_files
https://raw.githubusercontent.com/genomic-medicine-sweden/test-datasets/nallo/reference/vep_plugins/spliceai_21_scores_raw_indel_-v1.3-.vcf.gz.tbi
https://raw.githubusercontent.com/genomic-medicine-sweden/test-datasets/nallo/reference/vep_plugins/spliceai_21_scores_raw_indel_-v1.3-.vcf.gz
https://raw.githubusercontent.com/genomic-medicine-sweden/test-datasets/nallo/reference/vep_plugins/spliceai_21_scores_raw_snv_-v1.3-.vcf.gz.tbi
https://raw.githubusercontent.com/genomic-medicine-sweden/test-datasets/nallo/reference/vep_plugins/pLI_values.txt
https://raw.githubusercontent.com/genomic-medicine-sweden/test-datasets/nallo/reference/vep_plugins/LoFtool_scores.txt
```

Turned off with `--skip_sv_annotation`.

### Rank SVs
Expand Down
15 changes: 7 additions & 8 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,13 @@ env {
}

// Set bash options
process.shell = """\
bash

set -e # Exit if a tool returns a non-zero status/exit code
set -u # Treat unset variables and parameters as an error
set -o pipefail # Returns the status of the last command to exit with a non-zero status or zero if all successfully execute
set -C # No clobber - prevent output redirection from overwriting files.
"""
process.shell = [
"bash",
"-C", // No clobber - prevent output redirection from overwriting files.
"-e", // Exit if a tool returns a non-zero status/exit code
"-u", // Treat unset variables and parameters as an error
"-o pipefail" // Returns the status of the last command to exit with a non-zero status or zero if all successfully execute
]

// Disable process selector warnings by default. Use debug profile to enable warnings.
nextflow.enable.configProcessNamesValidation = false
Expand Down
48 changes: 25 additions & 23 deletions subworkflows/local/utils_nfcore_nallo_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def parameterStatus = [
workflow: [
skip_snv_calling : params.skip_snv_calling,
skip_phasing : params.skip_phasing,
skip_methylation_pileups: params.skip_methylation_pileups,
skip_methylation_pileups : params.skip_methylation_pileups,
skip_rank_variants : params.skip_rank_variants,
skip_repeat_calling : params.skip_repeat_calling,
skip_repeat_annotation : params.skip_repeat_annotation,
Expand Down Expand Up @@ -115,8 +115,9 @@ def parameterStatus = [
genmod_reduced_penetrance: params.genmod_reduced_penetrance,
genmod_score_config_snvs : params.genmod_score_config_snvs,
genmod_score_config_svs : params.genmod_score_config_svs,
variant_consequences_snvs : params.variant_consequences_snvs,
variant_consequences_snvs: params.variant_consequences_snvs,
variant_consequences_svs : params.variant_consequences_svs,
vep_plugin_files : params.vep_plugin_files,
]
]

Expand Down Expand Up @@ -450,18 +451,22 @@ def checkWorkflowDependencies(String skip, Map combinationsMap, Map statusMap, M
// Lookup if a file is required by any workflows, and add to errors
//
def checkFileDependencies(String file, Map combinationsMap, Map statusMap, Map workflowMap, List errors) {
// Get the the workflow required by file
def workflowThatRequiresFile = findKeyForValue(file, combinationsMap)
// Get the "--skip" for that workflow
def workflowSkip = workflowMap[workflowThatRequiresFile]
// Get the status of the "--skip", if false then workflow is active
def WorkflowIsActive = !statusMap["workflow"][workflowSkip]
// Get the file path
def FilePath = statusMap["files"][file]
// If the workflow that requires the file is active & theres no file available
if(WorkflowIsActive && FilePath == null) {
errors << "--$workflowSkip is NOT active, the following files are required: --$file"
// Get all workflows required by a file
def workflowThatRequiresFile = findKeysForValue(file, combinationsMap)

for (workflow in workflowThatRequiresFile) {
// Get the "--skip" for that workflow
def workflowSkip = workflowMap[workflow]
// Get the status of the "--skip", if false then workflow is active
def WorkflowIsActive = !statusMap["workflow"][workflowSkip]
// Get the file path
def FilePath = statusMap["files"][file]
// If the workflow that requires the file is active & theres no file available
if(WorkflowIsActive && FilePath == null) {
errors << "--$workflowSkip is NOT active, the following files are required: --$file"
}
}

return errors
}

Expand All @@ -487,22 +492,19 @@ def findRequiredSkips(paramType, Set<String> requiredWorkflows, Map statusMap, M
return requiredSkips
}

def findKeyForValue(def valueToFind, Map map) {
def findKeysForValue(def valueToFind, Map map) {

def keys = []

for (entry in map) {
def key = entry.key
def value = entry.value

if (value instanceof List) {
if (value.contains(valueToFind)) {
return key
}
} else {
if (value == valueToFind) {
return key
}
if ((value instanceof List && value.contains(valueToFind)) || value == valueToFind) {
keys << key
}
}
return null // Value not found
return keys.isEmpty() ? null : keys
}

// Utility function to create channels from references
Expand Down
8 changes: 4 additions & 4 deletions workflows/nallo.nf
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ workflow NALLO {
ch_par = createReferenceChannelFromPath(params.par_regions)
ch_trgt_bed = createReferenceChannelFromPath(params.trgt_repeats)
ch_stranger_repeat_catalog = createReferenceChannelFromPath(params.stranger_repeat_catalog)
ch_variant_consequences_snvs = createReferenceChannelFromPath(params.variant_consequences_snvs)
ch_variant_consequences_snvs = createReferenceChannelFromPath(params.variant_consequences_snvs)
ch_variant_consequences_svs = createReferenceChannelFromPath(params.variant_consequences_svs)
ch_vep_cache_unprocessed = createReferenceChannelFromPath(params.vep_cache, Channel.value([]))
ch_vep_cache_unprocessed = createReferenceChannelFromPath(params.vep_cache, Channel.value([[],[]]))
ch_expected_xy_bed = createReferenceChannelFromPath(params.hificnv_expected_xy_cn)
ch_expected_xx_bed = createReferenceChannelFromPath(params.hificnv_expected_xx_cn)
ch_exclude_bed = createReferenceChannelFromPath(params.hificnv_excluded_regions)
Expand Down Expand Up @@ -127,8 +127,8 @@ workflow NALLO {
PREPARE_GENOME (
ch_fasta,
ch_vep_cache_unprocessed,
params.fasta.endsWith('.gz'), // should we unzip fasta
params.vep_cache.endsWith("tar.gz") // should we untar vep cache
params.fasta.endsWith('.gz'), // should we unzip fasta
params.vep_cache && params.vep_cache.endsWith("tar.gz") // should we untar vep cache
)
ch_versions = ch_versions.mix(PREPARE_GENOME.out.versions)

Expand Down