Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions modules/nf-core/hificnv/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::hificnv=1.0.1"
68 changes: 68 additions & 0 deletions modules/nf-core/hificnv/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
process HIFICNV {
tag "$meta.id"
label 'process_medium'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'oras://community.wave.seqera.io/library/hificnv:1.0.1--ba0f622849fdd2bf':
'community.wave.seqera.io/library/hificnv:1.0.1--b7e433ac6789e2d2' }"

input:
tuple val(meta), path(bam), path(bai), path(maf)
tuple val(meta2), path(ref)
tuple val(meta3), path(exclude)
tuple val(meta4), path(expected_cn)

output:
tuple val(meta), path("*.copynum.bedgraph"), emit: copynum
tuple val(meta), path("*.depth.bw"), emit: depth
tuple val(meta), path("*.maf.bw"), emit: maf, optional: true
tuple val(meta), path("*.vcf.gz"), emit: vcf
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}"

// handle optional inputs
def maf_arg = maf ? "--maf ${maf}" : ""
def exclude_arg = exclude ? "--exclude ${exclude}" : ""
def expected_cn_arg = expected_cn ? "--expected-cn ${expected_cn}" : ""

"""
hificnv \\
--bam ${bam} \\
--ref ${ref} \\
${maf_arg} \\
${exclude_arg} \\
${expected_cn_arg} \\
--threads ${task.cpus} \\
--output-prefix ${prefix} \\
${args}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
hificnv: \$(hificnv --version 2>&1 | sed 's/^.*hificnv //; s/ .*\$//')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hificnv: \$(hificnv --version 2>&1 | sed 's/^.*hificnv //; s/ .*\$//')
hificnv: \$(hificnv --version 2>&1 | sed 's/.* //')

END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def args = task.ext.args ?: ''

def prefix = task.ext.prefix ?: "${meta.id}"
def create_maf = maf ? "touch ${prefix}.maf.bw" : ""

"""
touch ${prefix}.depth.bw
touch ${prefix}.copynum.bedgraph
${create_maf}
echo "" | gzip > ${prefix}.vcf.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
hificnv: \$(hificnv --version 2>&1 | sed 's/^.*hificnv //; s/ .*\$//')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hificnv: \$(hificnv --version 2>&1 | sed 's/^.*hificnv //; s/ .*\$//')
hificnv: \$(hificnv --version 2>&1 | sed 's/.* //')

END_VERSIONS
"""
}
121 changes: 121 additions & 0 deletions modules/nf-core/hificnv/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "hificnv"
description: "Copy number variant calling from PacBio HiFi reads"
keywords:
- "copy number variation"
- "cnv"
- "PacBio"
- "HiFi"
- "long reads"
- "structural variation"
tools:
- "hificnv":
description: "Copy number variant caller designed for PacBio HiFi reads"
homepage: "https://github.com/PacificBiosciences/HiFiCNV"
documentation: "https://github.com/PacificBiosciences/HiFiCNV"
tool_dev_url: "https://github.com/PacificBiosciences/HiFiCNV"
doi: "10.1093/bioinformatics/btac808"
licence: ["Pacific Biosciences Software License Agreement"]

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`
- bam:
type: file
description: "Sorted BAM or CRAM file from PacBio HiFi reads"
pattern: "*.{bam,cram}"
- bai:
type: file
description: BAM index file (CSI, CRAI, or BAI format)
pattern: "*.{bai,csi,crai}"
- maf:
type: file
description: "Minor allele frequency file (VCF format)"
pattern: "*.{vcf,vcf.gz}"
optional: true
- - meta2:
type: map
description: |
Groovy Map containing reference genome information
e.g. `[ id:'GATK.GRCh38' ]`
- ref:
type: file
description: "Reference genome FASTA file"
pattern: "*.{fa,fasta,fa.gz,fasta.gz}"
- - meta3:
type: map
description: |
Groovy Map containing exclude regions information
e.g. `[ id:'excluded_regions' ]`
- exclude:
type: file
description: "BED file containing regions to exclude from CNV calling"
pattern: "*.{bed,bed.gz}"
optional: true
- - meta4:
type: map
description: |
Groovy Map containing expected copy number information
e.g. `[ id:'male_expected_cn' ]`
- expected_cn:
type: file
description: "BED file containing expected copy number regions"
pattern: "*.{bed,bed.gz}"
optional: true

output:
copynum:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`
- "*.copynum.bedgraph":
type: file
description: "Copy number bedGraph file"
pattern: "*.copynum.bedgraph"
depth:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`
- "*.depth.bw":
type: file
description: "Depth coverage bigWig file"
pattern: "*.depth.bw"
maf:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`
- "*.maf.bw":
type: file
description: "Minor allele frequency bigWig file"
pattern: "*.maf.bw"
optional: true
vcf:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'test', single_end:false ]`
- "*.vcf.gz":
type: file
description: "Copy number variants in VCF format"
pattern: "*.{vcf.gz}"
versions:
- "versions.yml":
type: file
description: "File containing software versions"
pattern: "versions.yml"

authors:
- "@chaochaowong"

maintainers:
- "@chaochaowong"
Loading
Loading