Merge branch 'master' into motus_profile

This commit is contained in:
JIANHONG OU 2022-05-05 13:41:54 -04:00 committed by GitHub
commit b8efa2ae7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 241 additions and 49 deletions

View file

@ -2,43 +2,43 @@ process CNVPYTOR_CALLCNVS {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::cnvpytor=1.0" : null)
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.0--py39h6a678da_2':
'quay.io/biocontainers/cnvpytor:1.0--py39h6a678da_2' }"
'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
output:
tuple val(meta), path("*.tsv"), emit: cnvs
path "versions.yml" , emit: versions
tuple val(meta), path("${pytor.baseName}.pytor") , emit: pytor
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: '1000'
def bins = bin_sizes ?: '1000'
def prefix = task.ext.prefix ?: "${meta.id}"
"""
cnvpytor \\
-root $pytor \\
-call $args > ${prefix}.tsv
-call $bin_sizes
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' ))
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' ))
END_VERSIONS
"""
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.tsv
touch ${pytor.baseName}.pytor
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' ))
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' ))
END_VERSIONS
"""
}

View file

@ -17,8 +17,11 @@ input:
e.g. [ id:'test']
- pytor:
type: file
description: cnvpytor root file
description: pytor file containing partitions of read depth histograms using mean-shift method
pattern: "*.{pytor}"
- bin_sizes:
type: string
description: list of binsizes separated by space e.g. "1000 10000" and "1000"
output:
- meta:
@ -26,10 +29,10 @@ output:
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- cnvs:
- pytor:
type: file
description: file containing identified copy numer variations
pattern: "*.{tsv}"
description: pytor files containing cnv calls
pattern: "*.{pytor}"
- versions:
type: file
description: File containing software versions

View file

@ -2,13 +2,15 @@ process CNVPYTOR_HISTOGRAM {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::cnvpytor=1.0" : null)
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.0--py39h6a678da_2':
'quay.io/biocontainers/cnvpytor:1.0--py39h6a678da_2' }"
'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
output:
tuple val(meta), path("${pytor.baseName}.pytor") , emit: pytor
@ -18,15 +20,15 @@ process CNVPYTOR_HISTOGRAM {
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: '1000'
def bins = bin_sizes ?: '1000'
"""
cnvpytor \\
-root $pytor \\
-his $args
-his $bins
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' ))
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' ))
END_VERSIONS
"""
@ -36,7 +38,7 @@ process CNVPYTOR_HISTOGRAM {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' ))
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' ))
END_VERSIONS
"""
}

View file

@ -22,6 +22,9 @@ input:
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:
@ -40,3 +43,4 @@ output:
authors:
- "@sima-r"
- "@ramprasadn"

View file

@ -2,10 +2,10 @@ process CNVPYTOR_IMPORTREADDEPTH {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::cnvpytor=1.0" : null)
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.0--py39h6a678da_2':
'quay.io/biocontainers/cnvpytor:1.0--py39h6a678da_2' }"
'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(input_file), path(index)
@ -32,7 +32,7 @@ process CNVPYTOR_IMPORTREADDEPTH {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' ))
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' ))
END_VERSIONS
"""
@ -43,7 +43,7 @@ process CNVPYTOR_IMPORTREADDEPTH {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' ))
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' ))
END_VERSIONS
"""
}

View file

@ -52,3 +52,4 @@ output:
authors:
- "@sima-r"
- "@ramprasadn"

View file

