Add Atlas/PMD (#1810)

* add atlas/pmd
* update atlas/pmd tests
* Add atlas/PMD module
* Remove comment
* Run Prettier
* Incorporate Review by @jfy133

Co-authored-by: maxibor <maxime.borry@gmail.com>
Co-authored-by: Maxime Borry <maxibor@users.noreply.github.com>
Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
This commit is contained in:
Merlin Szymanski 2022-06-24 16:53:51 +02:00 committed by GitHub
parent 9b51362a53
commit b6fe5d2643
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 167 additions and 0 deletions

42
modules/atlas/pmd/main.nf Normal file
View file

@ -0,0 +1,42 @@
process ATLAS_PMD {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::atlas=0.9.9" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/atlas:0.9.9--h082e891_0':
'quay.io/biocontainers/atlas:0.9.9--h082e891_0' }"
input:
tuple val(meta), path(bam), path(bai), path(pool_rg_txt)
path(fasta)
path(fai)
output:
tuple val(meta), path("*_PMD_input_Empiric.txt") , emit: empiric
tuple val(meta), path("*_PMD_input_Exponential.txt"), emit: exponential
tuple val(meta), path("*_PMD_Table_counts.txt") , emit: counts
tuple val(meta), path("*_PMD_Table.txt") , emit: table
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 pool_rg_txt = pool_rg_txt ? "poolReadGroups=${pool_rg_txt}" : ""
"""
atlas \\
$pool_rg_txt \\
task=PMD \\
bam=${bam} \\
fasta=${fasta} \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
atlas: \$((atlas 2>&1) | grep Atlas | head -n 1 | sed -e 's/^[ \t]*Atlas //')
END_VERSIONS
"""
}

View file

@ -0,0 +1,83 @@
name: "atlas_pmd"
description: Estimate the post-mortem damage patterns of DNA
keywords:
- ancient DNA
- post mortem damage
- bam
tools:
- "atlas":
description: "ATLAS, a suite of methods to accurately genotype and estimate genetic diversity"
homepage: "https://bitbucket.org/wegmannlab/atlas/wiki/Home"
documentation: "https://bitbucket.org/wegmannlab/atlas/wiki/Home"
tool_dev_url: "https://bitbucket.org/wegmannlab/atlas"
doi: "10.1101/105346"
licence: "['GPL v3']"
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- bam:
type: file
description: Single input BAM file
pattern: "*.bam"
- bai:
type: file
description: The BAI file for the input BAM file
pattern: "*.bai"
- fasta:
type: file
description: The reference genome provided as FASTA file
pattern: "*.fasta"
- fai:
type: file
description: The FAI file for the reference genome FASTA file
pattern: "*.fai"
- pool_rg_txt:
type: file
description: |
Optional. Provide the names of read groups that should be merged for PMD estimation.
All read groups that should be pooled listed on one line, separated by any white space.
Other read groups will be recalibrated separately.
pattern: "*.txt"
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"
- empiric:
type: file
description: A list of pmd patterns estimated with the empirical method for each readgroup
pattern: "*_PMD_input_Empiric.txt"
- exponential:
type: file
description: A list of pmd patterns estimated with the exponential method for each readgroup
pattern: "*_PMD_input_Exponential.txt"
- counts:
type: file
description: |
The counts of all possible transitions for each read position
(or up to a certain position, see specific command length)
pattern: "*_PMD_Table_counts.txt"
- table:
type: file
description: |
For all possible transitions the ratio of the transition counts,
which are taken from the _counts.txt table, over the total amount
of the base that was mutated, for each position and readgroup
pattern: "*_PMD_Table.txt"
authors:
- "@maxibor"
- "@merszym"

View file

@ -86,6 +86,10 @@ ataqv/ataqv:
- modules/ataqv/ataqv/** - modules/ataqv/ataqv/**
- tests/modules/ataqv/ataqv/** - tests/modules/ataqv/ataqv/**
atlas/pmd:
- modules/atlas/pmd/**
- tests/modules/atlas/pmd/**
atlas/splitmerge: atlas/splitmerge:
- modules/atlas/splitmerge/** - modules/atlas/splitmerge/**
- tests/modules/atlas/splitmerge/** - tests/modules/atlas/splitmerge/**

View file

@ -0,0 +1,19 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { ATLAS_PMD } from '../../../../modules/atlas/pmd/main.nf'
workflow test_atlas_pmd {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true),
[]
]
fasta = file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
fai = file(params.test_data['homo_sapiens']['genome']['genome_fasta_fai'], checkIfExists: true)
ATLAS_PMD ( input, fasta, fai )
}

View file

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

View file

@ -0,0 +1,14 @@
- name: atlas pmd test_atlas_pmd
command: nextflow run ./tests/modules/atlas/pmd -entry test_atlas_pmd -c ./tests/config/nextflow.config -c ./tests/modules/atlas/pmd/nextflow.config
tags:
- atlas/pmd
- atlas
files:
- path: output/atlas/test.paired_end.sorted_PMD_Table.txt
md5sum: b28a9f4784f30a711046708eb7d94642
- path: output/atlas/test.paired_end.sorted_PMD_Table_counts.txt
md5sum: 1aabfb83cfff6e0413f52d016c943e3e
- path: output/atlas/test.paired_end.sorted_PMD_input_Empiric.txt
md5sum: 8ff876f50ce05dc9aac0646a31682df0
- path: output/atlas/test.paired_end.sorted_PMD_input_Exponential.txt
md5sum: 2421450ef643316f4eacf5cb811e4df7