Skip to content
Open
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Added`

- Parameters `manta_call_regions`, `ml_prob_threshold`, `sv_freq_filter_expression`, `filter_expansionhunter_htt`, `filter_sv_to_manta`, `skip_vep_sv`, and `sv_size_threshold` to expose optional filtering and calling controls as pipeline parameters [#](https://github.com/nf-core/raredisease/pull/)
- Interval parameter in the default retroseq call [#717](https://github.com/nf-core/raredisease/pull/717)
- Tests for call_repeat_expansions and qc_bam subworkflows [#713](https://github.com/nf-core/raredisease/pull/713)
- Feature to subsample mitochondrial alignments based on number of reads [#748](https://github.com/nf-core/raredisease/pull/748)
Expand Down Expand Up @@ -52,6 +53,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added `--skip_split_multiallelics` parameter to allow users to skip the `bcftools norm --multiallelics -both` step in SNV calling (DeepVariant and Sentieon), which can cause indel quality degradation in single-interval runs [#823](https://github.com/nf-core/raredisease/pull/823)
- Extended vcfanno database sanity check to include extra vcfanno resources (`vcfanno_extra`) alongside the main resources, and moved the check upstream to `raredisease.nf` so it covers both genome and mitochondrial SNV annotation subworkflows [#834](https://github.com/nf-core/raredisease/pull/834)

### `Fixed`

- Remove `imNotification` import and call from `utils_nfcore_raredisease_pipeline` after it was removed in the updated `utils_nfcore_pipeline` subworkflow [#](https://github.com/nf-core/raredisease/pull/)
- Use conditional output prefix for `BCFTOOLS_DECOMPRESS_MERGE` in `call_repeat_expansions` so that the file is named `<case_id>_repeat_expansion.vcf` by default and `<case_id>_filtered_htt_exphunter.vcf` only when `--filter_expansionhunter_htt` is set [#](https://github.com/nf-core/raredisease/pull/)

### `Changed`

- Use distinct output filenames for bcfools (in call_mobile_elements subworkflow) and svdb (in call_sv_tiddit subworkflow) [#716](https://github.com/nf-core/raredisease/pull/716)
Expand Down
9 changes: 9 additions & 0 deletions conf/modules/annotate_structural_variants.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ process {
ext.prefix = { "${meta.id}_view" }
}

withName: '.*ANNOTATE_STRUCTURAL_VARIANTS:BCFTOOLS_FILTER_SV' {
ext.args = {
params.sv_freq_filter_expression
? "-e '${params.sv_freq_filter_expression}' -Oz --write-index=tbi"
: "-Oz --write-index=tbi"
}
ext.prefix = { "${meta.id}_sv_filtered" }
}

withName: '.*ANNOTATE_STRUCTURAL_VARIANTS:ENSEMBLVEP_SV' {
ext.args = { [
'--dir_cache cache',
Expand Down
14 changes: 14 additions & 0 deletions conf/modules/call_repeat_expansions.config
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ process {
ext.prefix = { "${meta.id}_split_exp" }
}

withName: '.*CALL_REPEAT_EXPANSIONS:BCFTOOLS_FILTER_HTT' {
ext.args = "-e 'INFO/REPID=\"HTT\" || INFO/REPID~\"^HTT_\"' -Oz --write-index=tbi"
ext.prefix = { "${meta.id}_filtered_exp" }
}

withName: '.*CALL_REPEAT_EXPANSIONS:BCFTOOLS_DECOMPRESS_MERGE' {
ext.args = '--output-type v'
ext.prefix = {
params.filter_expansionhunter_htt
? "${meta.id}_filtered_htt_exphunter"
: "${meta.id}_repeat_expansion"
}
}

withName: '.*CALL_REPEAT_EXPANSIONS:SVDB_MERGE_REPEATS' {
ext.args = {"--notag"}
}
Expand Down
12 changes: 10 additions & 2 deletions conf/modules/call_snv_sentieon.config
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,16 @@ process {
}

withName: '.*CALL_SNV:CALL_SNV_SENTIEON:BCF_FILTER_ONE' {
ext.args = "-s 'ML_FAIL' -i 'INFO/ML_PROB <= 0.95' -m x --output-type z --write-index=tbi"
ext.prefix = { "${meta.id}_mlfiltered_0.95" }
ext.args = {
params.ml_prob_threshold
? "-s 'ML_FAIL' -i 'INFO/ML_PROB <= ${params.ml_prob_threshold}' -m x -Oz --write-index=tbi"
: "-s 'ML_FAIL' -e 'FILTER==\"MLrejected\"' -m x -Oz --write-index=tbi"
}
ext.prefix = {
params.ml_prob_threshold
? "${meta.id}_mlfiltered_${params.ml_prob_threshold}"
: "${meta.id}_mlfiltered"
}
}

withName: '.*CALL_SNV:CALL_SNV_SENTIEON:BCF_FILTER_TWO' {
Expand Down
11 changes: 9 additions & 2 deletions conf/modules/call_sv_manta.config
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@

process {
withName: '.*CALL_STRUCTURAL_VARIANTS:CALL_SV_MANTA:MANTA' {
ext.args = { (params.analysis_type == "wes") ? '--exome' : '' }
ext.args = {
def args = (params.analysis_type == "wes") ? '--exome' : ''
params.manta_call_regions ? [args, "--callRegions ${params.manta_call_regions}"].findAll { it }.join(' ') : args
}
}
withName: ".*CALL_STRUCTURAL_VARIANTS:CALL_SV_MANTA:BCFTOOLS_VIEW_MANTA" {
ext.prefix = { "${meta.id}_manta" }
ext.args = { '--apply-filters .,PASS --output-type z' }
ext.args = {
def args = '--apply-filters .,PASS'
if (params.sv_size_threshold) args += " -e 'abs(INFO/SVLEN) > ${params.sv_size_threshold}'"
args + ' -Oz --write-index=tbi'
}
}
}
3 changes: 2 additions & 1 deletion conf/modules/qc_bam.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ process {
}

withName: '.*QC_BAM:PICARD_COLLECTHSMETRICS' {
ext.args = "--TMP_DIR ."
ext.args = "--TMP_DIR ."
ext.prefix = { "${meta.id}_hsmetrics" }
ext.when = { params.target_bed != null }
}

withName: '.*QC_BAM:TIDDIT_COV' {
Expand Down
26 changes: 22 additions & 4 deletions docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ Results generated by MultiQC collate pipeline QC from supported tools e.g. FastQ

The pipeline performs variant calling using [Sentieon DNAscope](https://support.sentieon.com/manual/DNAscope_usage/dnascope/) with a machine learning model. This approach identifies the candidate sites with a higher accuracy, and calculates genotypes for each sample at that site. These files are treated as intermediates and are not placed in the output folder by default. DNAscope is not run by default. To use DNAscope instead of DeepVariant, set `--variant_caller` to sentieon.

Variant filtering behaviour can be controlled with an optional parameter:

- `--ml_prob_threshold`: When set (e.g. `0.6`), variants with `INFO/ML_PROB <= threshold` are tagged `ML_FAIL` and subsequently removed. When not set, variants already tagged `MLrejected` by Sentieon are tagged `ML_FAIL` instead.

<details markdown="1">
<summary>Output files</summary>

Expand All @@ -294,6 +298,12 @@ The pipeline performs variant calling using [Sentieon DNAscope](https://support.

[Manta](https://github.com/Illumina/manta) calls structural variants (SVs) and indels from mapped paired-end sequencing reads. It combines paired and split-read evidence during SV discovery and scoring to improve accuracy, but does not require split-reads or successful breakpoint assemblies to report a variant in cases where there is strong evidence otherwise. Output vcf files are treated as intermediates and are not placed in the output folder.

Two optional parameters affect Manta calling and the downstream SV merge:

- `--manta_call_regions`: Path to a bgzipped and indexed BED file restricting Manta to call only within specified genomic regions (passed via `--callRegions`). Useful for WES or targeted panels, or to exclude decoy and unplaced sequences from SV calling.
- `--sv_size_threshold`: Manta SVs larger than this value (in bp) are removed before merging. For example, `--sv_size_threshold 1000000` removes SVs larger than 1 Mb.
- `--filter_sv_to_manta`: When `true`, only Manta variants are included in the SVDB merge step; TIDDIT variants are excluded.

#### TIDDIT sv

[TIDDIT's sv](https://github.com/SciLifeLab/TIDDIT) is used to identify chromosomal rearrangements using sequencing data. TIDDIT identifies intra and inter-chromosomal translocations, deletions, tandem-duplications and inversions, using supplementary alignments as well as discordant pairs. TIDDIT searches for discordant reads and split reads (supplementary alignments). Output vcf files are treated as intermediates and are not placed in the output folder.
Expand Down Expand Up @@ -325,11 +335,14 @@ The pipeline performs variant calling using [Sentieon DNAscope](https://support.

[Expansion Hunter](https://github.com/Illumina/ExpansionHunter) aims to estimate sizes of repeat sequences by performing a targeted search through alignments that span, flank, and are fully contained in each repeat. The files generated are ready to be used with [REViewer](https://github.com/Illumina/REViewer).

The optional parameter `--filter_expansionhunter_htt` removes HTT (Huntington's disease) records from the ExpansionHunter output before downstream processing. This is useful when HTT calls are handled separately or are not clinically relevant in the current analysis.

<details markdown="1">
<summary>Output files</summary>

- `repeat_expansions/`
- `<sample_id>_repeat_expansion.vcf`: file containing variant calls.
- `<case_id>_repeat_expansion.vcf`: file containing variant calls (default).
- `<case_id>_filtered_htt_exphunter.vcf`: file containing variant calls with HTT records removed (when `--filter_expansionhunter_htt` is set).
- `<sample_id>_exphunter_sorted.bam`: A BAMlet containing alignments of reads that overlap or located in close proximity to each variant identified by ExpansionHunter
- `<sample_id>_exphunter_sorted.bam.bai`: Index of the BAMlet file

Expand Down Expand Up @@ -427,19 +440,24 @@ Based on VEP annotations, custom scripts used by the pipeline further annotate e

#### SVDB query

[SVDB query](https://github.com/J35P312/SVDB#Query) allows you to quickly annotate your VCF with data from one or more structural variant databases. The output files are not published in the output folder, and is passed to vep for further annotation.
[SVDB query](https://github.com/J35P312/SVDB#Query) allows you to quickly annotate your VCF with data from one or more structural variant databases. The output files are not published in the output folder, and is passed to a frequency filter step and then to VEP for further annotation.

After SVDB query, SVs can optionally be filtered by population frequency using `--sv_freq_filter_expression`. This parameter accepts a full [bcftools -e expression](https://samtools.github.io/bcftools/bcftools.html#expressions), for example `'INFO/SWEFRQ >= 0.02'`. Multiple conditions can be combined, e.g. `'INFO/SWEFRQ >= 0.02 || INFO/AF >= 0.02'`. When not set, the filtering step is skipped entirely.

#### VEP

[VEP](https://www.ensembl.org/info/docs/tools/vep/index.html) determines the effect of your variants on genes, transcripts, and protein sequence, as well as regulatory regions. We recommend annotating with pLI plugin, along with any other custom plugins you may want too use. Based on VEP annotations, custom scripts used by the pipeline further annotate each record with the most severe consequence, and pli scores.

VEP annotation of structural variants can be skipped by setting `--skip_vep_sv true`. SVDB query and frequency filtering still run; only the Picard sort, bcftools view, and VEP steps are skipped. In that case the frequency-filtered VCF is published directly.

<details markdown="1">
<summary>Output files</summary>

- `annotate_sv/`
- `<case_id>_svdbquery_vep.vcf.gz`: file containing svdb query, and vep annotations.
- `<case_id>_svdbquery_vep.vcf.gz.tbi`: index of the file containing bcftools roh, vcfanno, and vep annotations.
- `<case_id>_svdbquery_vep.vcf.gz`: file containing svdb query, frequency filter, and vep annotations. Published when `--skip_vep_sv` is not set.
- `<case_id>_svdbquery_vep.vcf.gz.tbi`: index of the annotated SV vcf file.
- `<case_id>_svdbquery_vep_summary.html`: vep summary.
- `<case_id>_sv_filtered.vcf.gz`: frequency-filtered SV vcf. Published instead of the VEP output when `--skip_vep_sv true` is set.

</details>

Expand Down
56 changes: 37 additions & 19 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,23 @@ The mandatory and optional parameters for each category are tabulated below.

##### 3. Repeat expansions

| Mandatory | Optional |
| --------------------------- | -------- |
| variant_catalog<sup>1</sup> | |
| Mandatory | Optional |
| --------------------------- | ------------------------------------ |
| variant_catalog<sup>1</sup> | filter_expansionhunter_htt<sup>2</sup> |

<sup>1</sup> We reccomend using the catalogs found [here](https://github.com/Clinical-Genomics/reference-files/tree/master/rare-disease/disease_loci/ExpansionHunter-v5.0.0). These catalogs have been extended from the illumina ones to include information on pathogenicity, which is neccesarry for the workflow.
<sup>1</sup> We reccomend using the catalogs found [here](https://github.com/Clinical-Genomics/reference-files/tree/master/rare-disease/disease_loci/ExpansionHunter-v5.0.0). These catalogs have been extended from the illumina ones to include information on pathogenicity, which is neccesarry for the workflow.<br />
<sup>2</sup> Set to `true` to remove HTT (Huntington's disease) records from ExpansionHunter output before downstream processing. Default is `false`.

##### 4. Variant calling - SNV

| Mandatory | Optional |
| -------------------------- | ------------------------------------- |
| variant_caller<sup>1</sup> | known_dbsnp<sup>2</sup> |
| ml_model<sup>2</sup> | known_dbsnp_tbi<sup>2</sup> |
| analysis_type<sup>3</sup> | call_interval<sup>2</sup> |
| | known_dbsnp_tbi<sup>2</sup> |
| | par_bed<sup>4</sup> |
| | ml_prob_threshold<sup>2</sup> |
| Mandatory | Optional |
| -------------------------- | ------------------------------------ |
| variant_caller<sup>1</sup> | known_dbsnp<sup>2</sup> |
Expand All @@ -263,10 +272,17 @@ The mandatory and optional parameters for each category are tabulated below.

##### 5. Variant calling - Structural variants

| Mandatory | Optional |
| --------- | ---------- |
| | target_bed |
| | bwa |
| Mandatory | Optional |
| --------- | --------------------------------- |
| | target_bed |
| | bwa |
| | manta_call_regions<sup>1</sup> |
| | sv_size_threshold<sup>2</sup> |
| | filter_sv_to_manta<sup>3</sup> |

<sup>1</sup> BED.gz file (with `.tbi` index) restricting Manta SV calling to specific regions. Useful for WES, targeted panels, or to exclude decoy and unplaced sequences.<br />
<sup>2</sup> Filter Manta SVs larger than this value (in bp) before SVDB merge. For example, `--sv_size_threshold 1000000` removes SVs larger than 1 Mb. Default is `null` (no filter).<br />
<sup>3</sup> Set to `true` to include only Manta variants in the SVDB merge step, excluding TIDDIT. Default is `false`.<br />

##### 6. Copy number variant calling

Expand Down Expand Up @@ -317,17 +333,19 @@ We use CADD only to annotate small indels. To annotate SNVs with precomputed CAD

##### 8. SV annotation & Ranking

| Mandatory | Optional |
| ---------------------------------------------- | --------------------------------- |
| genome | reduced_penetrance |
| svdb_query_dbs/svdb_query_bedpedbs<sup>1</sup> | |
| vep_cache_version | vep_filters/vep_filters_scout_fmt |
| vep_cache | vep_plugin_files |
| score_config_sv | |
| variant_consequences_sv<sup>2</sup> | |

<sup>1</sup> A CSV file that describes the databases (VCFs or BEDPEs) used by SVDB for annotating structural variants. Sample file [here](https://github.com/nf-core/test-datasets/blob/raredisease/reference/svdb_querydb_files.csv). Information about the column headers can be found [here](https://github.com/J35P312/SVDB#Query).
<sup>2</sup> File containing list of SO terms listed in the order of severity from most severe to lease severe for annotating genomic 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://grch37.ensembl.org/info/genome/variation/prediction/predicted_data.html).
| Mandatory | Optional |
| ---------------------------------------------- | ------------------------------------- |
| genome | reduced_penetrance |
| svdb_query_dbs/svdb_query_bedpedbs<sup>1</sup> | vep_filters/vep_filters_scout_fmt |
| vep_cache_version | vep_plugin_files |
| vep_cache | sv_freq_filter_expression<sup>3</sup> |
| score_config_sv | skip_vep_sv<sup>4</sup> |
| variant_consequences_sv<sup>2</sup> | |

<sup>1</sup> A CSV file that describes the databases (VCFs or BEDPEs) used by SVDB for annotating structural variants. Sample file [here](https://github.com/nf-core/test-datasets/blob/raredisease/reference/svdb_querydb_files.csv). Information about the column headers can be found [here](https://github.com/J35P312/SVDB#Query).<br />
<sup>2</sup> File containing list of SO terms listed in the order of severity from most severe to lease severe for annotating genomic 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://grch37.ensembl.org/info/genome/variation/prediction/predicted_data.html).<br />
<sup>3</sup> A bcftools `-e` expression to filter SVs by population frequency after SVDB query, e.g. `'INFO/SWEFRQ >= 0.02'`. Supports any INFO field and multiple conditions. Default is `null` (no filter).<br />
<sup>4</sup> Set to `true` to skip VEP annotation of structural variants. SVDB query and frequency filtering still run. Default is `false`.<br />

##### 9. Mitochondrial annotation

Expand Down
4 changes: 2 additions & 2 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,15 @@ workflow NFCORE_RAREDISEASE {
//
if (skip_germlinecnvcaller) {
if (val_analysis_type.equals("wgs")) {
ch_svcaller_priority = channel.value(["tiddit", "manta", "cnvnator"])
ch_svcaller_priority = channel.value(["tiddit", "manta"])
} else {
ch_svcaller_priority = channel.value([])
}
} else {
if (val_analysis_type.equals("wgs")) {
ch_svcaller_priority = channel.value(["tiddit", "manta", "gcnvcaller", "cnvnator"])
} else {
ch_svcaller_priority = channel.value(["manta", "gcnvcaller"])
ch_svcaller_priority = channel.value(["manta", "gcnvcaller", "cnvnator"])
}
}

Expand Down
4 changes: 2 additions & 2 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -572,12 +572,12 @@
},
"utils_nfcore_pipeline": {
"branch": "master",
"git_sha": "271e7fc14eb1320364416d996fb077421f3faed2",
"git_sha": "a3fb7351b1fdb2b1de282b765816bbea190e86a8",
"installed_by": ["subworkflows"]
},
"utils_nfschema_plugin": {
"branch": "master",
"git_sha": "4b406a74dc0449c0401ed87d5bfff4252fd277fd",
"git_sha": "fdc08b8b1ae74f56686ce21f7ea11ad11990ce57",
"installed_by": ["subworkflows"]
},
"vcf_filter_bcftools_ensemblvep": {
Expand Down
Loading
Loading