mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
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:
parent
bf5edb8614
commit
2d4b0f7787
6 changed files with 109 additions and 0 deletions
32
modules/bcftools/sort/main.nf
Normal file
32
modules/bcftools/sort/main.nf
Normal 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
|
||||||
|
"""
|
||||||
|
}
|
43
modules/bcftools/sort/meta.yml
Normal file
43
modules/bcftools/sort/meta.yml
Normal 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"
|
|
@ -114,6 +114,10 @@ bcftools/reheader:
|
||||||
- modules/bcftools/reheader/**
|
- modules/bcftools/reheader/**
|
||||||
- tests/modules/bcftools/reheader/**
|
- tests/modules/bcftools/reheader/**
|
||||||
|
|
||||||
|
bcftools/sort:
|
||||||
|
- modules/bcftools/sort/**
|
||||||
|
- tests/modules/bcftools/sort/**
|
||||||
|
|
||||||
bcftools/stats:
|
bcftools/stats:
|
||||||
- modules/bcftools/stats/**
|
- modules/bcftools/stats/**
|
||||||
- tests/modules/bcftools/stats/**
|
- tests/modules/bcftools/stats/**
|
||||||
|
|
15
tests/modules/bcftools/sort/main.nf
Normal file
15
tests/modules/bcftools/sort/main.nf
Normal 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 )
|
||||||
|
}
|
5
tests/modules/bcftools/sort/nextflow.config
Normal file
5
tests/modules/bcftools/sort/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
process {
|
||||||
|
|
||||||
|
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||||
|
|
||||||
|
}
|
10
tests/modules/bcftools/sort/test.yml
Normal file
10
tests/modules/bcftools/sort/test.yml
Normal 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
|
Loading…
Reference in a new issue