new module gatk4/printsvevidence (#2103)

* new module gatk4/printsvevidence

* linting

Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>
master
nvnieuwk 2 years ago committed by GitHub
parent 77d5dd60eb
commit 5d8edefb26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,66 @@
process GATK4_PRINTSVEVIDENCE {
tag "${meta.id}"
label 'process_single'
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(evidence), path(evidence_index)
path bed
path fasta
path fasta_fai
path dict
output:
tuple val(meta), path("*.txt.gz") , emit: printed_evidence
tuple val(meta), path("*.txt.gz.tbi") , emit: printed_evidence_index
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 intervals = bed ? "--intervals ${bed}" : ""
def reference = fasta ? "--reference ${fasta}" : ""
def file_name = evidence.getFileName()
def file_type = file_name =~ ".sr.txt" ? "sr" :
file_name =~ ".pe.txt" ? "pe" :
file_name =~ ".baf.txt" ? "baf" :
file_name =~ ".rd.txt" ? "rd" :
false
if(!file_type){
error("The input file name should contain one of the following: '.sr.txt', '.pe.txt', '.baf.txt', '.rd.txt'")
}
def avail_mem = 3
if (!task.memory) {
log.info '[GATK PRINTSVEVIDENCE] 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" PrintSVEvidence \\
--evidence-file ${evidence} \\
--sequence-dictionary ${dict} \\
${intervals} \\
${reference} \\
--output ${prefix}.${file_type}.txt.gz \\
--tmp-dir . \\
${args}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
}

@ -0,0 +1,68 @@
name: "gatk4_printsvevidence"
description: Gathers paired-end and split read evidence files for use in the GATK-SV pipeline. Output files are a file containing the location of and orientation of read pairs marked as discordant, and a file containing the clipping location of all soft clipped reads and the orientation of the clipping.
keywords:
- structural variants
- gatk4
tools:
- gatk4:
description: |
Developed in the Data Sciences Platform at the Broad Institute, the toolkit offers a wide variety of tools
with a primary focus on variant discovery and genotyping. Its powerful processing engine
and high-performance computing features make it capable of taking on projects of any size.
homepage: https://gatk.broadinstitute.org/hc/en-us
documentation: https://gatk.broadinstitute.org/hc/en-us/categories/360002369672s
doi: 10.1158/1538-7445.AM2017-3590
licence: ["Apache-2.0"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- evidence:
type: file
description: The evidence file created by CollectSVEvidence
pattern: "*.{pe,sr,baf,rd}.txt(.gz)"
- evidence_index:
type: file
description: The index of the evidence file created by CollectSVEvidence
pattern: "*.{pe,sr,baf,rd}.txt(.gz).tbi"
- bed:
type: file
description: An optional BED file
pattern: "*.bed"
- fasta:
type: file
description: An optional reference FASTA file
pattern: "*.{fa,fasta}"
- fasta_fai:
type: file
description: An optional reference FASTA file index
pattern: "*.fai"
- dict:
type: file
description: The mandatory sequence dictionary file
pattern: "*.dict"
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"
- printed_evidence:
type: file
description: The output file containing the discordant read pairs or the soft clipped reads
pattern: "*.{pe,sr,baf,rd}.txt.gz"
- printed_evidence:
type: file
description: The index of the output file containing the discordant read pairs or the soft clipped reads
pattern: "*.{pe,sr,baf,rd}.txt.gz.tbi"
authors:
- "@nvnieuwk"

@ -1003,6 +1003,10 @@ gatk4/mutect2:
- modules/gatk4/mutect2/**
- tests/modules/gatk4/mutect2/**
gatk4/printsvevidence:
- modules/gatk4/printsvevidence/**
- tests/modules/gatk4/printsvevidence/**
gatk4/reblockgvcf:
- modules/gatk4/reblockgvcf/**
- tests/modules/gatk4/reblockgvcf/**

@ -0,0 +1,116 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { GATK4_PRINTSVEVIDENCE as GATK4_PRINTSVEVIDENCE_PE } from '../../../../modules/gatk4/printsvevidence/main.nf'
include { GATK4_PRINTSVEVIDENCE as GATK4_PRINTSVEVIDENCE_SR } from '../../../../modules/gatk4/printsvevidence/main.nf'
include { GATK4_COLLECTSVEVIDENCE } from '../../../../modules/gatk4/collectsvevidence/main.nf'
workflow test_gatk4_printsvevidence {
input = Channel.of(
[
[ id:'normal', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true),
[],
[]
],
[
[ id:'tumour', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam_bai'], 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)
dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)
GATK4_COLLECTSVEVIDENCE(
input,
fasta,
fasta_fai,
dict
)
pe_files = GATK4_COLLECTSVEVIDENCE.out.paired_end_evidence
.combine(GATK4_COLLECTSVEVIDENCE.out.paired_end_evidence_index, by:0)
sr_files = GATK4_COLLECTSVEVIDENCE.out.split_read_evidence
.combine(GATK4_COLLECTSVEVIDENCE.out.split_read_evidence_index, by:0)
GATK4_PRINTSVEVIDENCE_PE(
pe_files,
[],
fasta,
fasta_fai,
dict
)
GATK4_PRINTSVEVIDENCE_SR(
sr_files,
[],
fasta,
fasta_fai,
dict
)
}
workflow test_gatk4_printsvevidence_bed_no_fasta {
input = Channel.of(
[
[ id:'normal', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true),
[],
[]
],
[
[ id:'tumour', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam_bai'], checkIfExists: true),
[],
[]
]
)
fasta = []
fasta_fai = []
dict = file(params.test_data['homo_sapiens']['genome']['genome_dict'], checkIfExists: true)
bed = file(params.test_data['homo_sapiens']['genome']['genome_bed'], checkIfExists: true)
GATK4_COLLECTSVEVIDENCE(
input,
fasta,
fasta_fai,
dict
)
pe_files = GATK4_COLLECTSVEVIDENCE.out.paired_end_evidence
.combine(GATK4_COLLECTSVEVIDENCE.out.paired_end_evidence_index, by:0)
sr_files = GATK4_COLLECTSVEVIDENCE.out.split_read_evidence
.combine(GATK4_COLLECTSVEVIDENCE.out.split_read_evidence_index, by:0)
GATK4_PRINTSVEVIDENCE_PE(
pe_files,
bed,
fasta,
fasta_fai,
dict
)
GATK4_PRINTSVEVIDENCE_SR(
sr_files,
bed,
fasta,
fasta_fai,
dict
)
}

@ -0,0 +1,14 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName: GATK4_COLLECTSVEVIDENCE {
ext.args = {"--sample-name ${meta.id}"}
}
withName: "GATK4_PRINTSVEVIDENCE*" {
ext.prefix = {"${meta.id}_print"}
}
}

@ -0,0 +1,77 @@
- name: gatk4 printsvevidence test_gatk4_printsvevidence
command: nextflow run ./tests/modules/gatk4/printsvevidence -entry test_gatk4_printsvevidence -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/printsvevidence/nextflow.config
tags:
- gatk4/printsvevidence
- gatk4
files:
- path: output/gatk4/normal.pe.txt.gz
md5sum: 19f13dd0408204590b40239d14acbdde
- path: output/gatk4/normal.pe.txt.gz.tbi
md5sum: 876170d2727a467263cbacecbd9979ee
- path: output/gatk4/normal.sr.txt.gz
md5sum: fb9ce52193a0db3a084890bd6bbf6a64
- path: output/gatk4/normal.sr.txt.gz.tbi
md5sum: 3e7b04492c53765e3c84d76b59e1f2c5
- path: output/gatk4/normal_print.pe.txt.gz
md5sum: 19f13dd0408204590b40239d14acbdde
- path: output/gatk4/normal_print.pe.txt.gz.tbi
md5sum: 876170d2727a467263cbacecbd9979ee
- path: output/gatk4/normal_print.sr.txt.gz
md5sum: fb9ce52193a0db3a084890bd6bbf6a64
- path: output/gatk4/normal_print.sr.txt.gz.tbi
md5sum: 3e7b04492c53765e3c84d76b59e1f2c5
- path: output/gatk4/tumour.pe.txt.gz
md5sum: 11fb8aeeea29370d9d1b49448456da81
- path: output/gatk4/tumour.pe.txt.gz.tbi
md5sum: 876170d2727a467263cbacecbd9979ee
- path: output/gatk4/tumour.sr.txt.gz
md5sum: 3ce47a0e0abac1c2b291e73a2b57cba0
- path: output/gatk4/tumour.sr.txt.gz.tbi
md5sum: f2105270ba79ed645bac9842be79f411
- path: output/gatk4/tumour_print.pe.txt.gz
md5sum: 11fb8aeeea29370d9d1b49448456da81
- path: output/gatk4/tumour_print.pe.txt.gz.tbi
md5sum: 876170d2727a467263cbacecbd9979ee
- path: output/gatk4/tumour_print.sr.txt.gz
md5sum: 3ce47a0e0abac1c2b291e73a2b57cba0
- path: output/gatk4/tumour_print.sr.txt.gz.tbi
md5sum: f2105270ba79ed645bac9842be79f411
- name: gatk4 printsvevidence test_gatk4_printsvevidence_bed_no_fasta
command: nextflow run ./tests/modules/gatk4/printsvevidence -entry test_gatk4_printsvevidence_bed_no_fasta -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/printsvevidence/nextflow.config
tags:
- gatk4/printsvevidence
- gatk4
files:
- path: output/gatk4/normal.pe.txt.gz
md5sum: 19f13dd0408204590b40239d14acbdde
- path: output/gatk4/normal.pe.txt.gz.tbi
md5sum: 876170d2727a467263cbacecbd9979ee
- path: output/gatk4/normal.sr.txt.gz
md5sum: fb9ce52193a0db3a084890bd6bbf6a64
- path: output/gatk4/normal.sr.txt.gz.tbi
md5sum: 3e7b04492c53765e3c84d76b59e1f2c5
- path: output/gatk4/normal_print.pe.txt.gz
md5sum: 19f13dd0408204590b40239d14acbdde
- path: output/gatk4/normal_print.pe.txt.gz.tbi
md5sum: 876170d2727a467263cbacecbd9979ee
- path: output/gatk4/normal_print.sr.txt.gz
md5sum: fb9ce52193a0db3a084890bd6bbf6a64
- path: output/gatk4/normal_print.sr.txt.gz.tbi
md5sum: 3e7b04492c53765e3c84d76b59e1f2c5
- path: output/gatk4/tumour.pe.txt.gz
md5sum: 11fb8aeeea29370d9d1b49448456da81
- path: output/gatk4/tumour.pe.txt.gz.tbi
md5sum: 876170d2727a467263cbacecbd9979ee
- path: output/gatk4/tumour.sr.txt.gz
md5sum: 3ce47a0e0abac1c2b291e73a2b57cba0
- path: output/gatk4/tumour.sr.txt.gz.tbi
md5sum: f2105270ba79ed645bac9842be79f411
- path: output/gatk4/tumour_print.pe.txt.gz
md5sum: 11fb8aeeea29370d9d1b49448456da81
- path: output/gatk4/tumour_print.pe.txt.gz.tbi
md5sum: 876170d2727a467263cbacecbd9979ee
- path: output/gatk4/tumour_print.sr.txt.gz
md5sum: 3ce47a0e0abac1c2b291e73a2b57cba0
- path: output/gatk4/tumour_print.sr.txt.gz.tbi
md5sum: f2105270ba79ed645bac9842be79f411
Loading…
Cancel
Save