nf-core_modules/modules/somalier/relate/main.nf
Ashot Margaryan d8ba32c6b5
Somalier relate (#2001)
* Working version of somalier relate

* few changes

* new changes

* corrected test.yml

* updated container paths and file paths

* changed container and inputFile paths

* changed left padding

* requested changes

* Update modules/somalier/relate/main.nf

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>

* Update modules/somalier/relate/main.nf

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>

* Update modules/somalier/relate/main.nf

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>

* Update modules/somalier/relate/main.nf

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>

* Update modules/somalier/relate/meta.yml

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>

* Update modules/somalier/relate/meta.yml

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>

* Update modules/somalier/relate/meta.yml

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>

* requested changes

* requested changes

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
2022-09-19 13:22:24 +02:00

46 lines
1.4 KiB
Text

process SOMALIER_RELATE {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::somalier=0.2.15" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/somalier:0.2.15--h37c5b7d_0':
'quay.io/biocontainers/somalier:0.2.15--h37c5b7d_0' }"
input:
tuple val(meta), path(extract)
path(sample_groups)
path(ped)
output:
tuple val(meta), path("*.html"), emit: html
tuple val(meta), path("*.pairs.tsv"), emit: pairs_tsv
tuple val(meta), path("*.samples.tsv"), emit: samples_tsv
path "versions.yml", emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def input_list = extract.collect{"$it"}.join(' ')
def prefix = task.ext.prefix ?: "$meta.id"
def sample_groups_command = sample_groups ? "-g $sample_groups" : ""
def ped_command = ped ? "-p $ped" : ""
"""
somalier relate \\
-o ${prefix} \\
${input_list} \\
${args} \\
${sample_groups_command} \\
${ped_command}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
somalier: \$(echo \$(somalier 2>&1) | sed 's/^.*somalier version: //; s/Commands:.*\$//')
END_VERSIONS
"""
}