Merge branch 'nf-core:master' into cnvkit_bam

This commit is contained in:
SusiJo 2022-05-24 07:37:24 +02:00 committed by GitHub
commit 63c038ad68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 252 additions and 35 deletions

View file

@ -9,7 +9,7 @@ process GATK4_CNNSCOREVARIANTS {
container 'broadinstitute/gatk:4.2.6.1' //Biocontainers is missing a package container 'broadinstitute/gatk:4.2.6.1' //Biocontainers is missing a package
input: input:
tuple val(meta), path(vcf), path(aligned_input), path(intervals) tuple val(meta), path(vcf), path(tbi), path(aligned_input), path(intervals)
path fasta path fasta
path fai path fai
path dict path dict
@ -17,7 +17,8 @@ process GATK4_CNNSCOREVARIANTS {
path weights path weights
output: output:
tuple val(meta), path("*.vcf.gz"), emit: vcf tuple val(meta), path("*cnn.vcf.gz") , emit: vcf
tuple val(meta), path("*cnn.vcf.gz.tbi"), emit: tbi
path "versions.yml" , emit: versions path "versions.yml" , emit: versions
when: when:
@ -40,7 +41,7 @@ process GATK4_CNNSCOREVARIANTS {
""" """
gatk --java-options "-Xmx${avail_mem}g" CNNScoreVariants \\ gatk --java-options "-Xmx${avail_mem}g" CNNScoreVariants \\
--variant $vcf \\ --variant $vcf \\
--output ${prefix}.vcf.gz \\ --output ${prefix}.cnn.vcf.gz \\
--reference $fasta \\ --reference $fasta \\
$interval_command \\ $interval_command \\
$aligned_input \\ $aligned_input \\

View file

@ -25,6 +25,10 @@ input:
type: file type: file
description: VCF file description: VCF file
pattern: "*.vcf.gz" pattern: "*.vcf.gz"
- tbi:
type: file
description: VCF index file
pattern: "*.vcf.gz.tbi"
- aligned_input: - aligned_input:
type: file type: file
description: BAM/CRAM file from alignment (optional) description: BAM/CRAM file from alignment (optional)
@ -67,6 +71,10 @@ output:
type: file type: file
description: Annotated VCF file description: Annotated VCF file
pattern: "*.vcf" pattern: "*.vcf"
- tbi:
type: file
description: VCF index file
pattern: "*.vcf.gz.tbi"
authors: authors:
- "@FriederikeHanssen" - "@FriederikeHanssen"

View file

@ -0,0 +1,51 @@
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(tbi), path(intervals)
path resources
path resources_index
path fasta
path fai
path dict
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}"
def resources = resources.collect{"--resource $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 \\
$resources \\
--output ${prefix}.filtered.vcf.gz \\
--tmp-dir . \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
}

View file

@ -0,0 +1,68 @@
name: "gatk4_filtervarianttranches"
description: Apply tranche filtering
keywords:
- gatk4
- filtervarianttranches
tools:
- "gatk4":
description: Genome Analysis Toolkit (GATK4)
homepage: https://gatk.broadinstitute.org/hc/en-us
documentation: https://gatk.broadinstitute.org/hc/en-us
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', single_end:false ]
- vcf:
type: file
description: a VCF file containing variants, must have info key:CNN_2D
pattern: "*.vcf.gz"
- tbi:
type: file
description: tbi file matching with -vcf
pattern: "*.vcf.gz.tbi"
- resources:
type: list
description: resource A VCF containing known SNP and or INDEL sites. Can be supplied as many times as necessary
pattern: "*.vcf.gz"
- resources_index:
type: list
description: Index of resource VCF containing known SNP and or INDEL sites. Can be supplied as many times as necessary
pattern: "*.vcf.gz"
- fasta:
type: file
description: The reference fasta file
pattern: "*.fasta"
- fai:
type: file
description: Index of reference fasta file
pattern: "fasta.fai"
- 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"
- vcf:
type: file
description: VCF file
pattern: "*.vcf.gz"
- tbi:
type: file
description: VCF index file
pattern: "*.vcf.gz.tbi"
authors:
- "@FriederikeHanssen"

View file

@ -24,7 +24,7 @@ process PICARD_COLLECTHSMETRICS {
script: script:
def args = task.ext.args ?: '' def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}" def prefix = task.ext.prefix ?: "${meta.id}"
def reference = fasta ? "-R $fasta" : "" def reference = fasta ? "--REFERENCE_SEQUENCE ${fasta}" : ""
def avail_mem = 3 def avail_mem = 3
if (!task.memory) { if (!task.memory) {

View file

@ -22,6 +22,7 @@ process PICARD_COLLECTMULTIPLEMETRICS {
script: script:
def args = task.ext.args ?: '' def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}" def prefix = task.ext.prefix ?: "${meta.id}"
def reference = fasta ? "--REFERENCE_SEQUENCE ${fasta}" : ""
def avail_mem = 3 def avail_mem = 3
if (!task.memory) { if (!task.memory) {
log.info '[Picard CollectMultipleMetrics] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.' log.info '[Picard CollectMultipleMetrics] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
@ -35,7 +36,7 @@ process PICARD_COLLECTMULTIPLEMETRICS {
$args \\ $args \\
--INPUT $bam \\ --INPUT $bam \\
--OUTPUT ${prefix}.CollectMultipleMetrics \\ --OUTPUT ${prefix}.CollectMultipleMetrics \\
--REFERENCE_SEQUENCE $fasta $reference
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
"${task.process}": "${task.process}":

View file

@ -34,7 +34,7 @@ process PICARD_COLLECTWGSMETRICS {
$args \\ $args \\
--INPUT $bam \\ --INPUT $bam \\
--OUTPUT ${prefix}.CollectWgsMetrics.coverage_metrics \\ --OUTPUT ${prefix}.CollectWgsMetrics.coverage_metrics \\
--REFERENCE_SEQUENCE $fasta --REFERENCE_SEQUENCE ${fasta}
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml

View file

@ -759,6 +759,10 @@ gatk4/filtermutectcalls:
- modules/gatk4/filtermutectcalls/** - modules/gatk4/filtermutectcalls/**
- tests/modules/gatk4/filtermutectcalls/** - tests/modules/gatk4/filtermutectcalls/**
gatk4/filtervarianttranches:
- modules/gatk4/filtervarianttranches/**
- tests/modules/gatk4/filtervarianttranches/**
gatk4/gatherbqsrreports: gatk4/gatherbqsrreports:
- modules/gatk4/gatherbqsrreports/** - modules/gatk4/gatherbqsrreports/**
- tests/modules/gatk4/gatherbqsrreports/** - tests/modules/gatk4/gatherbqsrreports/**

View file

@ -266,6 +266,8 @@ params {
test2_haplotc_ann_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz" test2_haplotc_ann_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz"
test2_haplotc_ann_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi" test2_haplotc_ann_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.ann.vcf.gz.tbi"
test_haplotc_cnn_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz"
test_haplotc_cnn_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test_haplotcaller.cnn.vcf.gz.tbi"
test2_haplotc_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz" test2_haplotc_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz"
test2_haplotc_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz.tbi" test2_haplotc_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz.tbi"

View file

@ -7,7 +7,8 @@ include { GATK4_CNNSCOREVARIANTS } from '../../../../modules/gatk4/cnnscorevaria
workflow test_gatk4_cnnscorevariants { workflow test_gatk4_cnnscorevariants {
input = [ [ id:'test' ], // meta map input = [ [ id:'test' ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf'], checkIfExists: true), file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_genome_vcf_gz_tbi'], checkIfExists: true),
[], [],
[] []
] ]

View file

@ -1,9 +1,9 @@
- name: gatk4 cnnscorevariants test_gatk4_cnnscorevariants - name: gatk4 cnnscorevariants test_gatk4_cnnscorevariants
command: nextflow run ./tests/modules/gatk4/cnnscorevariants -entry test_gatk4_cnnscorevariants -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/cnnscorevariants/nextflow.config command: nextflow run ./tests/modules/gatk4/cnnscorevariants -entry test_gatk4_cnnscorevariants -c ./tests/config/nextflow.config -c ./tests/modules/gatk4/cnnscorevariants/nextflow.config
tags: tags:
- gatk4
- gatk4/cnnscorevariants - gatk4/cnnscorevariants
- gatk4
files: files:
- path: output/gatk4/test.vcf.gz - path: output/gatk4/test.cnn.vcf.gz
contains: contains: ["##ALT=<ID=NON_REF,Description="]
- "##ALT=<ID=NON_REF,Description=" - path: output/gatk4/test.cnn.vcf.gz.tbi

View file

@ -0,0 +1,26 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { GATK4_FILTERVARIANTTRANCHES } from '../../../../modules/gatk4/filtervarianttranches/main.nf'
include { GATK4_CNNSCOREVARIANTS } from '../../../../modules/gatk4/cnnscorevariants/main.nf'
include { GATK4_HAPLOTYPECALLER } from '../../../../modules/gatk4/haplotypecaller/main.nf'
workflow test_gatk4_filtervarianttranches {
resources = [ file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz'], checkIfExists: true) ]
resources_index = [
file(params.test_data['homo_sapiens']['genome']['dbsnp_146_hg38_vcf_gz_tbi'], checkIfExists: true),
]
input = [ [ id:'test' ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_haplotc_cnn_vcf_gz_tbi'], checkIfExists: true),
[]
]
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
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_FILTERVARIANTTRANCHES (input , resources, resources_index, fasta, fai, dict)
}

View file

@ -0,0 +1,6 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
ext.args = "--info-key CNN_1D"
}

View file

@ -0,0 +1,9 @@
- name: gatk4 filtervarianttranches test_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/filtervarianttranches
- gatk4
files:
- path: output/gatk4/test.filtered.vcf.gz
- path: output/gatk4/test.filtered.vcf.gz.tbi
- path: output/gatk4/versions.yml

View file

@ -16,3 +16,14 @@ workflow test_picard_collecthsmetrics {
PICARD_COLLECTHSMETRICS ( input, fasta, fai, bait_intervals, target_intervals ) PICARD_COLLECTHSMETRICS ( input, fasta, fai, bait_intervals, target_intervals )
} }
workflow test_picard_collecthsmetrics_nofasta {
input = [ [ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) ]
bait_intervals = file(params.test_data['sarscov2']['genome']['baits_interval_list'], checkIfExists: true)
target_intervals = file(params.test_data['sarscov2']['genome']['targets_interval_list'], checkIfExists: true)
PICARD_COLLECTHSMETRICS ( input, [], [], bait_intervals, target_intervals )
}

View file

@ -1,8 +1,15 @@
- name: picard collecthsmetrics test_picard_collecthsmetrics - name: picard collecthsmetrics test_picard_collecthsmetrics
command: nextflow run ./tests/modules/picard/collecthsmetrics -entry test_picard_collecthsmetrics -c ./tests/config/nextflow.config -c ./tests/modules/picard/collecthsmetrics/nextflow.config command: nextflow run ./tests/modules/picard/collecthsmetrics -entry test_picard_collecthsmetrics -c ./tests/config/nextflow.config -c ./tests/modules/picard/collecthsmetrics/nextflow.config
tags: tags:
- picard
- picard/collecthsmetrics - picard/collecthsmetrics
- picard
files:
- path: output/picard/test.CollectHsMetrics.coverage_metrics
- name: picard collecthsmetrics test_picard_collecthsmetrics_nofasta
command: nextflow run ./tests/modules/picard/collecthsmetrics -entry test_picard_collecthsmetrics_nofasta -c ./tests/config/nextflow.config -c ./tests/modules/picard/collecthsmetrics/nextflow.config
tags:
- picard/collecthsmetrics
- picard
files: files:
# The file can't be md5'd consistently
- path: output/picard/test.CollectHsMetrics.coverage_metrics - path: output/picard/test.CollectHsMetrics.coverage_metrics

View file

@ -5,10 +5,20 @@ nextflow.enable.dsl = 2
include { PICARD_COLLECTMULTIPLEMETRICS } from '../../../../modules/picard/collectmultiplemetrics/main.nf' include { PICARD_COLLECTMULTIPLEMETRICS } from '../../../../modules/picard/collectmultiplemetrics/main.nf'
workflow test_picard_collectmultiplemetrics { workflow test_picard_collectmultiplemetrics {
input = [ [ id:'test', single_end:false ], // meta map input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true)
] ]
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
PICARD_COLLECTMULTIPLEMETRICS ( input, fasta ) PICARD_COLLECTMULTIPLEMETRICS ( input, fasta )
} }
workflow test_picard_collectmultiplemetrics_nofasta {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true)
]
PICARD_COLLECTMULTIPLEMETRICS ( input, [] )
}

View file

@ -1,17 +1,33 @@
- name: picard collectmultiplemetrics - name: picard collectmultiplemetrics test_picard_collectmultiplemetrics
command: nextflow run ./tests/modules/picard/collectmultiplemetrics -entry test_picard_collectmultiplemetrics -c ./tests/config/nextflow.config -c ./tests/modules/picard/collectmultiplemetrics/nextflow.config command: nextflow run ./tests/modules/picard/collectmultiplemetrics -entry test_picard_collectmultiplemetrics -c ./tests/config/nextflow.config -c ./tests/modules/picard/collectmultiplemetrics/nextflow.config
tags: tags:
- picard - picard
- picard/collectmultiplemetrics - picard/collectmultiplemetrics
files: files:
# These can't be md5'd consistently - path: output/picard/test.CollectMultipleMetrics.alignment_summary_metrics
- path: ./output/picard/test.CollectMultipleMetrics.alignment_summary_metrics - path: output/picard/test.CollectMultipleMetrics.base_distribution_by_cycle.pdf
- path: ./output/picard/test.CollectMultipleMetrics.insert_size_metrics - path: output/picard/test.CollectMultipleMetrics.base_distribution_by_cycle_metrics
- path: ./output/picard/test.CollectMultipleMetrics.quality_distribution_metrics - path: output/picard/test.CollectMultipleMetrics.insert_size_histogram.pdf
- path: ./output/picard/test.CollectMultipleMetrics.quality_by_cycle_metrics - path: output/picard/test.CollectMultipleMetrics.insert_size_metrics
- path: ./output/picard/test.CollectMultipleMetrics.base_distribution_by_cycle_metrics - path: output/picard/test.CollectMultipleMetrics.quality_by_cycle.pdf
- path: ./output/picard/test.CollectMultipleMetrics.quality_by_cycle.pdf - path: output/picard/test.CollectMultipleMetrics.quality_by_cycle_metrics
- path: ./output/picard/test.CollectMultipleMetrics.quality_distribution.pdf - path: output/picard/test.CollectMultipleMetrics.quality_distribution.pdf
- path: ./output/picard/test.CollectMultipleMetrics.read_length_histogram.pdf - path: output/picard/test.CollectMultipleMetrics.quality_distribution_metrics
- path: ./output/picard/test.CollectMultipleMetrics.base_distribution_by_cycle.pdf - path: output/picard/test.CollectMultipleMetrics.read_length_histogram.pdf
- path: ./output/picard/test.CollectMultipleMetrics.insert_size_histogram.pdf
- name: picard collectmultiplemetrics test_picard_collectmultiplemetrics_nofasta
command: nextflow run ./tests/modules/picard/collectmultiplemetrics -entry test_picard_collectmultiplemetrics_nofasta -c ./tests/config/nextflow.config -c ./tests/modules/picard/collectmultiplemetrics/nextflow.config
tags:
- picard
- picard/collectmultiplemetrics
files:
- path: output/picard/test.CollectMultipleMetrics.alignment_summary_metrics
- path: output/picard/test.CollectMultipleMetrics.base_distribution_by_cycle.pdf
- path: output/picard/test.CollectMultipleMetrics.base_distribution_by_cycle_metrics
- path: output/picard/test.CollectMultipleMetrics.insert_size_histogram.pdf
- path: output/picard/test.CollectMultipleMetrics.insert_size_metrics
- path: output/picard/test.CollectMultipleMetrics.quality_by_cycle.pdf
- path: output/picard/test.CollectMultipleMetrics.quality_by_cycle_metrics
- path: output/picard/test.CollectMultipleMetrics.quality_distribution.pdf
- path: output/picard/test.CollectMultipleMetrics.quality_distribution_metrics
- path: output/picard/test.CollectMultipleMetrics.read_length_histogram.pdf

View file

@ -5,7 +5,3 @@
- picard - picard
files: files:
- path: output/picard/test.CollectWgsMetrics.coverage_metrics - path: output/picard/test.CollectWgsMetrics.coverage_metrics
contains:
- "GENOME_TERRITORY"
- "29829"
- "17554"