Add gatherpileupsummaries (#1311)

* Add gatherpileupsummaries

* fix checksum

* Update modules/gatk4/gatherpileupsummaries/main.nf

* Add in when
This commit is contained in:
FriederikeHanssen 2022-02-17 15:05:21 +01:00 committed by GitHub
parent 8717792135
commit 8c8be7d7c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 121 additions and 0 deletions

View file

@ -0,0 +1,45 @@
process GATK4_GATHERPILEUPSUMMARIES {
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(pileup)
path dict
output:
tuple val(meta), path("*.pileupsummaries.table"), emit: table
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 input = pileup.collect{ "-I ${it} " }.join(' ')
def avail_mem = 3
if (!task.memory) {
log.info '[GATK GatherPileupSummaries] 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" \
GatherPileupSummaries \
--sequence-dictionary ${dict} \
${input} \
-O ${prefix}.pileupsummaries.table
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_gatherpileupsummaries
description: write your description here
keywords:
- sort
tools:
- gatk4:
description: Genome Analysis Toolkit (GATK4)
homepage: https://gatk.broadinstitute.org/hc/en-us
documentation: https://gatk.broadinstitute.org/hc/en-us
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 ]
- pileup:
type: (list of) file(s)
description: Pileup files from gatk4/getpileupsummaries
pattern: "*.pileups.table"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- table:
type: file
description: Pileup file
pattern: "*.pileups.table"
authors:
- "@FriederikeHanssen"

View file

@ -580,6 +580,10 @@ gatk4/gatherbqsrreports:
- modules/gatk4/gatherbqsrreports/**
- tests/modules/gatk4/gatherbqsrreports/**
gatk4/gatherpileupsummaries:
- modules/gatk4/gatherpileupsummaries/**
- tests/modules/gatk4/gatherpileupsummaries/**
gatk4/genomicsdbimport:
- modules/gatk4/genomicsdbimport/**
- tests/modules/gatk4/genomicsdbimport/**

View file

@ -0,0 +1,18 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { GATK4_GATHERPILEUPSUMMARIES } from '../../../../modules/gatk4/gatherpileupsummaries/main.nf'
workflow test_gatk4_gatherpileupsummaries {
input = [
[ id:'test', single_end:false ], // meta map
[file(params.test_data['homo_sapiens']['illumina']['test_pileups_table'], checkIfExists: true)]
//file(params.test_data['homo_sapiens']['illumina']['test_pileups_table'], checkIfExists: true)]
]
dict = file(params.test_data['homo_sapiens']['genome']['genome_21_dict'], checkIfExists: true)
GATK4_GATHERPILEUPSUMMARIES ( input, dict )
}

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 gatherpileupsummaries
command: nextflow run ./tests/modules/gatk4/gatherpileupsummaries -entry test_gatk4_gatherpileupsummaries -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/gatherpileupsummaries/nextflow.config
tags:
- gatk4
- gatk4/gatherpileupsummaries
files:
- path: output/gatk4/test.pileupsummaries.table
md5sum: 8e0ca6f66e112bd2f7ec1d31a2d62469