mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 02:58:17 +00:00
add filter variant tranches
This commit is contained in:
parent
856a8712f8
commit
15fba1dd7c
6 changed files with 138 additions and 0 deletions
49
modules/gatk4/filtervarianttranches/main.nf
Normal file
49
modules/gatk4/filtervarianttranches/main.nf
Normal file
|
@ -0,0 +1,49 @@
|
|||
process GATK4_FILTERVARIANTTRANCHES {
|
||||
tag "$meta.id"
|
||||
label 'process_low'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::gatk4=4.2.6.1" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/gatk4:4.2.6.1--hdfd78af_0':
|
||||
'quay.io/biocontainers/gatk4:4.2.6.1--hdfd78af_0' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(vcf), path(intervals)
|
||||
path ressources
|
||||
path fasta
|
||||
path fai
|
||||
path dict
|
||||
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.bam"), emit: bam
|
||||
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 ressources = ressources.collect{"--ressources $it"}.join(' ')
|
||||
def avail_mem = 3
|
||||
if (!task.memory) {
|
||||
log.info '[GATK FilterVariantTranches] 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" FilterVariantTranches \\
|
||||
--variant $vcf \\
|
||||
$ressources \\
|
||||
--output ${prefix}.filtered.vcf.gz \\
|
||||
--tmp-dir . \\
|
||||
$args
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
gatk4: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' ))
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
51
modules/gatk4/filtervarianttranches/meta.yml
Normal file
51
modules/gatk4/filtervarianttranches/meta.yml
Normal file
|
@ -0,0 +1,51 @@
|
|||
name: "gatk4_filtervarianttranches"
|
||||
## TODO nf-core: Add a description of the module and list keywords
|
||||
description: write your description here
|
||||
keywords:
|
||||
- sort
|
||||
tools:
|
||||
- "gatk4":
|
||||
## TODO nf-core: Add a description and other details for the software below
|
||||
description: "Genome Analysis Toolkit (GATK4)"
|
||||
homepage: "None"
|
||||
documentation: "None"
|
||||
tool_dev_url: "https://github.com/broadinstitute/gatk"
|
||||
doi: ""
|
||||
licence: "['BSD-3-clause']"
|
||||
|
||||
## TODO nf-core: Add a description of all of the variables used as input
|
||||
input:
|
||||
# Only when we have meta
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test', single_end:false ]
|
||||
#
|
||||
## TODO nf-core: Delete / customise this example input
|
||||
- bam:
|
||||
type: file
|
||||
description: BAM/CRAM/SAM file
|
||||
pattern: "*.{bam,cram,sam}"
|
||||
|
||||
## TODO nf-core: Add a description of all of the variables used as output
|
||||
output:
|
||||
#Only when we have meta
|
||||
- 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"
|
||||
## TODO nf-core: Delete / customise this example output
|
||||
- bam:
|
||||
type: file
|
||||
description: Sorted BAM/CRAM/SAM file
|
||||
pattern: "*.{bam,cram,sam}"
|
||||
|
||||
authors:
|
||||
- "@FriederikeHanssen"
|
|
@ -755,6 +755,10 @@ gatk4/filtermutectcalls:
|
|||
- modules/gatk4/filtermutectcalls/**
|
||||
- tests/modules/gatk4/filtermutectcalls/**
|
||||
|
||||
gatk4/filtervarianttranches:
|
||||
- modules/gatk4/filtervarianttranches/**
|
||||
- tests/modules/gatk4/filtervarianttranches/**
|
||||
|
||||
gatk4/gatherbqsrreports:
|
||||
- modules/gatk4/gatherbqsrreports/**
|
||||
- tests/modules/gatk4/gatherbqsrreports/**
|
||||
|
|
15
tests/modules/gatk4/filtervarianttranches/main.nf
Normal file
15
tests/modules/gatk4/filtervarianttranches/main.nf
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { GATK4_FILTERVARIANTTRANCHES } from '../../../../modules/gatk4/filtervarianttranches/main.nf'
|
||||
|
||||
workflow test_gatk4_filtervarianttranches {
|
||||
|
||||
input = [
|
||||
[ id:'test', single_end:false ], // meta map
|
||||
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true)
|
||||
]
|
||||
|
||||
GATK4_FILTERVARIANTTRANCHES ( input )
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
}
|
14
tests/modules/gatk4/filtervarianttranches/test.yml
Normal file
14
tests/modules/gatk4/filtervarianttranches/test.yml
Normal file
|
@ -0,0 +1,14 @@
|
|||
## TODO nf-core: Please run the following command to build this file:
|
||||
# nf-core modules create-test-yml gatk4/filtervarianttranches
|
||||
- name: "gatk4 filtervarianttranches"
|
||||
command: nextflow run ./tests/modules/gatk4/filtervarianttranches -entry test_gatk4_filtervarianttranches -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/filtervarianttranches/nextflow.config
|
||||
tags:
|
||||
- "gatk4"
|
||||
#
|
||||
- "gatk4/filtervarianttranches"
|
||||
#
|
||||
files:
|
||||
- path: "output/gatk4/test.bam"
|
||||
md5sum: e667c7caad0bc4b7ac383fd023c654fc
|
||||
- path: output/gatk4/versions.yml
|
||||
md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b
|
Loading…
Reference in a new issue