mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
Merge pull request #1685 from genomic-medicine-sweden/rhocall
add bcftools/roh
This commit is contained in:
commit
00db06eb9e
6 changed files with 177 additions and 0 deletions
61
modules/bcftools/roh/main.nf
Normal file
61
modules/bcftools/roh/main.nf
Normal file
|
@ -0,0 +1,61 @@
|
|||
process BCFTOOLS_ROH {
|
||||
tag "$meta.id"
|
||||
label 'process_medium'
|
||||
|
||||
conda (params.enable_conda ? "bioconda::bcftools=1.15.1" : null)
|
||||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
||||
'https://depot.galaxyproject.org/singularity/bcftools:1.15.1--h0ea216a_0':
|
||||
'quay.io/biocontainers/bcftools:1.15.1--h0ea216a_0' }"
|
||||
|
||||
input:
|
||||
tuple val(meta), path(vcf), path(tbi)
|
||||
path af_file
|
||||
path genetic_map
|
||||
path regions_file
|
||||
path samples_file
|
||||
path targets_file
|
||||
|
||||
output:
|
||||
tuple val(meta), path("*.roh"), emit: roh
|
||||
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 af_read = af_file ? "--AF-file ${af_file}" : ''
|
||||
def gen_map = genetic_map ? "--genetic-map ${genetic_map}" : ''
|
||||
def reg_file = regions_file ? "--regions-file ${regions_file}" : ''
|
||||
def samp_file = samples_file ? "--samples-file ${samples_file}" : ''
|
||||
def targ_file = targets_file ? "--targets-file ${targets_file}" : ''
|
||||
"""
|
||||
bcftools \\
|
||||
roh \\
|
||||
$args \\
|
||||
$af_read \\
|
||||
$gen_map \\
|
||||
$reg_file \\
|
||||
$samp_file \\
|
||||
$targ_file \\
|
||||
-o ${prefix}.roh \\
|
||||
$vcf
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
|
||||
stub:
|
||||
def prefix = task.ext.prefix ?: "${meta.id}"
|
||||
"""
|
||||
touch ${prefix}.roh
|
||||
|
||||
cat <<-END_VERSIONS > versions.yml
|
||||
"${task.process}":
|
||||
bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
|
||||
END_VERSIONS
|
||||
"""
|
||||
}
|
55
modules/bcftools/roh/meta.yml
Normal file
55
modules/bcftools/roh/meta.yml
Normal file
|
@ -0,0 +1,55 @@
|
|||
name: "bcftools_roh"
|
||||
description: A program for detecting runs of homo/autozygosity. Only bi-allelic sites are considered.
|
||||
keywords:
|
||||
- roh
|
||||
tools:
|
||||
- "roh":
|
||||
description: "A program for detecting runs of homo/autozygosity. Only bi-allelic sites are considered."
|
||||
homepage: https://www.htslib.org/
|
||||
documentation: http://www.htslib.org/doc/bcftools.html
|
||||
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: VCF file
|
||||
pattern: "*.{vcf,.vcf.gz}"
|
||||
- af_file:
|
||||
type: file
|
||||
description: "Read allele frequencies from a tab-delimited file containing the columns: CHROM\tPOS\tREF,ALT\tAF."
|
||||
- genetic_map:
|
||||
type: file
|
||||
description: "Genetic map in the format required also by IMPUTE2."
|
||||
- regions_file:
|
||||
type: file
|
||||
description: "Regions can be specified either on command line or in a VCF, BED, or tab-delimited file (the default)."
|
||||
- samples_file:
|
||||
type: file
|
||||
description: "File of sample names to include or exclude if prefixed with '^'."
|
||||
- targets_file:
|
||||
type: file
|
||||
description: "Targets can be specified either on command line or in a VCF, BED, or tab-delimited file (the default)."
|
||||
|
||||
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"
|
||||
- roh:
|
||||
type: file
|
||||
description: Contains site-specific and/or per-region runs of homo/autozygosity calls.
|
||||
pattern: "*.{roh}"
|
||||
|
||||
authors:
|
||||
- "@ramprasadn"
|
|
@ -166,6 +166,10 @@ bcftools/reheader:
|
|||
- modules/bcftools/reheader/**
|
||||
- tests/modules/bcftools/reheader/**
|
||||
|
||||
bcftools/roh:
|
||||
- modules/bcftools/roh/**
|
||||
- tests/modules/bcftools/roh/**
|
||||
|
||||
bcftools/sort:
|
||||
- modules/bcftools/sort/**
|
||||
- tests/modules/bcftools/sort/**
|
||||
|
|
35
tests/modules/bcftools/roh/main.nf
Normal file
35
tests/modules/bcftools/roh/main.nf
Normal file
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env nextflow
|
||||
|
||||
nextflow.enable.dsl = 2
|
||||
|
||||
include { BCFTOOLS_ROH } from '../../../../modules/bcftools/roh/main.nf'
|
||||
|
||||
workflow test_bcftools_roh {
|
||||
|
||||
input = [ [ id:'test' ], // meta map
|
||||
file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true),
|
||||
file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)]
|
||||
|
||||
af_file = []
|
||||
gen_map = []
|
||||
regions = []
|
||||
targets = []
|
||||
samples = []
|
||||
|
||||
BCFTOOLS_ROH ( input, af_file, gen_map, regions, samples, targets )
|
||||
}
|
||||
|
||||
workflow test_bcftools_roh_stub {
|
||||
|
||||
input = [ [ id:'test' ], // meta map
|
||||
file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true),
|
||||
file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true)]
|
||||
|
||||
af_file = []
|
||||
gen_map = []
|
||||
regions = []
|
||||
targets = []
|
||||
samples = []
|
||||
|
||||
BCFTOOLS_ROH ( input, af_file, gen_map, regions, samples, targets )
|
||||
}
|
5
tests/modules/bcftools/roh/nextflow.config
Normal file
5
tests/modules/bcftools/roh/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
}
|
17
tests/modules/bcftools/roh/test.yml
Normal file
17
tests/modules/bcftools/roh/test.yml
Normal file
|
@ -0,0 +1,17 @@
|
|||
- name: "bcftools roh"
|
||||
command: nextflow run ./tests/modules/bcftools/roh -entry test_bcftools_roh -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/roh/nextflow.config
|
||||
tags:
|
||||
- "bcftools"
|
||||
- "bcftools/roh"
|
||||
files:
|
||||
- path: "output/bcftools/test.roh"
|
||||
- path: "output/bcftools/versions.yml"
|
||||
|
||||
- name: "bcftools roh stub"
|
||||
command: nextflow run ./tests/modules/bcftools/roh -entry test_bcftools_roh_stub -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/roh/nextflow.config
|
||||
tags:
|
||||
- "bcftools"
|
||||
- "bcftools/roh"
|
||||
files:
|
||||
- path: "output/bcftools/test.roh"
|
||||
- path: "output/bcftools/versions.yml"
|
Loading…
Reference in a new issue