mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 02:58:17 +00:00
added gatk4/splitintervals
This commit is contained in:
parent
fc987d5fcd
commit
8a17b6dd0e
6 changed files with 163 additions and 4 deletions
47
modules/gatk4/splitintervals/main.nf
Normal file
47
modules/gatk4/splitintervals/main.nf
Normal file
|
@ -0,0 +1,47 @@
|
|||
process GATK4_SPLITINTERVALS {
|
||||
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(intervals)
|
||||
path(fasta)
|
||||
path(fasta_fai)
|
||||
path(fasta_dict)
|
||||
|
||||
output:
|
||||
tuple val(meta), path("**.interval_list"), emit: split_intervals
|
||||
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 reference = fasta ? "--reference $fasta" : ""
|
||||
|
||||
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" SplitIntervals \\
|
||||
--output ${prefix} \\
|
||||
--intervals $intervals \\
|
||||
$reference \\
|
||||
$args
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
41
modules/gatk4/splitintervals/meta.yml
Normal file
41
modules/gatk4/splitintervals/meta.yml
Normal file
|
@ -0,0 +1,41 @@
|
|||
name: gatk4_splitintervals
|
||||
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' ]
|
||||
- interval:
|
||||
type: file
|
||||
description: Interval list or BED
|
||||
pattern: "*.{interval,interval_list,bed}"
|
||||
|
||||
output:
|
||||
- meta:
|
||||
type: map
|
||||
description: |
|
||||
Groovy Map containing sample information
|
||||
e.g. [ id:'test' ]
|
||||
- bed:
|
||||
type: file
|
||||
description: A list of scattered interval lists
|
||||
pattern: "*.interval_list"
|
||||
- versions:
|
||||
type: file
|
||||
description: File containing software versions
|
||||
pattern: "versions.yml"
|
||||
|
||||
authors:
|
||||
- "@nvnieuwk"
|
|
@ -819,6 +819,10 @@ gatk4/selectvariants:
|
|||
- modules/gatk4/selectvariants/**
|
||||
- tests/modules/gatk4/selectvariants/**
|
||||
|
||||
gatk4/splitintervals:
|
||||
- modules/gatk4/splitintervals/**
|
||||
- tests/modules/gatk4/splitintervals/**
|
||||
|
||||
gatk4/splitncigarreads:
|
||||
- modules/gatk4/splitncigarreads/**
|
||||
- tests/modules/gatk4/splitncigarreads/**
|
||||
|
@ -1647,14 +1651,14 @@ samtools/bam2fq:
|
|||
- modules/samtools/bam2fq/**
|
||||
- tests/modules/samtools/bam2fq/**
|
||||
|
||||
samtools/convert:
|
||||
- modules/samtools/convert/**
|
||||
- tests/modules/samtools/convert/**
|
||||
|
||||
samtools/collatefastq:
|
||||
- modules/samtools/collatefastq/**
|
||||
- tests/modules/samtools/collatefastq/**
|
||||
|
||||
samtools/convert:
|
||||
- modules/samtools/convert/**
|
||||
- tests/modules/samtools/convert/**
|
||||
|
||||
samtools/depth:
|
||||
- modules/samtools/depth/**
|
||||
- tests/modules/samtools/depth/**
|
||||
|
|
33
tests/modules/gatk4/splitintervals/main.nf
Normal file
33
tests/modules/gatk4/splitintervals/main.nf
Normal file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { GATK4_SPLITINTERVALS } from '../../../../modules/gatk4/splitintervals/main.nf'
|
||||
|
||||
workflow test_gatk4_splitintervals_bed {
|
||||
|
||||
input = [
|
||||
[ id:'test' ], // meta map
|
||||
file(params.test_data['homo_sapiens']['genome']['genome_multi_interval_bed'], checkIfExists: true)
|
||||
]
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
|
||||
fasta_fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||
fasta_dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)
|
||||
|
||||
GATK4_SPLITINTERVALS ( input, fasta, fasta_fai, fasta_dict)
|
||||
}
|
||||
|
||||
workflow test_gatk4_splitintervals_intervals {
|
||||
|
||||
input = [
|
||||
[ id:'test' ], // meta map
|
||||
file(params.test_data['homo_sapiens']['genome']['genome_interval_list'], checkIfExists: true)
|
||||
]
|
||||
|
||||
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
|
||||
fasta_fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
|
||||
fasta_dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)
|
||||
|
||||
GATK4_SPLITINTERVALS ( input, fasta, fasta_fai, fasta_dict)
|
||||
}
|
9
tests/modules/gatk4/splitintervals/nextflow.config
Normal file
9
tests/modules/gatk4/splitintervals/nextflow.config
Normal file
|
@ -0,0 +1,9 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
|
||||
withName: GATK4_SPLITINTERVALS {
|
||||
ext.args = "--scatter-count 2"
|
||||
}
|
||||
}
|
25
tests/modules/gatk4/splitintervals/test.yml
Normal file
25
tests/modules/gatk4/splitintervals/test.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
- name: gatk4 splitintervals test_gatk4_splitintervals_bed
|
||||
command: nextflow run tests/modules/gatk4/splitintervals -entry test_gatk4_splitintervals_bed -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4/splitintervals
|
||||
- gatk4
|
||||
files:
|
||||
- path: output/gatk4/test/0000-scattered.interval_list
|
||||
md5sum: c8d6b19e7a92535b6ce9608eae558faa
|
||||
- path: output/gatk4/test/0001-scattered.interval_list
|
||||
md5sum: b1877ad96aec308906594c50ebbe3ded
|
||||
- path: output/gatk4/versions.yml
|
||||
md5sum: c7b9068d84e0e05412f50e86d5b87078
|
||||
|
||||
- name: gatk4 splitintervals test_gatk4_splitintervals_intervals
|
||||
command: nextflow run tests/modules/gatk4/splitintervals -entry test_gatk4_splitintervals_intervals -c tests/config/nextflow.config
|
||||
tags:
|
||||
- gatk4/splitintervals
|
||||
- gatk4
|
||||
files:
|
||||
- path: output/gatk4/test/0000-scattered.interval_list
|
||||
md5sum: ebd6b34a335efc6732ff541936c6d2d5
|
||||
- path: output/gatk4/test/0001-scattered.interval_list
|
||||
md5sum: 9459b0e124fa84ec1e64ac4615bc9af7
|
||||
- path: output/gatk4/versions.yml
|
||||
md5sum: 4eec8245944ad3be4cc22403c6ffb877
|
Loading…
Reference in a new issue