mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
view
This commit is contained in:
parent
829c15c98b
commit
3efa931bf6
2 changed files with 103 additions and 0 deletions
59
modules/cnvpytor/view/main.nf
Normal file
59
modules/cnvpytor/view/main.nf
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
process CNVPYTOR_VIEW {
|
||||||
|
tag "$meta.id"
|
||||||
|
label 'process_medium'
|
||||||
|
|
||||||
|
conda (params.enable_conda ? "bioconda::cnvpytor=1.2.1" : null)
|
||||||
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||||
|
'https://depot.galaxyproject.org/singularity/cnvpytor:1.2.1--pyhdfd78af_0':
|
||||||
|
'quay.io/biocontainers/cnvpytor:1.2.1--pyhdfd78af_0' }"
|
||||||
|
|
||||||
|
input:
|
||||||
|
tuple val(meta), path(pytor)
|
||||||
|
val bin_sizes
|
||||||
|
val output_format
|
||||||
|
|
||||||
|
output:
|
||||||
|
tuple val(meta), path("*.vcf"), emit: vcf , optional: true
|
||||||
|
tuple val(meta), path("*.tsv"), emit: tsv , optional: true
|
||||||
|
tuple val(meta), path("*.xls"), emit: xls , optional: true
|
||||||
|
path "versions.yml" , emit: versions
|
||||||
|
|
||||||
|
when:
|
||||||
|
task.ext.when == null || task.ext.when
|
||||||
|
|
||||||
|
script:
|
||||||
|
def output_suffix = output_format ?: 'vcf'
|
||||||
|
"""
|
||||||
|
|
||||||
|
python3 <<CODE
|
||||||
|
import cnvpytor,os
|
||||||
|
from pathlib import Path
|
||||||
|
pytor_files = Path.cwd().glob("*.pytor")
|
||||||
|
binsizes = "${bin_sizes}".split(" ")
|
||||||
|
for pytor_file in pytor_files:
|
||||||
|
for binsize in binsizes:
|
||||||
|
file_list = [str(pytor_file)]
|
||||||
|
app = cnvpytor.Viewer(file_list, params={} )
|
||||||
|
outputfile = "{}_{}.{}".format(pytor_file.stem,binsize.strip(),"${output_suffix}")
|
||||||
|
app.print_filename = outputfile
|
||||||
|
app.bin_size = int(binsize)
|
||||||
|
app.print_calls_file()
|
||||||
|
CODE
|
||||||
|
|
||||||
|
cat <<-END_VERSIONS > versions.yml
|
||||||
|
"${task.process}":
|
||||||
|
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' ))
|
||||||
|
END_VERSIONS
|
||||||
|
"""
|
||||||
|
|
||||||
|
stub:
|
||||||
|
def output_suffix = output_format ?: 'vcf'
|
||||||
|
"""
|
||||||
|
touch ${pytor.baseName}.${output_suffix}
|
||||||
|
|
||||||
|
cat <<-END_VERSIONS > versions.yml
|
||||||
|
"${task.process}":
|
||||||
|
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' ))
|
||||||
|
END_VERSIONS
|
||||||
|
"""
|
||||||
|
}
|
44
modules/cnvpytor/view/meta.yml
Normal file
44
modules/cnvpytor/view/meta.yml
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
name: cnvpytor_view
|
||||||
|
description: view function to generate vcfs
|
||||||
|
keywords:
|
||||||
|
- cnv calling
|
||||||
|
tools:
|
||||||
|
- cnvpytor:
|
||||||
|
description: calling CNVs using read depth
|
||||||
|
homepage: https://github.com/abyzovlab/CNVpytor
|
||||||
|
documentation: https://github.com/abyzovlab/CNVpytor
|
||||||
|
tool_dev_url: https://github.com/abyzovlab/CNVpytor
|
||||||
|
doi: "10.1101/2021.01.27.428472v1"
|
||||||
|
licence: ["MIT"]
|
||||||
|
|
||||||
|
input:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test' ]
|
||||||
|
- pytor:
|
||||||
|
type: file
|
||||||
|
description: pytor file containing read depth data
|
||||||
|
pattern: "*.{pytor}"
|
||||||
|
- bin_sizes:
|
||||||
|
type: string
|
||||||
|
description: list of binsizes separated by space e.g. "1000 10000" and "1000"
|
||||||
|
|
||||||
|
output:
|
||||||
|
- meta:
|
||||||
|
type: map
|
||||||
|
description: |
|
||||||
|
Groovy Map containing sample information
|
||||||
|
e.g. [ id:'test' ]
|
||||||
|
- partitions:
|
||||||
|
type: file
|
||||||
|
description: pytor file containing partitions of read depth histograms using mean-shift method
|
||||||
|
pattern: "*.{pytor}"
|
||||||
|
- versions:
|
||||||
|
type: file
|
||||||
|
description: File containing software versions
|
||||||
|
pattern: "versions.yml"
|
||||||
|
|
||||||
|
authors:
|
||||||
|
- "@sima-r"
|
Loading…
Reference in a new issue