New Module: atlas/recal (#1915)

* commit 08/07

* fixed formatting

* atlas recal commit - corrected formatting

* Fix tests

* Fix meta.yml

* Prettier

* Delete nextflow

* yaml > yml

* Delete meta.yaml

* Fix test

* Forgot to run prettier?

Co-authored-by: ltcrod <luca_traverso@kickseed.localdomain>
Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
This commit is contained in:
Luca Traverso 2022-07-22 15:36:53 +02:00 committed by GitHub
parent e5b44499ef
commit c9dc0a82d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 143 additions and 0 deletions

View file

@ -0,0 +1,46 @@
process ATLAS_RECAL {
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(empiric), path(readgroups)
path(alleles)
path(invariant_sites)
output:
tuple val(meta), path("*.txt"), emit:recal_patterns
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 PMD = empiric ? "pmdFile=${empiric}" : ""
def ALLELES = alleles ? "alleleFile=${alleles}" : ""
def INVARIANTS = invariant_sites ? "window=${invariant_sites}" : ""
def READGROUPS = readgroups ? "poolReadGroups=${readgroups}" : ""
"""
atlas \\
task=recal \\
bam=$bam \\
$PMD \\
$READGROUPS \\
$ALLELES \\
$INVARIANTS \\
out=$prefix \\
$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,58 @@
name: "atlas_recal"
description: gives an estimation of the sequencing bias based on known invariant sites
keywords:
- sequencing_bias
- ATLAS
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: "None"
doi: "https://doi.org/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: BAM file
pattern: "*.bam"
- bai:
type: file
description: BAI file
pattern: "*.bai"
- empiric:
type: file
description: Optional txt file from PMD estimations (atlas/pmd)
pattern: "*.txt"
- alleles:
type: file
descrition: Optional bed file with known alleles
pattern: "*.bed"
- invariant_sites:
type: file
descrition: Optional bed file with invariant site coordinates
pattern: "*.bed"
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"
- recal_patterns:
type: file
description: file containing the sequencing bias for each of the Read Group pools
pattern: "*.txt"
authors:
- "@ltcrod"

View file

@ -98,6 +98,10 @@ atlas/pmd:
- modules/atlas/pmd/**
- tests/modules/atlas/pmd/**
atlas/recal:
- modules/atlas/recal/**
- tests/modules/atlas/recal/**
atlas/splitmerge:
- modules/atlas/splitmerge/**
- tests/modules/atlas/splitmerge/**

View file

@ -0,0 +1,22 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { ATLAS_RECAL } from '../../../../modules/atlas/recal/main.nf'
workflow test_atlas_recal {
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),
[],
[]
]
alleles = []
invariant_sites = []
ATLAS_RECAL ( input, alleles, invariant_sites )
}

View file

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

View file

@ -0,0 +1,8 @@
- name: atlas recal test_atlas_recal
command: nextflow run ./tests/modules/atlas/recal -entry test_atlas_recal -c ./tests/config/nextflow.config -c ./tests/modules/atlas/recal/nextflow.config
tags:
- atlas/recal
- atlas
files:
- path: output/atlas/test_recalibrationEM.txt
contains: ["readGroup"]