Skip to content

Commit

Permalink
Revert "Merge branch 'dev' into add-found-in-cnv"
Browse files Browse the repository at this point in the history
This reverts commit 44939b0, reversing
changes made to bc5c57b.
  • Loading branch information
fellen31 committed Oct 4, 2024
1 parent 04cba18 commit f19c2a1
Show file tree
Hide file tree
Showing 11 changed files with 153 additions and 30 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,9 @@ jobs:
steps:
- name: Check out pipeline code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- name: Fetch ${{ github.event.pull_request.base.ref }} branch
run: |
git remote add upstream ${{ github.event.repository.clone_url }}
git fetch upstream ${{ github.event.pull_request.base.ref }}

- name: Install Nextflow
uses: nf-core/setup-nextflow@v2
uses: nf-core/setup-nextflow@b9f764e8ba5c76b712ace14ecbfcef0e40ae2dd8 # v1
with:
version: "${{ matrix.NXF_VER }}"

Expand All @@ -70,13 +64,18 @@ jobs:
- name: Run nf-test
run: |
nf-test test \
--ci \
--changed-since upstream/${{ github.event.pull_request.base.ref }} \
--verbose \
--tag ${{ matrix.tags }} \
--profile "+${{ matrix.profile }}" \
--junitxml=test.xml
nf-test test --verbose --tag ${{ matrix.tags }} --profile "+${{ matrix.profile }}" --junitxml=test.xml --tap=test.tap
- uses: pcolby/tap-summary@v1
with:
path: >-
test.tap
- name: Output log on failure
if: failure()
run: |
sudo apt install bat > /dev/null
batcat --decorations=always --color=always ${{ github.workspace }}/.nf-test/tests/*/meta/nextflow.log
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#388](https://github.com/genomic-medicine-sweden/nallo/pull/388) - Added longphase as the default phaser
- [#388](https://github.com/genomic-medicine-sweden/nallo/pull/388) - Added single-sample tbi output to the short variant calling subworkflow
- [#393](https://github.com/genomic-medicine-sweden/nallo/pull/393) - Added a new `--minimap2_read_mapping_preset` parameter
- [#408](https://github.com/genomic-medicine-sweden/nallo/pull/408) - Added a new subworkflow to annotate SVs

### `Changed`

Expand All @@ -38,7 +39,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#393](https://github.com/genomic-medicine-sweden/nallo/pull/393) - Changed the default minimap2 preset for PacBio data from `map-hifi` to `lr:hqae`
- [#397](https://github.com/genomic-medicine-sweden/nallo/pull/397) - Changed `pipelines_testdata_base_path` to pin a specific commit
- [#402](https://github.com/genomic-medicine-sweden/nallo/pull/402) - Updated broken test profile link added in [#397](https://github.com/genomic-medicine-sweden/nallo/pull/397)
- [#404](https://github.com/genomic-medicine-sweden/nallo/pull/404) - Changed to only run nf-tests where files have changes compared to the base branch

### `Removed`

Expand Down
40 changes: 40 additions & 0 deletions assets/svdb_query_vcf_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://raw.githubusercontent.com/nf-core/raredisease/master/assets/mobile_element_references_schema.json",
"title": "Schema for SVDB query - VCF",
"description": "Schema for the SVDB query database input, VCF version",
"type": "array",
"items": {
"type": "object",
"properties": {
"filename": {
"type": "string",
"format": "file-path",
"exists": true,
"pattern": "^\\S+\\.vcf?(\\.gz)?$",
"errorMessage": "Path to query database cannot contain spaces and must be a vcf file"
},
"in_freq_info_key": {
"type": "string",
"pattern": "^\\S+$",
"errorMessage": "In frequency key cannot contain spaces"
},
"in_allele_count_info_key": {
"type": "string",
"pattern": "^\\S+$",
"errorMessage": "In allele count key cannot contain spaces"
},
"out_freq_info_key": {
"type": "string",
"pattern": "^\\S+$",
"errorMessage": "Out frequency key must be provided and cannot contain spaces"
},
"out_allele_count_info_key": {
"type": "string",
"pattern": "^\\S+$",
"errorMessage": "Out allele count key must be provided and cannot contain spaces"
}
},
"required": ["filename", "out_freq_info_key", "out_allele_count_info_key"]
}
}
57 changes: 57 additions & 0 deletions conf/modules/annotate_svs.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Config file for defining DSL2 per module options and publishing paths
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Available keys to override module options:
ext.args = Additional arguments appended to command in module.
ext.args2 = Second set of arguments appended to command in module (multi-tool modules).
ext.args3 = Third set of arguments appended to command in module (multi-tool modules).
ext.prefix = File name prefix for output files.
----------------------------------------------------------------------------------------
*/

