* Added cnvpytor/importreaddepth module

* Corrected process name in meta.yml file

* added -chrom argument

* space correction

* Added complementary info

* fixed typo

* md5sum added

* modified the module to work on cram files as well

* Added cnvpytor/histogram module and test files

* Added cnvpytor/partition module and test files

* added cnvpytor/callcnvs module and tests

* modified by new modules

* Added test file and fixed input path in modules

* added when block

* little fixes

* skip tracking test.yml

* removed changes to test if conflicts get resolved

* updated outfile name

* corrected the version.yml content
This commit is contained in:
Sima Rahimi 2022-03-15 10:20:46 +01:00 committed by GitHub
parent 50417f5f8c
commit 86ac223916
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 456 additions and 0 deletions

View file

@ -0,0 +1,33 @@
process CNVPYTOR_CALLCNVS {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::cnvpytor=1.0" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/cnvpytor:A1.0--py39h6a678da_2':
'quay.io/biocontainers/cnvpytor:1.0--py39h6a678da_2' }"
input:
tuple val(meta), path(pytor)
output:
tuple val(meta), path("*.tsv"), emit: cnvs
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: '1000'
def prefix = task.ext.prefix ?: "${meta.id}"
"""
cnvpytor \\
-root $pytor \\
-call $args > ${prefix}.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' ))
END_VERSIONS
"""
}

View file

@ -0,0 +1,40 @@
name: cnvpytor_callcnvs
description: command line tool for calling CNVs in whole genome sequencing data
- 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: cnvpytor root file
pattern: "*.{pytor}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- cnvs:
type: file
description: file containing identified copy numer variations
pattern: "*.{tsv}"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@sima-r"

View file

@ -0,0 +1,32 @@
process CNVPYTOR_HISTOGRAM {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::cnvpytor=1.0" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/cnvpytor:A1.0--py39h6a678da_2':
'quay.io/biocontainers/cnvpytor:1.0--py39h6a678da_2' }"
input:
tuple val(meta), path(pytor)
output:
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'
"""
cnvpytor \\
-root $pytor \\
-his $args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' ))
END_VERSIONS
"""
}

View file

@ -0,0 +1,42 @@
name: cnvpytor_histogram
description: calculates read depth histograms
keywords:
- cnv calling
- histogram
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}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- pytor:
type: file
description: pytor file containing read depth histograms binned based on given bin size(s)
pattern: "*.{pytor}"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@sima-r"

View file

@ -0,0 +1,38 @@
process CNVPYTOR_IMPORTREADDEPTH {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::cnvpytor=1.0" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/cnvpytor:A1.0--py39h6a678da_2':
'quay.io/biocontainers/cnvpytor:1.0--py39h6a678da_2' }"
input:
tuple val(meta), path(input_file), path(index)
path fasta
path fai
output:
tuple val(meta), path("*.pytor") , emit: pytor
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def reference = fasta ? "-T ${fasta}" : ''
"""
cnvpytor \\
-root ${prefix}.pytor \\
-rd $input_file \\
$args \\
$reference
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' ))
END_VERSIONS
"""
}

View file

@ -0,0 +1,55 @@
name: cnvpytor_importreaddepth
description: command line tool for CNV/CNA analysis. This step imports the read depth data into a root pytor file.
keywords:
- read depth
- cnv calling
tools:
- cnvpytor -rd:
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' ]
- input_file:
type: file
description: BAM/CRAM/SAM file
pattern: "*.{bam,cram}"
- index:
type: file
description: bam file index
pattern: "*.{bai,crai}"
- fasta:
type: file
description: specifies reference genome file (only for cram file without reference genome)
pattern: "*.{fasta,fasta.gz,fa,fa.gz}"
- fai:
type: file
description: Index of reference fasta file
pattern: "*.fai"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- pytor:
type: file
description: read depth root file in which read depth data binned to 100 base pair bins will be stored.
pattern: "*.{pytor}"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@sima-r"

View file

@ -0,0 +1,32 @@
process CNVPYTOR_PARTITION {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::cnvpytor=1.0" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/cnvpytor:A1.0--py39h6a678da_2':
'quay.io/biocontainers/cnvpytor:1.0--py39h6a678da_2' }"
input:
tuple val(meta), path(pytor)
output:
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'
"""
cnvpytor \\
-root $pytor \\
-partition $args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/^.*pyCNVnator //; s/Using.*\$//' ))
END_VERSIONS
"""
}

View file

@ -0,0 +1,42 @@
name: cnvpytor_partition
description: partitioning read depth histograms
keywords:
- cnv calling
- partition histograms
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}"
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"

