-
Notifications
You must be signed in to change notification settings - Fork 743
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new module survivor/merge * fix versions * review updates * add stubs * fix tests * changed conda according to #2654 * moved the args to input vals * update meta * update to latest decision * fix test * Update modules/nf-core/survivor/merge/main.nf Co-authored-by: Jonathan Manning <[email protected]> --------- Co-authored-by: Jonathan Manning <[email protected]>
- Loading branch information
Showing
6 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
process SURVIVOR_MERGE { | ||
tag "$meta.id" | ||
label 'process_low' | ||
|
||
conda "bioconda::survivor=1.0.7" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/survivor:1.0.7--h9a82719_1': | ||
'quay.io/biocontainers/survivor:1.0.7--h9a82719_1' }" | ||
|
||
input: | ||
tuple val(meta), path(vcfs) | ||
val(max_distance_breakpoints) | ||
val(min_supporting_callers) | ||
val(account_for_type) | ||
val(account_for_sv_strands) | ||
val(estimate_distanced_by_sv_size) | ||
val(min_sv_size) | ||
|
||
output: | ||
tuple val(meta), path("*.vcf") , emit: vcf | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
|
||
vcfs.each{ | ||
if (it.getExtension() == "gz"){ | ||
error "Gzipped files are not supported by Survivor, please gunzip your VCF files first." | ||
// https://github.com/fritzsedlazeck/SURVIVOR/issues/158 | ||
} | ||
} | ||
|
||
""" | ||
SURVIVOR merge \\ | ||
<(ls *.vcf) \\ | ||
${max_distance_breakpoints} \\ | ||
${min_supporting_callers} \\ | ||
${account_for_type} \\ | ||
${account_for_sv_strands} \\ | ||
${estimate_distanced_by_sv_size} \\ | ||
${min_sv_size} \\ | ||
${prefix}.vcf | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
survivor: \$(echo \$(SURVIVOR 2>&1 | grep "Version" | sed 's/^Version: //')) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
|
||
vcfs.each{ | ||
if (it.getExtension() == "gz"){ | ||
error "Gzipped files are not supported by Survivor, please gunzip your VCF files first." | ||
// https://github.com/fritzsedlazeck/SURVIVOR/issues/158 | ||
} | ||
} | ||
|
||
""" | ||
touch ${prefix}.vcf | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
survivor: \$(echo \$(SURVIVOR 2>&1 | grep "Version" | sed 's/^Version: //')) | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: "survivor_merge" | ||
description: Compare or merge VCF files to generate a consensus or multi sample VCF files. | ||
keywords: | ||
- survivor | ||
- merge | ||
- vcf | ||
- structural variants | ||
tools: | ||
- "survivor": | ||
description: "Toolset for SV simulation, comparison and filtering" | ||
homepage: "https://github.com/fritzsedlazeck/SURVIVOR/wiki" | ||
documentation: "https://github.com/fritzsedlazeck/SURVIVOR/wiki" | ||
tool_dev_url: "https://github.com/fritzsedlazeck/SURVIVOR" | ||
doi: "10.1038/NCOMMS14061" | ||
licence: "['MIT']" | ||
|
||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- vcfs: | ||
type: files | ||
description: | | ||
The VCF files to be merged | ||
Gzipped VCF files are not supported: https://github.com/fritzsedlazeck/SURVIVOR/issues/158 | ||
pattern: "*.vcf" | ||
- max_distance_breakpoints: | ||
type: integer | ||
description: Max distance between breakpoints (0-1 percent of length, 1- number of bp) | ||
- min_supporting_callers: | ||
type: integer | ||
description: Minimum number of supporting caller | ||
- account_for_type: | ||
type: integer | ||
description: Take the type into account (1==yes, else no) | ||
- account_for_sv_strands: | ||
type: integer | ||
description: Take the strands of SVs into account (1==yes, else no) | ||
- estimate_distanced_by_sv_size: | ||
type: integer | ||
description: Estimate distance based on the size of SV (1==yes, else no) | ||
- min_sv_size: | ||
type: integer | ||
description: Minimum size of SVs to be taken into account | ||
|
||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
- vcf: | ||
type: file | ||
description: The merged VCF file | ||
pattern: "*.vcf" | ||
|
||
authors: | ||
- "@nvnieuwk" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env nextflow | ||
|
||
nextflow.enable.dsl = 2 | ||
|
||
include { SURVIVOR_MERGE } from '../../../../../modules/nf-core/survivor/merge/main.nf' | ||
|
||
workflow test_survivor_merge { | ||
|
||
input = [ | ||
[ id:'test', single_end:false ], // meta map | ||
[ | ||
file(params.test_data['homo_sapiens']['illumina']['test2_genome_vcf'], checkIfExists: true), | ||
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf'], checkIfExists: true) | ||
] | ||
] | ||
|
||
SURVIVOR_MERGE ( | ||
input, | ||
0.2, | ||
1, | ||
0, | ||
0, | ||
0, | ||
20 | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
process { | ||
|
||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
- name: survivor merge test_survivor_merge | ||
command: nextflow run ./tests/modules/nf-core/survivor/merge -entry test_survivor_merge -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/survivor/merge/nextflow.config | ||
tags: | ||
- survivor | ||
- survivor/merge | ||
files: | ||
- path: output/survivor/test.vcf | ||
contains: | ||
- "##fileformat=VCFv4.1" | ||
- "##source=SURVIVOR" | ||
- path: output/survivor/versions.yml |