forked from nf-core/modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding vcf2cytosure * fixing test * updating meta
- Loading branch information
Showing
8 changed files
with
188 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,6 @@ | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- bioconda::vcf2cytosure=0.9.1 |
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,66 @@ | ||
process VCF2CYTOSURE { | ||
tag "$meta.id" | ||
label 'process_single' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/vcf2cytosure:0.9.1--pyh7cba7a3_1': | ||
'biocontainers/vcf2cytosure:0.9.1--pyh7cba7a3_1' }" | ||
|
||
input: | ||
tuple val(meta), path(sv_vcf) | ||
tuple val(meta2), path(coverage_bed) | ||
tuple val(meta3), path(cns) | ||
tuple val(meta4), path(snv_vcf) | ||
path blacklist_bed | ||
|
||
output: | ||
tuple val(meta), path("*.cgh"), emit: cgh | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def coverage = coverage_bed ? "--coverage ${coverage_bed}" : '' | ||
def cnvkit = cns ? ( coverage_bed ? '' : "--cn ${cns}" ) : '' | ||
def snv = snv_vcf ? ( coverage_bed ? '' : "--snv ${snv_vcf}" ) : '' | ||
def blacklist = blacklist_bed ? "--blacklist ${blacklist_bed}" : '' | ||
def prefix = task.ext.prefix ?: sv_vcf ? "${meta.id}" : "${meta3.id}" | ||
|
||
if ( cns && coverage_bed || snv_vcf && coverage_bed ) error "Coverage_bed input is not compatible with cns and snv" | ||
|
||
""" | ||
vcf2cytosure \\ | ||
--vcf $sv_vcf \\ | ||
--out ${prefix}.cgh \\ | ||
$coverage \\ | ||
$cnvkit \\ | ||
$snv \\ | ||
$blacklist \\ | ||
$args | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
vcf2cytosure: \$(echo \$(vcf2cytosure --version 2>&1) | sed 's/^.* cytosure //' ) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def coverage = coverage_bed ? "--coverage ${coverage_bed}" : '' | ||
def cnvkit = cns ? ( coverage_bed ? '' : "--cn ${cns}" ) : '' | ||
def snv = snv_vcf ? ( coverage_bed ? '' : "--snv ${snv_vcf}" ) : '' | ||
def blacklist = blacklist_bed ? "--blacklist ${blacklist_bed}" : '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
|
||
""" | ||
touch ${prefix}.xml | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
vcf2cytosure: \$(echo \$(vcf2cytosure --version 2>&1) | sed 's/^.* cytosure //' ) | ||
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,77 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json | ||
name: "vcf2cytosure" | ||
description: Convert VCF with structural variations to CytoSure format | ||
keywords: | ||
- structural_variants | ||
- array_cgh | ||
- vcf | ||
- cytosure | ||
tools: | ||
- "vcf2cytosure": | ||
description: "Convert VCF with structural variations to CytoSure format" | ||
homepage: "https://github.com/NBISweden/vcf2cytosure" | ||
documentation: "https://github.com/NBISweden/vcf2cytosure" | ||
tool_dev_url: "https://github.com/NBISweden/vcf2cytosure" | ||
licence: "['MIT']" | ||
|
||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'test', single_end:false ]` | ||
- meta2: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'test', single_end:false ]` | ||
- meta3: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'test', single_end:false ]` | ||
- meta4: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'test', single_end:false ]` | ||
- sv_vcf: | ||
type: file | ||
description: VCF file with structural variants | ||
pattern: "*.{vcf,vcf.gz}" | ||
- coverage_bed: | ||
type: file | ||
description: Bed file with coverage data | ||
pattern: "*.bed" | ||
- cns: | ||
type: file | ||
description: CN file from CNVkit, not compatible with coverage_bed file | ||
- snv_vcf: | ||
type: file | ||
description: | | ||
VCF file with SNVs to calculate probe coverage, | ||
not compatible with coverage_bed | ||
pattern: "*.{vcf,vcf.gz}" | ||
- blacklilst_bed: | ||
type: file | ||
description: Bed file with regions to exclude | ||
pattern: "*.bed" | ||
|
||
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" | ||
- cgh: | ||
type: file | ||
description: SV:s in CytoSure format | ||
pattern: "*.cgh" | ||
|
||
authors: | ||
- "@jemten" |
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
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,19 @@ | ||
#!/usr/bin/env nextflow | ||
|
||
nextflow.enable.dsl = 2 | ||
|
||
include { VCF2CYTOSURE } from '../../../../modules/nf-core/vcf2cytosure/main.nf' | ||
|
||
workflow test_vcf2cytosure { | ||
|
||
sv_vcf = [ | ||
[ id:'test' ], // meta map | ||
[ file(params.test_data['homo_sapiens']['illumina']['na24385_chr22_sv_vcf'], checkIfExists: true) ] | ||
] | ||
coverage = [ | ||
[ id:'test' ], // meta map | ||
[ file(params.test_data['homo_sapiens']['illumina']['na24385_chr22_coverage'], checkIfExists: true) ] | ||
] | ||
VCF2CYTOSURE ( sv_vcf, coverage, [[],[]], [[],[]], [] ) | ||
|
||
} |
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,8 @@ | ||
- name: vcf2cytosure test_vcf2cytosure | ||
command: nextflow run ./tests/modules/nf-core/vcf2cytosure -entry test_vcf2cytosure -c ./tests/config/nextflow.config | ||
tags: | ||
- vcf2cytosure | ||
files: | ||
- path: output/vcf2cytosure/test.cgh | ||
md5sum: fc3f1ffac5b797881d992994d5d56550 | ||
- path: output/vcf2cytosure/versions.yml |