Merge pull request #1758 from FriederikeHanssen/manta_convert

add manta conversion script
This commit is contained in:
FriederikeHanssen 2022-06-13 09:42:03 +02:00 committed by GitHub
commit ccaf8b5f32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 130 additions and 0 deletions

View file

@ -0,0 +1,35 @@
process MANTA_CONVERTINVERSION {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::manta=1.6.0 bioconda::samtools=1.15.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-40295ae41112676b05b649e513fe7000675e9b84:0b4be2c719f99f44df34be7b447b287bb7f86e01-0':
'quay.io/biocontainers/mulled-v2-40295ae41112676b05b649e513fe7000675e9b84:0b4be2c719f99f44df34be7b447b287bb7f86e01-0' }"
input:
tuple val(meta), path(vcf)
path fasta
output:
tuple val(meta), path("*.vcf.gz") , emit: vcf
tuple val(meta), path("*.vcf.gz.tbi"), emit: tbi
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}"
"""
convertInversion.py \$(which samtools) $fasta $vcf | bgzip --threads $task.cpus > ${prefix}.vcf.gz
tabix ${prefix}.vcf.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
manta: \$( configManta.py --version )
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' ))
END_VERSIONS
"""
}

View file

@ -0,0 +1,45 @@
name: "manta_convertinversion"
description: Manta calls structural variants (SVs) and indels from mapped paired-end sequencing reads. This script reformats inversions into single inverted sequence junctions which was the format used in Manta versions <= 1.4.0.
keywords:
- structural variants
- conversion
tools:
- manta:
description: Structural variant and indel caller for mapped sequencing data
homepage: https://github.com/Illumina/manta
documentation: https://github.com/Illumina/manta/blob/v1.6.0/docs/userGuide/README.md
tool_dev_url: https://github.com/Illumina/manta
doi: "10.1093/bioinformatics/btv710"
licence: ["GPL v3"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- vcf:
type: file
description: VCF file produces by Manta
pattern: "*.vcf.gz"
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"
- vcf:
type: file
description: VCF file with reformatted inversions
pattern: "*.vcf.gz"
- tbi:
type: file
description: TBI file produces by Manta
pattern: "*.vcf.gz.tbi"
authors:
- "@FriederikeHanssen"

View file

@ -1246,6 +1246,10 @@ maltextract:
- modules/maltextract/**
- tests/modules/maltextract/**
manta/convertinversion:
- modules/manta/convertinversion/**
- tests/modules/manta/convertinversion/**
manta/germline:
- modules/manta/germline/**
- tests/modules/manta/germline/**

View file

@ -0,0 +1,23 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { MANTA_CONVERTINVERSION } from '../../../../modules/manta/convertinversion/main.nf'
include { MANTA_TUMORONLY } from '../../../../modules/manta/tumoronly/main.nf'
workflow test_manta_convertinversion {
input = [
[ id:'test'], // meta map
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_cram'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_recalibrated_sorted_cram_crai'], checkIfExists: true),
[], []
]
fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
MANTA_TUMORONLY ( input, fasta, fai )
MANTA_CONVERTINVERSION ( MANTA_TUMORONLY.out.tumor_sv_vcf, fasta )
}

View file

@ -0,0 +1,5 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

View file

@ -0,0 +1,18 @@
- name: manta convertinversion test_manta_convertinversion
command: nextflow run ./tests/modules/manta/convertinversion -entry test_manta_convertinversion -c ./tests/config/nextflow.config -c ./tests/modules/manta/convertinversion/nextflow.config
tags:
- manta
- manta/convertinversion
files:
- path: output/manta/test.candidate_small_indels.vcf.gz
- path: output/manta/test.candidate_small_indels.vcf.gz.tbi
md5sum: 4cb176febbc8c26d717a6c6e67b9c905
- path: output/manta/test.candidate_sv.vcf.gz
- path: output/manta/test.candidate_sv.vcf.gz.tbi
md5sum: 4cb176febbc8c26d717a6c6e67b9c905
- path: output/manta/test.tumor_sv.vcf.gz
- path: output/manta/test.tumor_sv.vcf.gz.tbi
md5sum: 4cb176febbc8c26d717a6c6e67b9c905
- path: output/manta/test.vcf.gz
- path: output/manta/test.vcf.gz.tbi
md5sum: e7180bb953d2bd657c420a5f76a7164d