process {

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Annotate SVs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

withName: '.*:ANNOTATE_SVS:.*' {
publishDir = [
enabled: false,
]
}

withName: '.*ANNOTATE_SVS:ENSEMBLVEP_SV' {
ext.args = { [
"${params.extra_vep_options}",
"--dir_plugins .",
'--plugin pLI,pLI_values.txt',
'--appris --biotype --buffer_size 100 --canonical --cache --ccds',
'--compress_output bgzip --distance 5000 --domains',
'--exclude_predicted --force_overwrite --format vcf',
'--fork 4 --hgvs --humdiv --max_sv_size 248387328',
'--no_progress --numbers --per_gene --polyphen p',
'--protein --offline --sift p', // Add back regulatory with VEP 113
'--symbol --tsl --uniprot --vcf',
'--no_stats'
].join(' ') }
ext.prefix = { "${meta.id}_svs_annotated" }
publishDir = [
path: { "${params.outdir}/svs/multi_sample/${meta.id}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: '.*ANNOTATE_SVS:TABIX_VEP' {
publishDir = [
path: { "${params.outdir}/svs/multi_sample/${meta.id}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

}
2 changes: 1 addition & 1 deletion conf/modules/call_svs.config
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ process {
publishDir = [
path: { "${params.outdir}/svs/multi_sample/${meta.id}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
saveAs: { filename -> filename.equals('versions.yml') || params.skip_sv_annotation ? null : filename }
]
}

Expand Down
3 changes: 3 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ params {
reduced_penetrance = null
score_config_snv = null
snp_db = null
svdb_dbs = null
variant_consequences_snv = null
vep_cache = null
vep_plugin_files = null
Expand All @@ -42,6 +43,7 @@ params {
skip_repeat_annotation = params.preset == 'ONT_R10' ? true : false
skip_short_variant_calling = false
skip_snv_annotation = false
skip_sv_annotation = false

deepvariant_model_type = params.preset == 'ONT_R10' ? 'ONT_R104' : 'PACBIO'
minimap2_read_mapping_preset = params.preset == 'ONT_R10' ? 'lr:hq' : 'lr:hqae'
Expand Down Expand Up @@ -303,6 +305,7 @@ includeConfig 'conf/base.config'
includeConfig 'conf/modules/annotate_cadd.config'
includeConfig 'conf/modules/annotate_consequence_pli.config'
includeConfig 'conf/modules/annotate_repeat_expansions.config'
includeConfig 'conf/modules/annotate_svs.config'
includeConfig 'conf/modules/general.config'
includeConfig 'conf/modules/bam_infer_sex.config'
includeConfig 'conf/modules/call_paralogs.config'
Expand Down
16 changes: 16 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@
"description": "Skip short variant annotation",
"default": false
},
"skip_sv_annotation": {
"type": "boolean",
"description": "Skip structural variant annotation",
"default": false
},
"skip_cnv_calling": {
"type": "boolean",
"description": "Skip CNV calling",
Expand Down Expand Up @@ -489,6 +494,17 @@
"description": "A csv file with echtvar databases to annotate SNVs with",
"exists": true
},
"svdb_dbs": {
"type": "string",
"exists": true,
"format": "file-path",
"description": "Databases used for structural variant annotation in vcf format.",
"fa_icon": "fas fa-file-csv",
"help_text": "Path to comma-separated file containing information about the databases used for structural variant annotation.",
"pattern": "^\\S+\\.csv$",
"mimetype": "text/csv",
"schema": "assets/svdb_query_vcf_schema.json"
},
"variant_catalog": {
"type": "string",
"description": "A variant catalog json-file for stranger",
Expand Down
2 changes: 1 addition & 1 deletion nf-test.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ config {
workDir ".nf-test"
configFile "tests/nextflow.config"
profile "docker"
triggers 'nextflow.config', 'nf-test.config', 'test-data/**/*'

}
4 changes: 2 additions & 2 deletions subworkflows/local/annotate_svs/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ workflow ANNOTATE_SVS {
)

ENSEMBLVEP_SV (
SVDB_QUERY.out.vcf,
SVDB_QUERY.out.vcf.map { meta, vcf -> [ meta, vcf, [] ] },
"GRCh38",
"homo_sapiens",
val_vep_cache_version,
ch_vep_cache,
ch_fasta,
ch_vep_extra_files
)
ch_versions = ch_versions.mix(ENSEMBLVEP_VEP.out.versions)
ch_versions = ch_versions.mix(ENSEMBLVEP_SV.out.versions)

TABIX_ENSEMBLVEP_SV (
ENSEMBLVEP_SV.out.vcf
Expand Down
3 changes: 3 additions & 0 deletions subworkflows/local/utils_nfcore_nallo_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def workflowSkips = [
mapping : "skip_mapping_wf",
snv_calling : "skip_short_variant_calling",
snv_annotation : "skip_snv_annotation",
sv_annotation : "skip_sv_annotation",
call_paralogs : "skip_call_paralogs",
cnv_calling : "skip_cnv_calling",
phasing : "skip_phasing_wf",
Expand All @@ -57,6 +58,7 @@ def workflowDependencies = [
call_paralogs : ["mapping"],
snv_calling : ["mapping"],
qc : ["mapping"],
sv_annotation : ["mapping"],
snv_annotation : ["mapping", "snv_calling"],
cnv_calling : ["mapping", "snv_calling"],
phasing : ["mapping", "snv_calling"],
Expand All @@ -74,6 +76,7 @@ def fileDependencies = [
assembly : ["fasta", "par_regions"], // The assembly workflow should be split into two - assembly and variant calling (requires ref)
snv_calling : ["fasta", "par_regions"],
snv_annotation : ["snp_db", "vep_cache", "vep_plugin_files", "variant_consequences_snv"],
sv_annotation : ["svdb_dbs", "vep_cache", "vep_plugin_files", "variant_consequences_snv"],
cnv_calling : ["hificnv_xy", "hificnv_xx", "hificnv_exclude"],
rank_variants : ["reduced_penetrance", "score_config_snv"],
repeat_calling : ["trgt_repeats"],
Expand Down
27 changes: 16 additions & 11 deletions workflows/nallo.nf
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ workflow NALLO {
: Channel.value([])
ch_somalier_sites = params.somalier_sites ? Channel.fromPath(params.somalier_sites).map { [ it.simpleName, it ] }.collect()
: ''
ch_svdb_dbs = params.svdb_dbs ? Channel.fromPath(params.svdb_dbs).map { [ it.simpleName, it ] }.collect()
: ''

// Check parameter that doesn't conform to schema validation here
if (params.phaser.matches('hiphase') && params.preset == 'ONT_R10') { error "The HiPhase license only permits analysis of data from PacBio. For details see: https://github.com/PacificBiosciences/HiPhase/blob/main/LICENSE.md" }
Expand Down Expand Up @@ -311,17 +313,20 @@ workflow NALLO {
)
ch_versions = ch_versions.mix(CALL_SVS.out.versions)

//
// Annotate structural variants
//
ANNOTATE_SVS (
CALL_SVS.out.ch_multisample_vcf,
fasta,
svdb_dbs,
ch_vep_cache,
params.vep_cache_version,
ch_vep_extra_files
)

//
// Annotate structural variants
//
if(!params.skip_sv_annotation) {
ANNOTATE_SVS (
CALL_SVS.out.ch_multisample_vcf,
fasta,
ch_svdb_dbs,
ch_vep_cache,
params.vep_cache_version,
ch_vep_extra_files
)
}

//
// Call (and annotate and rank) SNVs
Expand Down

0 comments on commit f19c2a1

Please sign in to comment.