Skip to content

Commit

Permalink
add severus
Browse files Browse the repository at this point in the history
  • Loading branch information
fellen31 committed Jul 10, 2024
1 parent c5abf7a commit 43e09ad
Show file tree
Hide file tree
Showing 7 changed files with 896 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/nf-core/severus/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
name: "severus"
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- "bioconda::severus=1.1"
89 changes: 89 additions & 0 deletions modules/nf-core/severus/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
process SEVERUS {
tag "$meta.id"
label 'process_medium'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/severus:1.1--pyhdfd78af_0':
'biocontainers/severus:1.1--pyhdfd78af_0' }"

input:
tuple val(meta), path(target_bam), path(target_index), path(control_bam), path(control_index), path(vcf)
tuple val(meta2), path(bed)

output:
tuple val(meta), path("${prefix}/severus.log") , emit: log
tuple val(meta), path("${prefix}/read_qual.txt") , emit: read_qual
tuple val(meta), path("${prefix}/breakpoints_double.csv") , emit: breakpoints_double
tuple val(meta), path("${prefix}/read_alignments") , emit: read_alignments , optional: true
tuple val(meta), path("${prefix}/read_ids.csv") , emit: read_ids , optional: true
tuple val(meta), path("${prefix}/severus_collaped_dup.bed") , emit: collapsed_dup , optional: true
tuple val(meta), path("${prefix}/severus_LOH.bed") , emit: loh , optional: true
tuple val(meta), path("${prefix}/all_SVs/severus_all.vcf") , emit: all_vcf , optional: true
tuple val(meta), path("${prefix}/all_SVs/breakpoints_clusters_list.tsv") , emit: all_breakpoints_clusters_list , optional: true
tuple val(meta), path("${prefix}/all_SVs/breakpoints_clusters.tsv") , emit: all_breakpoints_clusters , optional: true
tuple val(meta), path("${prefix}/all_SVs/plots/severus_*.html") , emit: all_plots , optional: true
tuple val(meta), path("${prefix}/somatic_SVs/severus_all.vcf") , emit: somatic_vcf , optional: true
tuple val(meta), path("${prefix}/somatic_SVs/breakpoints_clusters_list.tsv"), emit: somatic_breakpoints_clusters_list, optional: true
tuple val(meta), path("${prefix}/somatic_SVs/breakpoints_clusters.tsv") , emit: somatic_breakpoints_clusters , optional: true
tuple val(meta), path("${prefix}/somatic_SVs/plots/severus_*.html") , emit: somatic_plots , optional: true
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"