@ -2,13 +2,14 @@ process CNVPYTOR_PARTITION {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::cnvpytor=1.0" : null)
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.0--py39h6a678da_2':
'quay.io/biocontainers/cnvpytor:1.0--py39h6a678da_2' }"
'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
output:
tuple val(meta), path("${pytor.baseName}.pytor"), emit: pytor
@ -18,15 +19,15 @@ process CNVPYTOR_PARTITION {
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def bins = bin_sizes ?: '1000'
"""
cnvpytor \\
-root $pytor \\
-partition $args
-partition $bins
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' ))
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' ))
END_VERSIONS
"""
@ -36,7 +37,7 @@ process CNVPYTOR_PARTITION {
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' ))
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' ))
END_VERSIONS
"""
}

View file

@ -22,6 +22,9 @@ input:
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:
@ -40,3 +43,4 @@ output:
authors:
- "@sima-r"
- "@ramprasadn"

View file

@ -0,0 +1,58 @@
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'
def bins = bin_sizes ?: '1000'
"""
python3 <<CODE
import cnvpytor,os
from pathlib import Path
pytor_file = Path("$pytor")
binsizes = "${bins}".split(" ")
for binsize in binsizes:
app = cnvpytor.Viewer(["$pytor"], 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
"""
}

View file

@ -0,0 +1,56 @@
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_format:
type: string
description: output format of the cnv calls. Valid entries are "tsv", "vcf", and "xls"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- tsv:
type: file
description: tsv file containing cnv calls
pattern: "*.{tsv}"
- vcf:
type: file
description: vcf file containing cnv calls
pattern: "*.{vcf}"
- xls:
type: file
description: xls file containing cnv calls
pattern: "*.{xls}"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@sima-r"
- "@ramprasadn"

View file

@ -4,10 +4,8 @@
- cnvpytor
- cnvpytor/callcnvs
files:
- path: output/cnvpytor/test.tsv
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: output/cnvpytor/test.pytor
- path: output/cnvpytor/versions.yml
md5sum: 0bea08a253fcb2ff0ff79b99df77b9fa
- name: cnvpytor callcnvs test_cnvpytor_callcnvs stub
command: nextflow run tests/modules/cnvpytor/callcnvs -entry test_cnvpytor_callcnvs -c tests/config/nextflow.config -stub-run
@ -15,6 +13,5 @@
- cnvpytor
- cnvpytor/callcnvs
files:
- path: output/cnvpytor/test.tsv
- path: output/cnvpytor/test.pytor
- path: output/cnvpytor/versions.yml
md5sum: 0bea08a253fcb2ff0ff79b99df77b9fa

View file

@ -5,9 +5,7 @@
- cnvpytor/histogram
files:
- path: output/cnvpytor/test.pytor
md5sum: aa03a8fa15b39f77816705a48e10312a
- path: output/cnvpytor/versions.yml
md5sum: 0f4d75c4f3a3eb26c22616d12b0b78b2
- name: cnvpytor histogram test_cnvpytor_histogram stub
command: nextflow run tests/modules/cnvpytor/histogram -entry test_cnvpytor_histogram -c tests/config/nextflow.config -stub-run
@ -17,4 +15,3 @@
files:
- path: output/cnvpytor/test.pytor
- path: output/cnvpytor/versions.yml
md5sum: 0f4d75c4f3a3eb26c22616d12b0b78b2

View file

@ -6,7 +6,6 @@
files:
- path: output/cnvpytor/test.pytor
- path: output/cnvpytor/versions.yml
md5sum: 5834495324c08a37f3fd73ccdd881dc8
- name: cnvpytor importreaddepth test_cnvpytor_importreaddepth stub
command: nextflow run tests/modules/cnvpytor/importreaddepth -entry test_cnvpytor_importreaddepth -c tests/config/nextflow.config -stub-run
@ -16,7 +15,6 @@
files:
- path: output/cnvpytor/test.pytor
- path: output/cnvpytor/versions.yml
md5sum: 5834495324c08a37f3fd73ccdd881dc8
- name: cnvpytor importreaddepth test_cnvpytor_importreaddepth_cram
command: nextflow run tests/modules/cnvpytor/importreaddepth -entry test_cnvpytor_importreaddepth_cram -c tests/config/nextflow.config
@ -26,7 +24,6 @@
files:
- path: output/cnvpytor/test.pytor
- path: output/cnvpytor/versions.yml
md5sum: dfa0afb0982d985b96d1633f71ebb82a
- name: cnvpytor importreaddepth test_cnvpytor_importreaddepth_cram stub
command: nextflow run tests/modules/cnvpytor/importreaddepth -entry test_cnvpytor_importreaddepth_cram -c tests/config/nextflow.config -stub-run
@ -36,4 +33,3 @@
files:
- path: output/cnvpytor/test.pytor
- path: output/cnvpytor/versions.yml
md5sum: dfa0afb0982d985b96d1633f71ebb82a

View file

@ -5,9 +5,7 @@
- cnvpytor/partition
files:
- path: output/cnvpytor/test.pytor
md5sum: aa03a8fa15b39f77816705a48e10312a
- path: output/cnvpytor/versions.yml
md5sum: 7fd6ec952a316463bcd324f176b46b64
- name: cnvpytor partition test_cnvpytor_partition stub
command: nextflow run tests/modules/cnvpytor/partition -entry test_cnvpytor_partition -c tests/config/nextflow.config -stub-run
@ -17,4 +15,3 @@
files:
- path: output/cnvpytor/test.pytor
- path: output/cnvpytor/versions.yml
md5sum: 7fd6ec952a316463bcd324f176b46b64

View file

@ -0,0 +1,42 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { CNVPYTOR_VIEW } from '../../../../modules/cnvpytor/view/main.nf'
workflow test_cnvpytor_view {
input = [
[ id:'test'], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_pytor'], checkIfExists: true)
]
bin_sizes = "10000 100000"
CNVPYTOR_VIEW ( input, bin_sizes, [] )
}
workflow test_cnvpytor_view_tsvout {
input = [
[ id:'test'], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_pytor'], checkIfExists: true)
]
output_suffix = "tsv"
CNVPYTOR_VIEW ( input, [], output_suffix )
}
workflow test_cnvpytor_view_stub {
input = [
[ id:'test'], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_pytor'], checkIfExists: true)
]
bin_sizes = []
output_suffix = []
CNVPYTOR_VIEW ( input, bin_sizes, output_suffix )
}

View file

@ -0,0 +1,7 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName: CNVPYTOR_VIEW {
ext.args = '10000 100000'
}
}

View file

@ -0,0 +1,27 @@
- name: cnvpytor view test_cnvpytor_view
command: nextflow run tests/modules/cnvpytor/view -entry test_cnvpytor_view -c tests/config/nextflow.config
tags:
- cnvpytor
- cnvpytor/view
files:
- path: output/cnvpytor/test_10000.vcf
- path: output/cnvpytor/test_100000.vcf
- path: output/cnvpytor/versions.yml
- name: cnvpytor view test_cnvpytor_view tsv
command: nextflow run tests/modules/cnvpytor/view -entry test_cnvpytor_view_tsvout -c tests/config/nextflow.config
tags:
- cnvpytor
- cnvpytor/view
files:
- path: output/cnvpytor/test_1000.tsv
- path: output/cnvpytor/versions.yml
- name: cnvpytor view test_cnvpytor_view stub
command: nextflow run tests/modules/cnvpytor/view -entry test_cnvpytor_view_stub -c tests/config/nextflow.config -stub-run
tags:
- cnvpytor
- cnvpytor/view
files:
- path: output/cnvpytor/test.vcf
- path: output/cnvpytor/versions.yml