Skip to content
Snippets Groups Projects
Verified Commit e92a4085 authored by Mia Croiset's avatar Mia Croiset
Browse files

refactorisation remove gatk module

parent 35bdac8e
No related branches found
No related tags found
No related merge requests found
process GATK4_MARKDUPLICATES {
tag "$meta.id"
label 'process_medium'
conda "bioconda::gatk4=4.4.0.0"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/gatk4:4.4.0.0--py36hdfd78af_0':
'quay.io/biocontainers/gatk4:4.4.0.0--py36hdfd78af_0' }"
input:
tuple val(meta), path(bam)
path fasta
path fasta_fai
output:
tuple val(meta), path("*cram"), emit: cram, optional: true
tuple val(meta), path("*bam"), emit: bam, optional: true
tuple val(meta), path("*.crai"), emit: crai, optional: true
tuple val(meta), path("*.bai"), emit: bai, optional: true
tuple val(meta), path("*.metrics"), emit: metrics
path "versions.yml", emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def input_list = bam.collect{"--INPUT $it"}.join(' ')
def reference = fasta ? "--REFERENCE_SEQUENCE ${fasta}" : ""
def avail_mem = 3072
if (!task.memory) {
log.info '[GATK MarkDuplicates] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = (task.memory.mega*0.8).intValue()
}
"""
gatk --java-options "-Xmx${avail_mem}M" MarkDuplicates \\
$input_list \\
--OUTPUT ${prefix} \\
--METRICS_FILE ${prefix}.metrics \\
--TMP_DIR . \\
${reference} \\
$args
if [[ ${prefix} == *.cram ]]&&[[ -f ${prefix}.bai ]]; then
mv ${prefix}.bai ${prefix}.crai
fi
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gatk4: \$(echo \$(gatk --version 2>&1) | sed 's/^.*(GATK) v//; s/ .*\$//')
END_VERSIONS
"""
}
\ No newline at end of file
name: gatk4_markduplicates
description: This tool locates and tags duplicate reads in a BAM or SAM file, where duplicate reads are defined as originating from a single fragment of DNA.
keywords:
- markduplicates
- bam
- sort
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/articles/360037052812-MarkDuplicates-Picard-
tool_dev_url: https://github.com/broadinstitute/gatk
doi: 10.1158/1538-7445.AM2017-3590
licence: ["MIT"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- bam:
type: file
description: Sorted BAM file
pattern: "*.{bam}"
- fasta:
type: file
description: Fasta file
pattern: "*.{fasta}"
- fasta_fai:
type: file
description: Fasta index file
pattern: "*.{fai}"
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: Marked duplicates BAM file
pattern: "*.{bam}"
- cram:
type: file
description: Marked duplicates CRAM file
pattern: "*.{cram}"
- bai:
type: file
description: BAM index file
pattern: "*.{bam.bai}"
- crai:
type: file
description: CRAM index file
pattern: "*.{cram.crai}"
- metrics:
type: file
description: Duplicate metrics file generated by GATK
pattern: "*.{metrics.txt}"
authors:
- "@ajodeh-juma"
- "@FriederikeHanssen"
- "@maxulysse"
\ No newline at end of file
......@@ -8,7 +8,6 @@ include { BUILD_MATRIX_COOL_ALT } from '../../modules/local/hicstuff/build_matri
include { FILTER_EVENT } from '../../modules/local/hicstuff/filter_event'
include { DISTANCE_LAW } from '../../modules/local/hicstuff/distance_law'
include { FILTER_PCR } from '../../modules/local/hicstuff/filter_pcr'
include { GATK4_MARKDUPLICATES } from '../../modules/nf-core/custom/gatk4/markduplicates/main'
include { SAMTOOLS_SORT } from '../../modules/nf-core/custom/samtools/sort/main'
include { SAMTOOLS_SORT_N } from '../../modules/nf-core/custom/samtools_n/sort/main'
include { FILTER_PAIR } from '../../modules/local/filterbam/main'
......@@ -137,9 +136,6 @@ workflow HICSTUFF_SUB {
FILTER_PCR.out.idx_pairs_pcrfree.set{ ch_idx_pairs }
}
//TODO rajouter filtres + distance law + filtres PCR en options
// pour les PCR filter, soit le hicstuff soit PICARD
BUILD_MATRIX(
ch_idx_pairs,
FRAGMENT_ENZYME.out.fragments_list.collect()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment