Merge pull request #1736 from genomic-medicine-sweden/rhocall

Add rhocall/annotate
This commit is contained in:
Ramprasad Neethiraj 2022-06-08 16:41:36 +02:00 committed by GitHub
commit 813442d71e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 171 additions and 0 deletions

View file

@ -0,0 +1,51 @@
process RHOCALL_ANNOTATE {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::rhocall=0.5.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/rhocall:0.5.1--py39hbf8eff0_0':
'quay.io/biocontainers/rhocall:0.5.1--py39hbf8eff0_0' }"
input:
tuple val(meta), path(vcf), path(tbi)
tuple val(meta), path(roh)
path bed
output:
tuple val(meta), path("*_rhocall.vcf"), 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}"
def az_bed = bed ? "-b ${bed}" : ''
"""
rhocall \\
annotate \\
$args \\
$az_bed \\
-r $roh \\
-o ${prefix}_rhocall.vcf \\
$vcf
cat <<-END_VERSIONS > versions.yml
"${task.process}":
rhocall: \$(echo \$(rhocall --version 2>&1) | sed 's/rhocall, version //' )
END_VERSIONS
"""
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_rhocall.vcf
cat <<-END_VERSIONS > versions.yml
"${task.process}":
rhocall: \$(echo \$(rhocall --version 2>&1) | sed 's/rhocall, version //' )
END_VERSIONS
"""
}

View file

@ -0,0 +1,54 @@
name: "rhocall_annotate"
description: "Markup VCF file using rho-calls."
keywords:
- roh
- rhocall
tools:
- "rhocall":
description: "Call regions of homozygosity and make tentative UPD calls."
homepage: "https://github.com/dnil/rhocall"
documentation: "https://github.com/dnil/rhocall"
tool_dev_url: "https://github.com/dnil"
doi: ""
licence: "['GPL v3']"
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- vcf:
type: file
description: vcf file
pattern: "*.{vcf,vcf.gz}"
- tbi:
type: file
description: vcf index file
pattern: "*.{tbi}"
- roh:
type: file
description: Bcftools roh style TSV file with CHR,POS,AZ,QUAL
pattern: "*.{roh}"
- bed:
type: file
description: BED file with AZ windows.
pattern: "*.{bed}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- vcf:
type: file
description: vcf file
pattern: "*.{vcf,vcf.gz}"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@ramprasadn"

View file

@ -1647,6 +1647,10 @@ rgi/main:
- modules/rgi/main/** - modules/rgi/main/**
- tests/modules/rgi/main/** - tests/modules/rgi/main/**
rhocall/annotate:
- modules/rhocall/annotate/**
- tests/modules/rhocall/annotate/**
rmarkdownnotebook: rmarkdownnotebook:
- modules/rmarkdownnotebook/** - modules/rmarkdownnotebook/**
- tests/modules/rmarkdownnotebook/** - tests/modules/rmarkdownnotebook/**

View file

@ -0,0 +1,40 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { RHOCALL_ANNOTATE } from '../../../../modules/rhocall/annotate/main.nf'
include { BCFTOOLS_ROH } from '../../../../modules/bcftools/roh/main.nf'
workflow test_rhocall_annotate {
input = [ [ id:'test' ], // meta map
file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)]
af_file = [[],[]]
gen_map = []
regions = []
targets = []
samples = []
BCFTOOLS_ROH ( input, af_file, gen_map, regions, samples, targets )
RHOCALL_ANNOTATE ( input, BCFTOOLS_ROH.out.roh, [])
}
workflow test_rhocall_annotate_stub {
input = [ [ id:'test' ], // meta map
file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)]
af_file = [[],[]]
gen_map = []
regions = []
targets = []
samples = []
BCFTOOLS_ROH ( input, af_file, gen_map, regions, samples, targets )
RHOCALL_ANNOTATE ( input, BCFTOOLS_ROH.out.roh, [])
}

View file

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

View file

@ -0,0 +1,17 @@
- name: "rhocall annotate"
command: nextflow run ./tests/modules/rhocall/annotate -entry test_rhocall_annotate -c ./tests/config/nextflow.config -c ./tests/modules/rhocall/annotate/nextflow.config
tags:
- "rhocall"
- "rhocall/annotate"
files:
- path: "output/rhocall/test_rhocall.vcf"
- path: "output/rhocall/versions.yml"
- name: "rhocall annotate stub"
command: nextflow run ./tests/modules/rhocall/annotate -entry test_rhocall_annotate_stub -c ./tests/config/nextflow.config -c ./tests/modules/rhocall/annotate/nextflow.config -stub-run
tags:
- "rhocall"
- "rhocall/annotate"
files:
- path: "output/rhocall/test_rhocall.vcf"
- path: "output/rhocall/versions.yml"