Bcftools sort new syntax (#1169)

* Added files for bcftools/sort

* Fixed output format and removed md5 checksum

* Change input to avoid identical in/output names

* Created rows for bcftools/sort in pytest_modules.yml
This commit is contained in:
Gwenna Breton 2022-01-05 12:15:54 +01:00 committed by GitHub
parent bf5edb8614
commit 2d4b0f7787
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 109 additions and 0 deletions

View file

@ -0,0 +1,32 @@
process BCFTOOLS_SORT {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::bcftools=1.14" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/bcftools:1.14--h88f3f91_0':
'quay.io/biocontainers/bcftools:1.14--h88f3f91_0' }"
input:
tuple val(meta), path(vcf)
output:
tuple val(meta), path("*.gz"), emit: vcf
path "versions.yml" , emit: versions
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
bcftools \\
sort \\
--output ${prefix}.vcf.gz \\
$args \\
$vcf
cat <<-END_VERSIONS > versions.yml
"${task.process}":
bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
END_VERSIONS
"""
}

View file

@ -0,0 +1,43 @@
name: bcftools_sort
description: Sorts VCF files
keywords:
- sorting
- VCF
- variant calling
tools:
- sort:
description: Sort VCF files by coordinates.
homepage: http://samtools.github.io/bcftools/bcftools.html
documentation: http://www.htslib.org/doc/bcftools.html
tool_dev_url: https://github.com/samtools/bcftools
doi: "10.1093/bioinformatics/btp352"
licence: ['MIT']
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- vcf:
type: file
description: The VCF/BCF file to be sorted
pattern: "*.{vcf.gz,vcf,bcf}"
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"
- vcf:
type: file
description: Sorted VCF file
pattern: "*.{vcf.gz}"
authors:
- "@Gwennid"

View file

@ -114,6 +114,10 @@ bcftools/reheader:
- modules/bcftools/reheader/**
- tests/modules/bcftools/reheader/**
bcftools/sort:
- modules/bcftools/sort/**
- tests/modules/bcftools/sort/**
bcftools/stats:
- modules/bcftools/stats/**
- tests/modules/bcftools/stats/**

View file

@ -0,0 +1,15 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { BCFTOOLS_SORT } from '../../../../modules/bcftools/sort/main.nf'
workflow test_bcftools_sort {
input = [
[ id:'test' ], // meta map
file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true)
]
BCFTOOLS_SORT ( 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: bcftools sort test_bcftools_sort
command: nextflow run tests/modules/bcftools/sort -entry test_bcftools_sort -c tests/config/nextflow.config
tags:
- bcftools
- bcftools/sort
files:
- path: output/bcftools/test.vcf.gz
md5sum: fc178eb342a91dc0d1d568601ad8f8e2
- path: output/bcftools/versions.yml
md5sum: f1bb553befa5108f81135b8fec613b6b