add new module cnvkit/reference

This commit is contained in:
SusiJo 2022-05-23 18:35:50 +02:00
parent 51bd58809d
commit bbee9e3c3b
6 changed files with 117 additions and 0 deletions

View file

@ -0,0 +1,39 @@
process CNVKIT_REFERENCE {
tag "$reference"
label 'process_low'
conda (params.enable_conda ? "bioconda::cnvkit=0.9.9" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/cnvkit:0.9.9--pyhdfd78af_0':
'quay.io/biocontainers/cnvkit:0.9.9--pyhdfd78af_0' }"
input:
path fasta
path targets
path antitargets
output:
path("*.cnn") , emit: cnn
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
"""
cnvkit.py \\
reference \\
--fasta $fasta \\
--targets $targets \\
--antitargets $antitargets \\
--output reference.cnn \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvkit: \$(cnvkit.py version | sed -e "s/cnvkit v//g")
END_VERSIONS
"""
}

View file

@ -0,0 +1,47 @@
name: cnvkit_reference
description:
keywords:
- cnvkit
- reference
tools:
- cnvkit:
description: |
CNVkit is a Python library and command-line software toolkit to infer and visualize copy number from high-throughput DNA sequencing data.
It is designed for use with hybrid capture, including both whole-exome and custom target panels, and short-read sequencing platforms such as Illumina and Ion Torrent.
homepage: https://cnvkit.readthedocs.io/en/stable/index.html
documentation: https://cnvkit.readthedocs.io/en/stable/index.html
tool_dev_url: https://github.com/etal/cnvkit
doi: 10.1371/journal.pcbi.1004873
licence: ["Apache-2.0"]
input:
- fasta:
type: file
description: File containing reference genome
pattern: "*.{fasta}"
- targets:
type: file
description: File containing genomic regions
pattern: "*.{bed}"
- antitargets:
type: file
description: File containing off-target genomic regions
pattern: "*.{bed}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- reference:
type: file
description: File containing a copy-number reference (required for CNV calling in tumor_only mode)
pattern: "*.{cnn}"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@SusiJo"

View file

@ -451,6 +451,10 @@ cnvkit/batch:
- modules/cnvkit/batch/**
- tests/modules/cnvkit/batch/**
cnvkit/reference:
- modules/cnvkit/reference/**
- tests/modules/cnvkit/reference/**
controlfreec/assesssignificance:
- modules/controlfreec/assesssignificance/**
- tests/modules/controlfreec/assesssignificance/**

View file

@ -0,0 +1,14 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { CNVKIT_REFERENCE } from '../../../../modules/cnvkit/reference/main.nf'
workflow test_cnvkit_reference {
fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
targets = file(params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed'], checkIfExists: true)
antitargets = file("/Users/susanne/Documents/repos/forks/modules/test_antitarget/output/cnvkit/test.antitarget.bed", checkIfExists: true)
CNVKIT_REFERENCE ( fasta, targets, antitargets )
}

View file

@ -0,0 +1,5 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

View file

@ -0,0 +1,8 @@
- name: cnvkit reference test_cnvkit_reference
command: nextflow run ./tests/modules/cnvkit/reference -entry test_cnvkit_reference -c ./tests/config/nextflow.config -c ./tests/modules/cnvkit/reference/nextflow.config
tags:
- cnvkit/reference
- cnvkit
files:
- path: output/cnvkit/reference.cnn
md5sum: 7c4a7902f5ab101b1f9d6038d331b3d9