Skip to content

Commit

Permalink
Merge pull request #88 from CenterForMedicalGeneticsGhent/dev
Browse files Browse the repository at this point in the history
Release v1.1.1
  • Loading branch information
nvnieuwk authored Mar 20, 2023
2 parents 20d4fda + fce0930 commit e35611e
Show file tree
Hide file tree
Showing 19 changed files with 457 additions and 493 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
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.1 - Golden Ghent - [Mar 20 2023]

### Changes

1. Set the default of `--validate` to `false`

### Bug fixes

1. Fixed a bug with ensembl VEP. Filenames of the alt contigs should now have a `_alt` suffix instead of all alt contigs.
2. Added file-exist check to the `sdf` file
3. Fixed the scattering when using alt contigs

## v1.1.0 - Glorious Ghent - [Mar 14 2023]

### New Features
Expand Down
12 changes: 4 additions & 8 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ process {
// ext.args = "-d ${params.bed_merge_distance}"
// }

withName: GOLEFT_INDEXSPLIT {
withName: "^.*:PREPROCESSING:GOLEFT_INDEXSPLIT\$" {
publishDir = [
overwrite: true,
enabled: true,
Expand All @@ -58,8 +58,7 @@ process {
'-ERC GVCF -contamination "0"',
'-GQB 10 -GQB 20 -GQB 30 -GQB 40 -GQB 50 -GQB 60 -GQB 70 -GQB 80 -GQB 90',
'-G StandardAnnotation -G StandardHCAnnotation -G AS_StandardAnnotation',
'--dragen-mode',
"--intervals ${meta.region}"
'--dragen-mode'
].join(" ")
}
}
Expand Down Expand Up @@ -134,9 +133,7 @@ process {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

withName: "^.*JOINT_GENOTYPING:BEDTOOLS_MAKEWINDOWS\$" {
ext.prefix = { "${meta.id}.windows" }
ext.args = "-n ${params.scatter_count}"
withName: "^.*:JOINT_GENOTYPING:GOLEFT_INDEXSPLIT\$" {
publishDir = [
enabled: true,
overwrite: true,
Expand Down Expand Up @@ -165,7 +162,6 @@ process {
"--allow-old-rms-mapping-quality-annotation-data",
"-G StandardAnnotation -G AS_StandardAnnotation",
"-AX ExcessHet -AX InbreedingCoeff",
"--intervals ${meta.region}",
"--interval-padding 20"
].join(" ")
}
Expand Down Expand Up @@ -287,7 +283,7 @@ process {
// maxRetries = 3
// container = {params.vep_cache ? "quay.io/biocontainers/ensembl-vep:${params.vep_version}--pl5321h4a94de4_${task.attempt - 1}" : "nfcore/vep:${params.vep_version}.${params.genome}"}
container = "nfcore/vep:${params.vep_version}.${params.genome}"
ext.prefix = {"${meta.id}_${meta.regions}"}
ext.prefix = {"${meta.id}_${meta.regions.contains(",") ? "alt" : meta.regions }"}
ext.args = {[
// select the chromosomes to run on
"--chr ${meta.regions}",
Expand Down
Binary file modified docs/images/nf-cmgg-germline_metro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
631 changes: 321 additions & 310 deletions docs/images/nf-cmgg-germline_metro.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 0 additions & 5 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@
"installed_by": ["modules"],
"patch": "modules/nf-core/bedtools/intersect/bedtools-intersect.diff"
},
"bedtools/makewindows": {
"branch": "master",
"git_sha": "007c99a9726dfd89198e788162db594cd29d426f",
"installed_by": ["modules"]
},
"bedtools/merge": {
"branch": "master",
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
Expand Down
44 changes: 44 additions & 0 deletions modules/local/split_beds/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
process SPLIT_BEDS {
tag "$meta.id"
label 'process_single'

conda "anaconda::gawk=5.1.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/gawk:5.1.0' :
'quay.io/biocontainers/gawk:5.1.0' }"

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

output:
tuple val(meta), path("*.bed") , emit: beds
path('versions.yml') , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def prefix = task.ext.prefix ?: meta.id
def threshold = sample_count * 0.3
// 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
// 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}) {
print \$0 > sprintf("${prefix}_%s_%s_%s.bed", \$1, \$2, \$3)
} else {
print \$0 > "${prefix}_others.bed"
}
}
}' ${bed}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gawk: \$(awk -Wversion | sed '1!d; s/.*Awk //; s/,.*//')
END_VERSIONS
"""

//No stub because this process is so small (would be harder to stub than to just let it run)
}
49 changes: 0 additions & 49 deletions modules/nf-core/bedtools/makewindows/main.nf

This file was deleted.

41 changes: 0 additions & 41 deletions modules/nf-core/bedtools/makewindows/meta.yml

This file was deleted.

4 changes: 2 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ params {
annotate = false
gemini = false
add_ped = false
validate = true
validate = false
roi = null

// Module specific parameters
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.0'
version = '1.1.1'
}

// Load modules.config for DSL2 module specific options
Expand Down
8 changes: 5 additions & 3 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@
"hidden": true,
"help_text": "Do not load `igenomes.config` when running the pipeline. You may choose this option if you observe clashes between custom parameters and those supplied in `igenomes.config`."
}
}
},
"required": ["fasta"]
},
"pipeline_specific_parameters": {
"title": "Pipeline specific parameters",
Expand All @@ -134,7 +135,7 @@
"scatter_count": {
"type": "integer",
"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"
"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."
},
"species": {
"type": "string",
Expand Down Expand Up @@ -180,7 +181,8 @@
"use_dragstr_model": {
"type": "boolean",
"description": "Whether or not the DRAGSTR models should be used",
"fa_icon": "fas fa-question-circle"
"fa_icon": "fas fa-question-circle",
"default": true
},
"dbsnp": {
"type": "string",
Expand Down
32 changes: 20 additions & 12 deletions subworkflows/local/germline_variant_calling.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//
// GERMLINE VARIANT CALLING
//
include { SPLIT_BEDS } from '../../modules/local/split_beds/main'

include { GATK4_HAPLOTYPECALLER as HAPLOTYPECALLER } from '../../modules/nf-core/gatk4/haplotypecaller/main'
include { GATK4_CALIBRATEDRAGSTRMODEL as CALIBRATEDRAGSTRMODEL } from '../../modules/nf-core/gatk4/calibratedragstrmodel/main'
Expand All @@ -26,6 +27,15 @@ workflow GERMLINE_VARIANT_CALLING {
ch_versions = Channel.empty()
ch_reports = Channel.empty()

//
// Split BED file into correct regions
//

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

//
// Generate DRAGSTR models
//
Expand All @@ -47,13 +57,13 @@ workflow GERMLINE_VARIANT_CALLING {
ch_versions = ch_versions.mix(CALIBRATEDRAGSTRMODEL.out.versions)

crams
.join(beds, failOnDuplicate: true, failOnMismatch: true)
.join(SPLIT_BEDS.out.beds, failOnDuplicate: true, failOnMismatch: true)
.join(CALIBRATEDRAGSTRMODEL.out.dragstr_model, failOnDuplicate: true, failOnMismatch: true)
.set { cram_models }
}
else {
crams
.join(beds, failOnDuplicate: true, failOnMismatch: true)
.join(SPLIT_BEDS.out.beds, failOnDuplicate: true, failOnMismatch: true)
.set { cram_models }
}

Expand All @@ -63,17 +73,16 @@ workflow GERMLINE_VARIANT_CALLING {

cram_models
.dump(tag:'cram_models', pretty:true)
.map { meta, cram, crai, bed, dragstr_model=[] ->
new_meta = meta + [region_count: bed.readLines().size()]
[ new_meta, cram, crai, bed, dragstr_model ]
.map { meta, cram, crai, beds, dragstr_model=[] ->
bed_is_list = beds instanceof ArrayList
new_meta = meta + [region_count: bed_is_list ? beds.size() : 1]
[ new_meta, cram, crai, bed_is_list ? beds : [beds], dragstr_model ]
}
.splitText(elem:3)
.transpose(by:3)
.map(
{ meta, cram, crai, region, dragstr_model ->
region_split = region[0..-2].split("\t")
region_string = "${region_split[0]}:${region_split[1] as int + 1}-${region_split[2]}"
new_meta = meta + [id:"${meta.id}_${region_string.replace(":","_").replace("-":"_")}", region:region_string]
[ new_meta, cram, crai, [], dragstr_model ]
{ meta, cram, crai, bed, dragstr_model ->
new_meta = meta + [id:bed.baseName]
[ new_meta, cram, crai, bed, dragstr_model ]
}
)
.dump(tag:'cram_intervals', pretty:true)
Expand Down Expand Up @@ -159,4 +168,3 @@ workflow GERMLINE_VARIANT_CALLING {
versions = ch_versions
reports = ch_reports
}

Loading

0 comments on commit e35611e

Please sign in to comment.