def control = control_bam ? "--control-bam ${control_bam}" : ""
def vntr_bed = bed ? "--vntr-bed ${bed}" : ""
def phasing_vcf = vcf ? "--phasing-vcf ${vcf}" : ""
"""
severus \\
$args \\
--threads $task.cpus \\
--target-bam $target_bam \\
$vntr_bed \\
$control \\
$phasing_vcf \\
--out-dir ${prefix}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
severus: \$(severus --version)
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"

"""
mkdir -p ${prefix}/all_SVs/plots
mkdir -p ${prefix}/somatic_SVs/plots
touch ${prefix}/severus_collaped_dup.bed
touch ${prefix}/severus.log
touch ${prefix}/severus_LOH.bed
touch ${prefix}/read_alignments
touch ${prefix}/read_ids.csv
touch ${prefix}/read_qual.txt
touch ${prefix}/breakpoints_double.csv
touch ${prefix}/all_SVs/severus_all.vcf
touch ${prefix}/all_SVs/breakpoints_clusters_list.tsv
touch ${prefix}/all_SVs/breakpoints_clusters.tsv
touch ${prefix}/all_SVs/plots/severus_0.html
touch ${prefix}/all_SVs/plots/severus_1.html
touch ${prefix}/somatic_SVs/severus_somatic.vcf
touch ${prefix}/somatic_SVs/breakpoints_clusters_list.tsv
touch ${prefix}/somatic_SVs/breakpoints_clusters.tsv
touch ${prefix}/somatic_SVs/plots/severus_0.html
touch ${prefix}/somatic_SVs/plots/severus_1.html
cat <<-END_VERSIONS > versions.yml
"${task.process}":
severus: \$(severus --version)
END_VERSIONS
"""
}
128 changes: 128 additions & 0 deletions modules/nf-core/severus/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "severus"
description: Severus is a somatic structural variation (SV) caller for long reads (both PacBio and ONT)
keywords:
- structural
- variation
- somatic
- germline
- long-read
tools:
- "severus":
description: "A tool for somatic structural variant calling using long reads"
homepage: "https://github.com/KolmogorovLab/Severus"
documentation: "https://github.com/KolmogorovLab/Severus"
tool_dev_url: "https://github.com/KolmogorovLab/Severus"
doi: "10.1101/2024.03.22.24304756"
licence: ["BSD-3-clause"]

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- target_bam:
type: file
description: path to one or multiple target bam files (e.g. tumor, must be indexed)
pattern: "*.bam"
- target_index:
type: file
description: path to one or multiple target bam index files
pattern: "*.bai"
- control_bam:
type: file
description: path to the control bam file (e.g. normal, must be indexed)
pattern: "*.bam"
- control_index:
type: file
description: path to the control bam file index
pattern: "*.bai"
- vcf:
type: file
description: path to vcf file used for phasing (if using haplotype specific SV calling
pattern: "*.{vcf,vcf.gz}"
- meta2:
type: map
description: |
Groovy Map containing tandem repeat regions information
e.g. `[ id:'hg38']`
- bed:
type: file
description: path to bed file for tandem repeat regions (must be ordered)
pattern: "*.bed"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- log:
type: file
description: Severus log file
pattern: "${prefix}/severus.log"
- read_qual:
type: file
description: Severus read_qual file
pattern: "${prefix}/read_qual.txt"
- breakpoints_double:
type: file
description: Severus breakpoints_double file
pattern: "${prefix}/breakpoints_double.csv"
- read_alignments:
type: file
description: read alignments file
pattern: "${prefix}/read_alignments"
- read_ids:
type: file
description: read IDs for support reads
pattern: "${prefix}/read_ids"
- collapsed_dup:
type: file
description: a bed file with identified collapsed duplication regions
pattern: "${prefix}/severus_collaped_dup"
- loh:
type: file
description: a bed file with identified collapsed duplication regions
pattern: "${prefix}/severus_LOH.bed"
- all_vcf:
type: file
description: VCF file with all SVs (somatic + germline)
pattern: "${prefix}/all_SVs/severus_all.vcf"
- all_breakpoints_clusters_list:
type: file
description: Severus breakpoints clusters list file
pattern: "${prefix}/all_SVs/breakpoints_clusters_list.tsv"
- all_breakpoints_clusters:
type: file
description: Severus breakpoints clusters file
pattern: "${prefix}/all_SVs/breakpoints_clusters.tsv"
- all_plots:
type: file
description: Severus plots
pattern: "${prefix}/all_SVs/plots/*.html"
- somatic_vcf:
type: file
description: VCF file with somatic SVs
pattern: "${prefix}/somatic_SVs/severus_all.vcf"
- somatic_breakpoints_clusters_list:
type: file
description: Severus somatic breakpoints clusters list file
pattern: "${prefix}/somatic_SVs/breakpoints_clusters_list.tsv"
- somatic_breakpoints_clusters:
type: file
description: Severus somatic breakpoints clusters file
pattern: "${prefix}/somatic_SVs/breakpoints_clusters.tsv"
- somatic_plots:
type: file
description: Severus somatic plots
pattern: "${prefix}/somatic_SVs/plots/*.html"
authors:
- "@fellen31"
maintainers:
- "@fellen31"
Loading

0 comments on commit 43e09ad

Please sign in to comment.