Skip to content

Commit

Permalink
Add BEDPE output (#112)
Browse files Browse the repository at this point in the history
* add bedpe output

* add tests for bedpe output

* pre-commit

* fix family merge tests
  • Loading branch information
nvnieuwk authored Feb 21, 2025
1 parent 7492949 commit 81d4118
Show file tree
Hide file tree
Showing 16 changed files with 482 additions and 18 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
- "pipeline_repeats"
- "pipeline_duplicates"
- "pipeline_families"
- "pipeline_bedpe"
- "bam_cnv_calling"
- "bam_prepare_samtools"
- "bam_repeat_estimation_expansionhunter"
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### `Added`

1. Added the samplesheet to the pipeline output as `OUTDIR/samplesheet.csv`
2. Added parallelization on SV type to the delly flow
2. Added the `--bedpe` parameter. This makes the pipeline output BEDPE files alongside the VCF files.
3. Added parallelization on SV type to the delly flow

### `Changes`

Expand Down
22 changes: 15 additions & 7 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ workflow {
// booleans
params.annotate,
params.concat_output,
params.bedpe,

// values
params.callers,
Expand All @@ -127,13 +128,14 @@ workflow {
)

publish:
STRUCTURAL.out.caller_vcfs >> 'caller_vcfs'
STRUCTURAL.out.sample_vcfs >> 'sample_vcfs'
STRUCTURAL.out.family_vcfs >> 'family_vcfs'
STRUCTURAL.out.qdnaseq_out >> 'qdnaseq_out'
STRUCTURAL.out.wisecondorx_out >> 'wisecondorx_out'
STRUCTURAL.out.multiqc_report >> 'multiqc'
STRUCTURAL.out.multiqc_data >> 'multiqc_data'
STRUCTURAL.out.caller_vcfs >> 'caller_vcfs'
STRUCTURAL.out.sample_vcfs >> 'sample_vcfs'
STRUCTURAL.out.family_vcfs >> 'family_vcfs'
STRUCTURAL.out.qdnaseq_out >> 'qdnaseq_out'
STRUCTURAL.out.wisecondorx_out >> 'wisecondorx_out'
STRUCTURAL.out.bedpe >> 'bedpe'
STRUCTURAL.out.multiqc_report >> 'multiqc'
STRUCTURAL.out.multiqc_data >> 'multiqc_data'

}

Expand Down Expand Up @@ -183,6 +185,12 @@ output {
return "${meta.id}/${new_name}"
} }
}
'bedpe' {
path { meta, _bedpe -> { file ->
def base = "${meta.id}/${meta.id}${meta.variant_type ? '.' + meta.variant_type : ''}"
return "${base}.bedpe"
} }
}
'multiqc' {
path { _report -> { _file -> "multiqc/multiqc_report.html"}}
}
Expand Down
5 changes: 5 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@
"git_sha": "f2fdc5e81efe36beff213752ce1a8e71fceeacba",
"installed_by": ["modules"]
},
"svtools/vcftobedpe": {
"branch": "master",
"git_sha": "5cf15e4c5ad6d06718b35e5ec1655c7c0a105880",
"installed_by": ["modules"]
},
"svync": {
"branch": "master",
"git_sha": "916a4cbc4f831d501860495b157c4857833e22a7",
Expand Down
7 changes: 7 additions & 0 deletions modules/nf-core/svtools/vcftobedpe/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions modules/nf-core/svtools/vcftobedpe/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions modules/nf-core/svtools/vcftobedpe/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions modules/nf-core/svtools/vcftobedpe/tests/main.nf.test

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 68 additions & 0 deletions modules/nf-core/svtools/vcftobedpe/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ params {
annotate = false
concat_output = false
annotations_filter = null
bedpe = false

// Delly parameters
delly_map_qual = 1
Expand Down
4 changes: 4 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@
"type": "string",
"description": "The filter arguments to use after annotating.",
"help_text": "A common use case for this is to filter out common variants. You can supply a VCF file with common variants to VCFanno and filter out the matching variants using this parameter"
},
"bedpe": {
"type": "boolean",
"description": "Output BEDPE files derived from the VCF files alongside the VCF files"
}
}
},
Expand Down
1 change: 0 additions & 1 deletion subworkflows/local/vcf_merge_family_jasmine/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ workflow VCF_MERGE_FAMILY_JASMINE {
def ch_versions = Channel.empty()

def ch_jasmine_input = ch_vcfs
.filter { meta, _vcf, _tbi -> meta.family_count > 1 }
.map { meta, vcf, tbi ->
def new_meta = meta - meta.subMap("sample", "sex") + ["id":meta.variant_type ? "${meta.family}.${meta.variant_type}" : meta.family]
[ groupKey(new_meta, meta.family_count), vcf, tbi ]
Expand Down
Loading

0 comments on commit 81d4118

Please sign in to comment.