feat(bbmap): Initialize pileup module (#1441)

* feat(bbmap): Initialize pileup module

* test(bbmap): Update outputs

* test(bbmap): Add pileup tags

* style(bbmap): Add in when

Co-authored-by: Robert A. Petit III <robbie.petit@gmail.com>
This commit is contained in:
Edmund Miller 2022-03-24 18:38:24 -05:00 committed by GitHub
parent fe088745e0
commit 6806cd1de9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 122 additions and 0 deletions

View file

@ -0,0 +1,39 @@
process BBMAP_PILEUP {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::bbmap=38.92 bioconda::samtools=1.13 pigz=2.6" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-008daec56b7aaf3f162d7866758142b9f889d690:f5f55fc5623bb7b3f725e8d2f86bedacfd879510-0' :
'quay.io/biocontainers/mulled-v2-008daec56b7aaf3f162d7866758142b9f889d690:f5f55fc5623bb7b3f725e8d2f86bedacfd879510-0' }"
input:
tuple val(meta), path(bam)
output:
tuple val(meta), path("*.stats.txt"), emit: covstats
tuple val(meta), path("*.hist.txt") , emit: hist
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}"
"""
pileup.sh \\
-Xmx${task.memory.toGiga()}g \\
in=${bam} \\
out=${prefix}.coverage.stats.txt \\
hist=${prefix}.coverage.hist.txt \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
bbmap: \$(bbversion.sh)
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
pigz: \$( pigz --version 2>&1 | sed 's/pigz //g' )
END_VERSIONS
"""
}

View file

@ -0,0 +1,47 @@
name: "bbmap_pileup"
description: Calculates per-scaffold or per-base coverage information from an unsorted sam or bam file.
keywords:
- fasta
- genome
- coverage
tools:
- bbmap:
description: BBMap is a short read aligner, as well as various other bioinformatic tools.
homepage: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/
documentation: https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/
tool_dev_url: "https://github.com/BioInfoTools/BBMap/blob/master/sh/pileup.sh"
doi: ""
licence: ["UC-LBL license (see package)"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- bam:
type: file
description: BAM/CRAM/SAM file
pattern: "*.{bam,cram,sam}"
output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- stats:
type: file
description: Per-scaffold coverage info
pattern: "*.stats.txt"
- hist:
type: file
description: "Histogram of # occurrences of each depth level"
pattern: "*.hist.txt"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@Emiller88"

View file

@ -106,6 +106,10 @@ bbmap/index:
- modules/bbmap/index/** - modules/bbmap/index/**
- tests/modules/bbmap/index/** - tests/modules/bbmap/index/**
bbmap/pileup:
- modules/bbmap/pileup/**
- tests/modules/bbmap/pileup/**
bcftools/annotate: bcftools/annotate:
- modules/bcftools/annotate/** - modules/bcftools/annotate/**
- tests/modules/bcftools/annotate/** - tests/modules/bcftools/annotate/**

View file

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

View file

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

View file

@ -0,0 +1,12 @@
- name: "bbmap pileup"
command: nextflow run ./tests/modules/bbmap/pileup -entry test_bbmap_pileup -c ./tests/config/nextflow.config -c ./tests/modules/bbmap/pileup/nextflow.config
tags:
- "bbmap"
- "bbmap/pileup"
files:
- path: "output/bbmap/test.coverage.stats.txt"
md5sum: c3fc9d0681589b69e3301ca3cb27b7a4
- path: "output/bbmap/test.coverage.hist.txt"
md5sum: 96915920ef42ddc9483457dd4585a088
- path: output/bbmap/versions.yml
md5sum: 894acc38bdc167dc22851df15e5a8453