Picard cleansam (#1306)

* add picard-cleansam

* add picard/cleansam

* update test yml with output

* picard 2.26.10 -> 2.26.9

* add output to test yml

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 21:17:58 -05:00 committed by GitHub
parent 62e5d1f0b3
commit 927dbfed04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 124 additions and 0 deletions

View file

@ -0,0 +1,44 @@
process PICARD_CLEANSAM {
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(sam)
output:
tuple val(meta), path("*.sam"), emit: sam
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 CleanSam] Available memory not known - defaulting to 3GB. Specify process memory requirements to change this.'
} else {
avail_mem = task.memory.giga
}
"""
picard \\
-Xmx${avail_mem}g \\
CleanSam \\
${args} \\
-I ${sam} \\
-O ${prefix}.sam \\
--VALIDATION_STRINGENCY ${STRINGENCY}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
picard: \$(picard CleanSam --version 2>&1 | grep -o 'Version:.*' | cut -f2- -d:)
END_VERSIONS
"""
}

View file

@ -0,0 +1,46 @@
name: picard_cleansam
description: Cleans the provided SAM/BAM, soft-clipping beyond-end-of-reference alignments and setting MAPQ to 0 for unmapped reads
keywords:
- clean
- sam
- bam
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/360036491452-CleanSam-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 ]
- sam:
type: file
description: SAM file
pattern: "*.{sam}"
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"
- sam:
type: file
description: Cleaned SAM file
pattern: "*.{sam}"
authors:
- "@sateeshperi"
- "@mjcipriano"
- "@hseabolt"

View file

@ -1157,6 +1157,10 @@ phyloflash:
- modules/phyloflash/**
- tests/modules/phyloflash/**
picard/cleansam:
- modules/picard/cleansam/**
- tests/modules/picard/cleansam/**
picard/collecthsmetrics:
- modules/picard/collecthsmetrics/**
- tests/modules/picard/collecthsmetrics/**

View file

@ -0,0 +1,15 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { PICARD_CLEANSAM } from '../../../../modules/picard/cleansam/main.nf'
workflow test_picard_cleansam {
input = [
[ id:'test', single_end:true ], // meta map
file(params.test_data['sarscov2']['illumina']['test_single_end_bam'], checkIfExists: true)
]
PICARD_CLEANSAM ( 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 cleansam test_picard_cleansam
command: nextflow run tests/modules/picard/cleansam -entry test_picard_cleansam -c tests/config/nextflow.config
tags:
- picard/cleansam
- picard
files:
- path: output/picard/test.sam
md5sum: e314171a6060eb79947c13ad126ddf00
- path: output/picard/versions.yml
md5sum: e6457d7c6de51bf6f4b577eda65e57ac