Skip to content

Commit

Permalink
Merge pull request #90 from CenterForMedicalGeneticsGhent/dev
Browse files Browse the repository at this point in the history
Release 1.1.2
  • Loading branch information
nvnieuwk authored Mar 21, 2023
2 parents e35611e + d826b24 commit 2e108b0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v1.1.2 - Groovy Ghent - [Mar 21 2023]

### New features

1. Added a parameter for setting the splitting depth threshold `--split_threshold FLOAT`

### Changes

1. Change the default splitting threshold to 0.2 instead of 0.3

## v1.1.1 - Golden Ghent - [Mar 20 2023]

### Changes
Expand Down
7 changes: 4 additions & 3 deletions modules/local/split_beds/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ process SPLIT_BEDS {

input:
tuple val(meta), path(bed), val(sample_count)
val(single_threshold)

output:
tuple val(meta), path("*.bed") , emit: beds
Expand All @@ -19,15 +20,15 @@ process SPLIT_BEDS {

script:
def prefix = task.ext.prefix ?: meta.id
def threshold = sample_count * 0.3
def threshold = sample_count * single_threshold
// This module will split a BED file created with goleft/indexsplit into
// multiple BED files. All regions that have a scaled data size lower than 0.3 * amount of samples
// multiple BED files. All regions that have a scaled data size lower than single_threshold * amount of samples
// will be merged into one BED file. All regions that have a higher scaled data size
// will be put into their own BED file. Also all regions with no reads are removed.
"""
awk -vFS="\t" '{
if (\$0 ~ /^[^#].*\$/ && \$5 >= 1) {
if (\$4 >= ${threshold}) {
if (\$4 > ${threshold}) {
print \$0 > sprintf("${prefix}_%s_%s_%s.bed", \$1, \$2, \$3)
} else {
print \$0 > "${prefix}_others.bed"
Expand Down
4 changes: 2 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ params {

// Pipeline specific parameters
scatter_count = 40
// bed_merge_distance = 3000000
split_threshold = 0.2
filter = false
annotate = false
gemini = false
Expand Down Expand Up @@ -244,7 +244,7 @@ manifest {
description = 'A nextflow pipeline for calling and annotating variants'
mainScript = 'main.nf'
nextflowVersion = '!>=22.10.5'
version = '1.1.1'
version = '1.1.2'
}

// Load modules.config for DSL2 module specific options
Expand Down
5 changes: 5 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@
"default": 40,
"description": "The amount of scattering that should happen per sample. Increase this number to increase the pipeline run speed, but at the tradeoff of using more IO and disk space. The actual scatter value can differ a bit (usually not a bigger difference than 1) when using alt contigs in the reference."
},
"split_threshold": {
"type": "number",
"default": 0.2,
"description": "The exclusive threshold to use when defining whether a region has very low depth. This value is used to concatenate all small, low depth regions for WGS"
},
"species": {
"type": "string",
"default": "homo_sapiens",
Expand Down
3 changes: 2 additions & 1 deletion subworkflows/local/germline_variant_calling.nf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ workflow GERMLINE_VARIANT_CALLING {
//

SPLIT_BEDS(
beds.map { it + [1] }
beds.map { it + [1] },
params.split_threshold.toFloat()
)
ch_versions = ch_versions.mix(SPLIT_BEDS.out.versions.first())

Expand Down
3 changes: 2 additions & 1 deletion subworkflows/local/joint_genotyping.nf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ workflow JOINT_GENOTYPING {
}
}
[ meta, bed, meta.family_count ]
}
},
params.split_threshold.toFloat()
)
ch_versions = ch_versions.mix(SPLIT_BEDS.out.versions.first())

Expand Down

0 comments on commit 2e108b0

Please sign in to comment.