Merge branch 'master' into kat_hist

This commit is contained in:
Mahesh Binzer-Panchal 2022-05-24 23:10:13 +02:00 committed by GitHub
commit 3d51956b88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 177 additions and 0 deletions

View 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
"""
}

View 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"

View file

@ -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/**

View 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 )
}

View file

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

View 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"