Picard fixmateinformation (#1315)

* add picard-fixmateinformation

* add picard-fixmateinformation

* fix trailing whitespace

* fix trailing whitespace

Co-authored-by: Peri <rrx8@cdc.gov>
Co-authored-by: Robert A. Petit III <robbie.petit@gmail.com>
This commit is contained in:
Sateesh 2022-02-18 20:18:05 -05:00 committed by GitHub
parent be798861c6
commit f655e5dea2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 121 additions and 0 deletions

View file

@ -0,0 +1,43 @@
process PICARD_FIXMATEINFORMATION {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::picard=2.26.9" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/picard:2.26.9--hdfd78af_0' :
'quay.io/biocontainers/picard:2.26.9--hdfd78af_0' }"
input:
tuple val(meta), path(bam)
output:
tuple val(meta), path("*.bam"), emit: bam
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 STRINGENCY = task.ext.stringency ?: "STRICT"
def avail_mem = 3
if (!task.memory) {
log.info '[Picard FixMateInformation] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
picard \\
FixMateInformation \\
-Xmx${avail_mem}g \\
-I ${bam} \\
-O ${prefix}.bam \\
--VALIDATION_STRINGENCY ${STRINGENCY}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
picard: \$(picard FixMateInformation --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:)
END_VERSIONS
"""
}

View file

@ -0,0 +1,44 @@
name: picard_fixmateinformation
description: Verify mate-pair information between mates and fix if needed
keywords:
- mate-pair
tools:
- picard:
description: |
A set of command line tools (in Java) for manipulating high-throughput sequencing (HTS)
data and formats such as SAM/BAM/CRAM and VCF.
homepage: https://broadinstitute.github.io/picard/
documentation: https://gatk.broadinstitute.org/hc/en-us/articles/360036713471-FixMateInformation-Picard-
tool_dev_url: https://github.com/broadinstitute/picard
licence: ['MIT']
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- bam:
type: file
description: BAM file
pattern: "*.{bam}"
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: mate-pair verified BAM file
pattern: "*.{bam}"
authors:
- "@sateeshperi"
- "@mjcipriano"
- "@hseabolt"

View file

@ -1173,6 +1173,10 @@ picard/filtersamreads:
- modules/picard/filtersamreads/** - modules/picard/filtersamreads/**
- tests/modules/picard/filtersamreads/** - tests/modules/picard/filtersamreads/**
picard/fixmateinformation:
- modules/picard/fixmateinformation/**
- tests/modules/picard/fixmateinformation/**
picard/markduplicates: picard/markduplicates:
- modules/picard/markduplicates/** - modules/picard/markduplicates/**
- tests/modules/picard/markduplicates/** - tests/modules/picard/markduplicates/**

View file

@ -0,0 +1,15 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { PICARD_FIXMATEINFORMATION } from '../../../../modules/picard/fixmateinformation/main.nf'
workflow test_picard_fixmateinformation {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true)
]
PICARD_FIXMATEINFORMATION ( input )
}

View file

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

View file

@ -0,0 +1,10 @@
- name: picard fixmateinformation test_picard_fixmateinformation
command: nextflow run tests/modules/picard/fixmateinformation -entry test_picard_fixmateinformation -c tests/config/nextflow.config
tags:
- picard
- picard/fixmateinformation
files:
- path: output/picard/test.bam
md5sum: 746102e8c242c0ef42e045c49d320030
- path: output/picard/versions.yml
md5sum: 4329ba7cdca8f4f6018dfd5c019ba2eb