Merge branch 'master' into haplocheck

This commit is contained in:
Taniguti 2022-05-13 11:24:10 -03:00 committed by GitHub
commit ac7fe89a78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 229 additions and 12 deletions

View file

@ -69,4 +69,3 @@ process BOWTIE2_ALIGN {
END_VERSIONS
"""
}

View file

@ -0,0 +1,48 @@
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(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 SplitIntervals] 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 \\
--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,53 @@
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}"
- fasta:
type: file
description: Reference FASTA
pattern: "*.{fa,fasta}"
- fasta_fai:
type: file
description: Reference FASTA index
pattern: "*.fai"
- dict:
type: file
description: Reference sequence dictionary
pattern: "*.dict"
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"

View file

@ -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/**

View file

@ -33,3 +33,32 @@ workflow test_bowtie2_align_paired_end {
BOWTIE2_BUILD ( fasta )
BOWTIE2_ALIGN ( input, BOWTIE2_BUILD.out.index, save_unaligned )
}
workflow test_bowtie2_align_single_end_large_index {
input = [
[ id:'test', single_end:true ], // meta map
[
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true)
]
]
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
save_unaligned = false
BOWTIE2_BUILD ( fasta )
BOWTIE2_ALIGN ( input, BOWTIE2_BUILD.out.index, save_unaligned )
}
workflow test_bowtie2_align_paired_end_large_index {
input = [
[ id:'test', single_end:false ], // meta map
[
file(params.test_data['sarscov2']['illumina']['test_1_fastq_gz'], checkIfExists: true),
file(params.test_data['sarscov2']['illumina']['test_2_fastq_gz'], checkIfExists: true)
]
]
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
save_unaligned = false
BOWTIE2_BUILD ( fasta )
BOWTIE2_ALIGN ( input, BOWTIE2_BUILD.out.index, save_unaligned )
}

View file

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

View file

@ -1,21 +1,39 @@
- name: bowtie2 align test_bowtie2_align_single_end
command: nextflow run ./tests/modules/bowtie2/align -entry test_bowtie2_align_single_end -c ./tests/config/nextflow.config -c ./tests/modules/bowtie2/align/nextflow.config
tags:
- bowtie2/align
- bowtie2
- bowtie2/align
files:
- path: output/bowtie2/test.bam
- path: output/bowtie2/test.bowtie2.log
md5sum: 7b8a9e61b7646da1089b041333c41a87
- path: output/bowtie2/versions.yml
- path: ./output/bowtie2/test.bam
- path: ./output/bowtie2/test.bowtie2.log
- path: ./output/bowtie2/versions.yml
- name: bowtie2 align test_bowtie2_align_paired_end
command: nextflow run ./tests/modules/bowtie2/align -entry test_bowtie2_align_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/bowtie2/align/nextflow.config
command: nextflow run tests/modules/bowtie2/align -entry test_bowtie2_align_paired_end -c tests/config/nextflow.config -c tests/modules/bowtie2/align/nextflow.config
tags:
- bowtie2/align
- bowtie2
- bowtie2/align
files:
- path: output/bowtie2/test.bam
- path: output/bowtie2/test.bowtie2.log
md5sum: bd89ce1b28c93bf822bae391ffcedd19
- path: output/bowtie2/versions.yml
- path: ./output/bowtie2/test.bam
- path: ./output/bowtie2/test.bowtie2.log
- path: ./output/bowtie2/versions.yml
- name: bowtie2 align test_bowtie2_align_single_end_large_index
command: nextflow run tests/modules/bowtie2/align -entry test_bowtie2_align_single_end_large_index -c tests/config/nextflow.config -c tests/modules/bowtie2/align/nextflow.config --force_large_index
tags:
- bowtie2
- bowtie2/align
files:
- path: ./output/bowtie2/test.bam
- path: ./output/bowtie2/test.bowtie2.log
- path: ./output/bowtie2/versions.yml
- name: bowtie2 align test_bowtie2_align_paired_end_large_index
command: nextflow run tests/modules/bowtie2/align -entry test_bowtie2_align_paired_end_large_index -c tests/config/nextflow.config -c tests/modules/bowtie2/align/nextflow.config --force_large_index
tags:
- bowtie2
- bowtie2/align
files:
- path: ./output/bowtie2/test.bam
- path: ./output/bowtie2/test.bowtie2.log
- path: ./output/bowtie2/versions.yml

View 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)
}

View file

@ -0,0 +1,9 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName: GATK4_SPLITINTERVALS {
ext.args = "--scatter-count 2"
}
}

View file

@ -0,0 +1,23 @@
- 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
- 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