Creation of Glimpse Chunk (#1985)

* Creation of Glimpse Chunk
Add sub tools chunk with configuration and needed files for unitest.

* Code linting correction

* Prettier ran
Newline deleted in nextflow.config

* New final line and white spaces

* Change Pytest.yml to work as a subtool.

* Control for the parameters deleted.
Control for the size/count of the window and buffer not needed.
They have some defaults value.

* Changed the different recommended part by @nvnieuwk

Co-authored-by: nvnieuwk <101190534+nvnieuwk@users.noreply.github.com>
master
Louis LENEZET 2 years ago committed by GitHub
parent 2f1555bf77
commit 01d6d4c286
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,39 @@
process GLIMPSE_CHUNK {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::glimpse-bio=1.1.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/glimpse-bio:1.1.1--h2ce4488_2':
'quay.io/biocontainers/glimpse-bio:1.1.1--hce55b13_1' }"
input:
tuple val(meta), path(input)
val region
output:
tuple val(meta), path("*.txt"), emit: chunk_chr
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def prefix = task.ext.prefix ?: "${meta.id}"
def args = task.ext.args ?: ""
def VERSION = '1.1.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
GLIMPSE_chunk \\
$args \\
--input $input \\
--region $region \\
--thread $task.cpus \\
--output ${prefix}.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
glimpse: $VERSION
END_VERSIONS
"""
}

@ -0,0 +1,52 @@
name: "glimpse_chunk"
description: Defines chunks where to run imputation
keywords:
- chunk
- imputation
tools:
- "glimpse":
description: "GLIMPSE is a phasing and imputation method for large-scale low-coverage sequencing studies."
homepage: "https://odelaneau.github.io/GLIMPSE"
documentation: "https://odelaneau.github.io/GLIMPSE/commands.html"
tool_dev_url: "https://github.com/odelaneau/GLIMPSE"
doi: "10.1038/s41588-020-00756-0"
licence: "['MIT']"
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- input:
type: file
description: |
Target dataset in VCF/BCF format defined at all variable positions.
The file could possibly be without GT field (for efficiency reasons a file containing only the positions is recommended).
pattern: "*.{vcf,bcf}"
- region:
type: string
description: |
Target region, usually a full chromosome (e.g. chr20:1000000-2000000 or chr20).
For chrX, please treat PAR and non-PAR regions as different choromosome in order to avoid mixing ploidy.
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"
- txt:
type: file
description: Tab delimited output txt file containing buffer and imputation regions.
pattern: "*.{txt}"
authors:
- "@louislenezet"

@ -1015,6 +1015,10 @@ gffread:
- modules/gffread/**
- tests/modules/gffread/**
glimpse/chunk:
- modules/glimpse/chunk/**
- tests/modules/glimpse/chunk/**
glnexus:
- modules/glnexus/**
- tests/modules/glnexus/**

@ -0,0 +1,14 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { GLIMPSE_CHUNK } from '../../../../modules/glimpse/chunk/main.nf'
workflow test_glimpse_chunk {
input = [
[ id:'test', single_end:false ], // meta map
[file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz'], checkIfExists: true),
file(params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz_tbi'], checkIfExists: true)]
]
GLIMPSE_CHUNK (input,"chr21")
}

@ -0,0 +1,10 @@
process {
withName: glimpse_chunk {
ext.args = [
"--window-size 2000000",
"--buffer-size 200000"
].join(' ')
ext.prefix = { "${meta.id}" }
}
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

@ -0,0 +1,8 @@
- name: glimpse chunk test_glimpse_chunk
command: nextflow run ./tests/modules/glimpse/chunk -entry test_glimpse_chunk -c ./tests/config/nextflow.config -c ./tests/modules/glimpse/chunk/nextflow.config
tags:
- glimpse
- glimpse/chunk
files:
- path: output/glimpse/test.txt
md5sum: c690cdcc7aa086bb85431bb2b193176f
Loading…
Cancel
Save