-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gatk3-indelrealigner' into upstream-for-indel
- Loading branch information
Showing
6 changed files
with
171 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
process GATK_INDELREALIGNER { | ||
tag "$meta.id" | ||
label 'process_low' | ||
|
||
conda (params.enable_conda ? "bioconda::gatk=3.5" : null) | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/gatk:3.5--hdfd78af_11': | ||
'quay.io/biocontainers/gatk:3.5--hdfd78af_11' }" | ||
|
||
input: | ||
tuple val(meta), path(input), path(index), path(intervals) | ||
path(fasta) | ||
path(fai) | ||
path(dict) | ||
path(known_vcf) | ||
|
||
output: | ||
tuple val(meta), path("*.bam"), path("*.bai"), emit: bam | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
if ("$input" == "${prefix}.bam") error "Input and output names are the same, set prefix in module configuration to disambiguate!" | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
def known = known_vcf ? "-known ${known_vcf}" : "" | ||
|
||
def avail_mem = 3 | ||
if (!task.memory) { | ||
log.info '[GATK IndelRealigner] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' | ||
} else { | ||
avail_mem = task.memory.giga | ||
} | ||
|
||
""" | ||
gatk3 \\ | ||
-Xmx${avail_mem}g \\ | ||
-T IndelRealigner \\ | ||
-R ${fasta} \\ | ||
-nt ${task.cpus} | ||
-I ${input} \\ | ||
-targetIntervals ${intervals} \\ | ||
${known} \\ | ||
-o ${prefix}.bam \\ | ||
$args | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
gatk: \$(echo \$(gatk3 --version)) | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: "gatk_indelrealigner" | ||
description: Performs local realignment around indels to correct for mapping errors | ||
keywords: | ||
- bam | ||
- vcf | ||
- variant calling | ||
- indel | ||
- realignment | ||
tools: | ||
- "gatk": | ||
description: "The full Genome Analysis Toolkit (GATK) framework, license restricted." | ||
homepage: "https://gatk.broadinstitute.org/hc/en-us" | ||
documentation: "https://github.com/broadinstitute/gatk-docs" | ||
licence: "['https://software.broadinstitute.org/gatk/download/licensing', 'BSD', 'https://www.broadinstitute.org/gatk/about/#licensing']" | ||
|
||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. [ id:'test', single_end:false ] | ||
- input: | ||
type: file | ||
description: Sorted and indexed BAM/CRAM/SAM file | ||
pattern: "*.bam" | ||
- index: | ||
type: file | ||
description: BAM index file | ||
pattern: "*.bai" | ||
- intervals: | ||
type: file | ||
description: Intervals file created by gatk3 RealignerTargetCreator | ||
pattern: "*.{intervals,list}" | ||
- fasta: | ||
type: file | ||
description: Reference file used to generate BAM file | ||
pattern: ".{fasta,fa,fna}" | ||
- fai: | ||
type: file | ||
description: Index of reference file used to generate BAM file | ||
pattern: ".fai" | ||
- dict: | ||
type: file | ||
description: GATK dict file for reference | ||
pattern: ".dict" | ||
- known_vcf: | ||
type: file | ||
description: Optional input VCF file(s) with known indels | ||
pattern: ".vcf" | ||
|
||
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" | ||
- bam: | ||
type: file | ||
description: Sorted and indexed BAM/CRAM/SAM file with local realignment around variants | ||
pattern: "*.bam" | ||
- bai: | ||
type: file | ||
description: Output BAM Index file | ||
pattern: "*.bai" | ||
|
||
authors: | ||
- "@jfy133" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env nextflow | ||
|
||
nextflow.enable.dsl = 2 | ||
|
||
include { GATK_INDELREALIGNER } from '../../../../modules/gatk/indelrealigner/main.nf' | ||
|
||
// TODO add REalignerTargetCrator | ||
|
||
|
||
workflow test_gatk_indelrealigner { | ||
|
||
input = [ | ||
[ id:'test', single_end:false ], // meta map | ||
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true), | ||
file(params.test_data['sarscov2']['illumina']['test_paired_end_bai'], checkIfExists: true), | ||
GATK_REALIGNERTARGETCREATOR.out.intervals | ||
] | ||
|
||
reference = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) | ||
|
||
GATK_INDELREALIGNER ( input, reference, [] ) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
process { | ||
|
||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
ext.prefix = "${meta.id}.realigned" | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## TODO nf-core: Please run the following command to build this file: | ||
# nf-core modules create-test-yml gatk/indelrealigner | ||
- name: "gatk indelrealigner" | ||
command: nextflow run ./tests/modules/gatk/indelrealigner -entry test_gatk_indelrealigner -c ./tests/config/nextflow.config -c ./tests/modules/gatk/indelrealigner/nextflow.config | ||
tags: | ||
- "gatk" | ||
# | ||
- "gatk/indelrealigner" | ||
# | ||
files: | ||
- path: "output/gatk/test.bam" | ||
md5sum: e667c7caad0bc4b7ac383fd023c654fc | ||
- path: output/gatk/versions.yml | ||
md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b |