intervallisttobed (#1312)

* intervallisttobed

* correct md5sum
This commit is contained in:
FriederikeHanssen 2022-02-17 16:32:26 +01:00 committed by GitHub
parent 8c8be7d7c6
commit fcd483e1b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 114 additions and 0 deletions

View file

@ -0,0 +1,41 @@
process GATK4_INTERVALLISTTOBED {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::gatk4=4.2.5.0" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/gatk4:4.2.5.0--hdfd78af_0' :
'quay.io/biocontainers/gatk4:4.2.5.0--hdfd78af_0' }"
input:
tuple val(meta), path(interval)
output:
tuple val(meta), path("*.bed"), emit: bed
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 avail_mem = 3
if (!task.memory) {
log.info '[GATK IntervalListToBed] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
gatk --java-options "-Xmx${avail_mem}g" IntervalListToBed \\
--INPUT ${interval} \\
--OUTPUT ${prefix}.bed \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
}

View file

@ -0,0 +1,41 @@
name: gatk4_intervallisttobed
keywords:
- interval
- bed
tools:
- gatk4:
description: Genome Analysis Toolkit (GATK4)
homepage: https://gatk.broadinstitute.org/hc/en-us
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
tool_dev_url: https://github.com/broadinstitute/gatk
doi: "10.1158/1538-7445.AM2017-3590"
licence: ["BSD-3-clause"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- interval:
type: file
description: Interval list
pattern: "*.{interval,interval_list}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- bed:
type: file
description: BED file
pattern: "*.bed"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@FriederikeHanssen"

View file

@ -604,6 +604,10 @@ gatk4/indexfeaturefile:
- modules/gatk4/indexfeaturefile/** - modules/gatk4/indexfeaturefile/**
- tests/modules/gatk4/indexfeaturefile/** - tests/modules/gatk4/indexfeaturefile/**
gatk4/intervallisttobed:
- modules/gatk4/intervallisttobed/**
- tests/modules/gatk4/intervallisttobed/**
gatk4/intervallisttools: gatk4/intervallisttools:
- modules/gatk4/intervallisttools/** - modules/gatk4/intervallisttools/**
- tests/modules/gatk4/intervallisttools/** - tests/modules/gatk4/intervallisttools/**

View file

@ -0,0 +1,15 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { GATK4_INTERVALLISTTOBED } from '../../../../modules/gatk4/intervallisttobed/main.nf'
workflow test_gatk4_intervallisttobed {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['genome']['genome_21_interval_list'], checkIfExists: true)
]
GATK4_INTERVALLISTTOBED ( input )
}

View file

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

View file

@ -0,0 +1,8 @@
- name: gatk4 intervallisttobed
command: nextflow run ./tests/modules/gatk4/intervallisttobed -entry test_gatk4_intervallisttobed -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/intervallisttobed/nextflow.config
tags:
- gatk4
- gatk4/intervallisttobed
files:
- path: output/gatk4/test.bed
md5sum: 9046675d01199fbbee79f2bc1c5dce52