Merge branch 'master' into bat-test

This commit is contained in:
Gregor Sturm 2022-01-21 08:33:58 +01:00 committed by GitHub
commit 213cd6d466
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 142 additions and 26 deletions

View file

@ -48,11 +48,6 @@ jobs:
restore-keys: | restore-keys: |
${{ runner.os }}-pip- ${{ runner.os }}-pip-
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install Python dependencies - name: Install Python dependencies
run: python -m pip install --upgrade pip pytest-workflow run: python -m pip install --upgrade pip pytest-workflow
@ -96,13 +91,8 @@ jobs:
- name: Output log on failure - name: Output log on failure
if: failure() if: failure()
run: | run: |
sudo apt install bat sudo apt install -qq bat
echo "======> log.out <=======" bat /home/runner/pytest_workflow_*/*/log.{out,err}
bat /home/runner/pytest_workflow_*/*/log.out
echo
echo
echo "======> log.err <======="
bat /home/runner/pytest_workflow_*/*/log.err
- name: Upload logs on failure - name: Upload logs on failure
if: failure() if: failure()

View file

@ -1,13 +1,11 @@
def VERSION = '0.1' // Version information not provided by tool on CLI
process CHROMAP_CHROMAP { process CHROMAP_CHROMAP {
tag "$meta.id" tag "$meta.id"
label 'process_medium' label 'process_medium'
conda (params.enable_conda ? "bioconda::chromap=0.1 bioconda::samtools=1.13" : null) conda (params.enable_conda ? "bioconda::chromap=0.1.5 bioconda::samtools=1.14" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:2cad7c5aa775241887eff8714259714a39baf016-0' : 'https://depot.galaxyproject.org/singularity/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:724a1037d59f6a19c9d4e7bdba77b52b37de0dc3-0' :
'quay.io/biocontainers/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:2cad7c5aa775241887eff8714259714a39baf016-0' }" 'quay.io/biocontainers/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:724a1037d59f6a19c9d4e7bdba77b52b37de0dc3-0' }"
input: input:
tuple val(meta), path(reads) tuple val(meta), path(reads)
@ -45,7 +43,7 @@ process CHROMAP_CHROMAP {
args_list << "--pairs-natural-chr-order $pairs_chr_order" args_list << "--pairs-natural-chr-order $pairs_chr_order"
} }
def final_args = args_list.join(' ') def final_args = args_list.join(' ')
def compression_cmds = "gzip ${prefix}.${file_extension}" def compression_cmds = "gzip -n ${prefix}.${file_extension}"
if (args.contains("--SAM")) { if (args.contains("--SAM")) {
compression_cmds = """ compression_cmds = """
samtools view $args2 -@ $task.cpus -bh \\ samtools view $args2 -@ $task.cpus -bh \\
@ -67,7 +65,8 @@ process CHROMAP_CHROMAP {
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
"${task.process}": "${task.process}":
chromap: $VERSION chromap: \$(echo \$(chromap --version 2>&1))
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS END_VERSIONS
""" """
} else { } else {
@ -85,7 +84,8 @@ process CHROMAP_CHROMAP {
cat <<-END_VERSIONS > versions.yml cat <<-END_VERSIONS > versions.yml
"${task.process}": "${task.process}":
chromap: $VERSION chromap: \$(echo \$(chromap --version 2>&1))
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS END_VERSIONS
""" """
} }

34
modules/vcfanno/main.nf Normal file
View file

@ -0,0 +1,34 @@
process VCFANNO {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::vcfanno=0.3.3" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/vcfanno:0.3.3--h9ee0642_0':
'quay.io/biocontainers/vcfanno:0.3.3--h9ee0642_0' }"
input:
tuple val(meta), path(vcf), path(tbi)
path vcfanno_config
output:
tuple val(meta), path("*.vcf"), emit: vcf
path "versions.yml" , emit: versions
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
vcfanno \\
-p $task.cpus \\
$args \\
$vcfanno_config \\
$vcf \\
> ${prefix}_annotated.vcf
cat <<-END_VERSIONS > versions.yml
"${task.process}":
vcfanno: \$(echo \$(vcfanno 2>&1 | grep version | cut -f3 -d' ' ))
END_VERSIONS
"""
}

56
modules/vcfanno/meta.yml Normal file
View file

@ -0,0 +1,56 @@
name: vcfanno
description: quickly annotate your VCF with any number of INFO fields from any number of VCFs or BED files
keywords:
- vcf
- bed
- annotate
- variant
tools:
- vcfanno:
description: annotate a VCF with other VCFs/BEDs/tabixed files
homepage: None
documentation: https://github.com/brentp/vcfanno#vcfanno
tool_dev_url: https://github.com/brentp/vcfanno
doi: "10.1186/s13059-016-0973-5"
licence: ["MIT"]
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- vcf:
type: file
description: query VCF file
pattern: "*.{vcf.gz}"
- vcf.tbi:
type: file
description: query VCF file index
pattern: "*.{vcf.gz.tbi}"
- vcfanno_config:
type: file
description: |
A simple configuration file is used to specify both the source files
and the set of attributes (in the case of VCF)
or columns (in the case of BED or other tab-delimited formats)
that should be added to the query file.
pattern: "*.{toml}"
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: Annotated VCF file
pattern: "*.{vcf}"
authors:
- "@projectoriented"

View file

@ -1493,6 +1493,10 @@ variantbam:
- modules/variantbam/** - modules/variantbam/**
- tests/modules/variantbam/** - tests/modules/variantbam/**
vcfanno:
- modules/vcfanno/**
- tests/modules/vcfanno/**
vcflib/vcfuniq: vcflib/vcfuniq:
- modules/vcflib/vcfuniq/** - modules/vcflib/vcfuniq/**
- tests/modules/vcflib/vcfuniq/** - tests/modules/vcflib/vcfuniq/**

View file

@ -5,9 +5,8 @@
- chromap - chromap
files: files:
- path: output/chromap/genome.index - path: output/chromap/genome.index
md5sum: f889d5f61d80823766af33277d27d386
- path: output/chromap/test.bed.gz - path: output/chromap/test.bed.gz
md5sum: 7029066c27ac6f5ef18d660d5741979a md5sum: 25e40bde24c7b447292cd68573728694
- name: chromap chromap test_chromap_chromap_paired_end - name: chromap chromap test_chromap_chromap_paired_end
command: nextflow run ./tests/modules/chromap/chromap -entry test_chromap_chromap_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/chromap/chromap/nextflow.config command: nextflow run ./tests/modules/chromap/chromap -entry test_chromap_chromap_paired_end -c ./tests/config/nextflow.config -c ./tests/modules/chromap/chromap/nextflow.config
@ -16,9 +15,8 @@
- chromap - chromap
files: files:
- path: output/chromap/genome.index - path: output/chromap/genome.index
md5sum: f889d5f61d80823766af33277d27d386
- path: output/chromap/test.bed.gz - path: output/chromap/test.bed.gz
md5sum: cafd8fb21977f5ae69e9008b220ab169 md5sum: 7cdc8448882b75811e0c784f5f20aef2
- name: chromap chromap test_chromap_chromap_paired_bam - name: chromap chromap test_chromap_chromap_paired_bam
command: nextflow run ./tests/modules/chromap/chromap -entry test_chromap_chromap_paired_bam -c ./tests/config/nextflow.config -c ./tests/modules/chromap/chromap/nextflow.config command: nextflow run ./tests/modules/chromap/chromap -entry test_chromap_chromap_paired_bam -c ./tests/config/nextflow.config -c ./tests/modules/chromap/chromap/nextflow.config
@ -27,6 +25,5 @@
- chromap - chromap
files: files:
- path: output/chromap/genome.index - path: output/chromap/genome.index
md5sum: f889d5f61d80823766af33277d27d386
- path: output/chromap/test.bam - path: output/chromap/test.bam
md5sum: bd1e3fe0f3abd1430ae191754f16a3ed md5sum: 73e2c76007e3c61df625668e01b3f42f

View file

@ -5,3 +5,5 @@
- chromap - chromap
files: files:
- path: output/chromap/genome.index - path: output/chromap/genome.index

View file

@ -0,0 +1,19 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { VCFANNO } from '../../../modules/vcfanno/main.nf'
workflow test_vcfanno {
input = [
[ id:'test', single_end:false ], // 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)
]
toml = file("https://raw.githubusercontent.com/nf-core/test-datasets/8fbd9f99a2feb3f9e39cd3bcdc4a9176a5835673/data/delete_me/vcfanno.toml",
checkIfExists: true)
VCFANNO ( input, toml )
}

View file

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

View file

@ -0,0 +1,9 @@
- name: vcfanno test_vcfanno
command: nextflow run tests/modules/vcfanno -entry test_vcfanno -c tests/config/nextflow.config
tags:
- vcfanno
files:
- path: output/vcfanno/test_annotated.vcf
md5sum: 34259cf6b0a4698a2917ad3554b50c0f
- path: output/vcfanno/versions.yml
md5sum: 62d13540503b22f04a2280c91942cb03