View file

@ -295,6 +295,8 @@ params {
test_rnaseq_vcf = "${test_data_dir}/genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf" test_rnaseq_vcf = "${test_data_dir}/genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf"
test_sv_vcf = "${test_data_dir}/genomics/homo_sapiens/illumina/vcf/sv_query.vcf.gz" test_sv_vcf = "${test_data_dir}/genomics/homo_sapiens/illumina/vcf/sv_query.vcf.gz"
test_pytor = "${test_data_dir}/genomics/homo_sapiens/illumina/pytor/test.pytor"
} }
'pacbio' { 'pacbio' {
primers = "${test_data_dir}/genomics/homo_sapiens/pacbio/fasta/primers.fasta" primers = "${test_data_dir}/genomics/homo_sapiens/pacbio/fasta/primers.fasta"

View file

@ -0,0 +1,15 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { CNVPYTOR_CALLCNVS } from '../../../../modules/cnvpytor/callcnvs/main.nf'
workflow test_cnvpytor_callcnvs {
input = [
[ id:'test'], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_pytor'], checkIfExists: true)
]
CNVPYTOR_CALLCNVS ( input )
}

View file

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

View file

@ -0,0 +1,10 @@
- name: cnvpytor callcnvs test_cnvpytor_callcnvs
command: nextflow run tests/modules/cnvpytor/callcnvs -entry test_cnvpytor_callcnvs -c tests/config/nextflow.config
tags:
- cnvpytor
- cnvpytor/callcnvs
files:
- path: output/cnvpytor/calls.10000.tsv
md5sum: d41d8cd98f00b204e9800998ecf8427e
- path: output/cnvpytor/versions.yml
md5sum: 5fe6ca3ef5c40f9dbf487f28db237821

View file

@ -0,0 +1,15 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { CNVPYTOR_HISTOGRAM } from '../../../../modules/cnvpytor/histogram/main.nf'
workflow test_cnvpytor_histogram {
input = [
[ id:'test'], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_pytor'], checkIfExists: true),
]
CNVPYTOR_HISTOGRAM ( input )
}

View file

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

View file

@ -0,0 +1,10 @@
- name: cnvpytor histogram test_cnvpytor_histogram
command: nextflow run tests/modules/cnvpytor/histogram -entry test_cnvpytor_histogram -c tests/config/nextflow.config
tags:
- cnvpytor
- cnvpytor/histogram
files:
- path: output/cnvpytor/test.pytor
md5sum: aa03a8fa15b39f77816705a48e10312a
- path: output/cnvpytor/versions.yml
md5sum: 9a4b176afd5f1a3edeb37eeb301cf464

View file

@ -0,0 +1,32 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { CNVPYTOR_IMPORTREADDEPTH } from '../../../../modules/cnvpytor/importreaddepth/main.nf'
workflow test_cnvpytor_importreaddepth {
input = [
[ id: 'test' ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam_bai'], checkIfExists: true)
]
CNVPYTOR_IMPORTREADDEPTH (input, [], [])
}
workflow test_cnvpytor_importreaddepth_cram {
input = [
[ id: 'test' ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_cram_crai'], checkIfExists: true)
]
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
CNVPYTOR_IMPORTREADDEPTH (input, fasta, fai)
}

View file

@ -0,0 +1,12 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName: CNVPYTOR_IMPORTREADDEPTH {
ext.args = {params.cnvpytor_chr ? "-chrom ${params.cnvpytor_chr}" : '' }
}
}
params {
cnvpytor_chr = '' // specifies chromosome name(s) the same way as they are described in the sam/bam/cram header e.g. '1 2' or 'chr1 chr2'.
}

View file

@ -0,0 +1,15 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { CNVPYTOR_PARTITION } from '../../../../modules/cnvpytor/partition/main.nf'
workflow test_cnvpytor_partition {
input = [
[ id:'test'], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_pytor'], checkIfExists: true)
]
CNVPYTOR_PARTITION ( input )
}

View file

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

View file

@ -0,0 +1,10 @@
- name: cnvpytor partition test_cnvpytor_partition
command: nextflow run tests/modules/cnvpytor/partition -entry test_cnvpytor_partition -c tests/config/nextflow.config
tags:
- cnvpytor
- cnvpytor/partition
files:
- path: output/cnvpytor/test.pytor
md5sum: aa03a8fa15b39f77816705a48e10312a
- path: output/cnvpytor/versions.yml
md5sum: 8a04506554c58cd170cc050fd9904c6f