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>
This commit is contained in:
Ashot Margaryan 2022-09-19 13:22:24 +02:00 committed by GitHub
parent 90aef30f43
commit d8ba32c6b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 176 additions and 0 deletions

View file

@ -0,0 +1,46 @@
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
"""
}

View file

@ -0,0 +1,62 @@
name: "somalier_relate"
description: Somalier can extract informative sites, evaluate relatedness, and perform quality-control on BAM/CRAM/BCF/VCF/GVCF or from jointly-called VCFs
keywords:
- relatedness
- QC
- bam
- cram
- vcf
- gvcf
- ancestry
- identity
- kinship
- informative sites
- family
tools:
- "somalier":
description: "Somalier can extract informative sites, evaluate relatedness, and perform quality-control on BAM/CRAM/BCF/VCF/GVCF or from jointly-called VCFs"
homepage: "https://github.com/brentp/somalier"
documentation: "https://github.com/brentp/somalier/blob/master/README.md"
tool_dev_url: "https://github.com/brentp/somalier"
doi: "https://doi.org/10.1186/s13073-020-00761-2"
licence: "MIT License"
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- extract:
type: file
description: extract file from Somlaier extract
pattern: "*.somalier"
- sample_groups:
type: file
description: optional path to expected groups of samples such as tumor normal pairs specified as comma-separated groups per line
pattern: "*.{txt,csv}"
- ped:
type: file
description: optional path to a ped or fam file indicating the expected relationships among samples
pattern: "*.{ped,fam}"
output:
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- html:
type: file
description: html file
pattern: "*.html"
- pairs_tsv:
type: file
description: tsv file with output stats for pairs of samples
pattern: "*.pairs.tsv"
- samples_tsv:
type: file
description: tsv file with sample-level information
pattern: "*.samples.tsv"
authors:
- "@ashotmarg"

View file

@ -2223,6 +2223,10 @@ somalier/extract:
- modules/somalier/extract/** - modules/somalier/extract/**
- tests/modules/somalier/extract/** - tests/modules/somalier/extract/**
somalier/relate:
- modules/somalier/relate/**
- tests/modules/somalier/relate/**
sourmash/sketch: sourmash/sketch:
- modules/sourmash/sketch/** - modules/sourmash/sketch/**
- tests/modules/sourmash/sketch/** - tests/modules/sourmash/sketch/**

View file

@ -0,0 +1,30 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { SOMALIER_RELATE } from '../../../../modules/somalier/relate/main.nf'
workflow test_somalier_relate {
input = [ [ id:'cohort', single_end:false ], // meta map
[ file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/somalier/normal.somalier", checkIfExists: true),
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/somalier/tumour.somalier", checkIfExists: true) ]
]
SOMALIER_RELATE (input,[],[])
}
workflow test_somalier_relate_ped_groups {
input = [ [ id:'cohort', single_end:false ], // meta map
[ file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/somalier/normal.somalier", checkIfExists: true),
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/somalier/tumour.somalier", checkIfExists: true) ]
]
groups = file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/somalier/groups.txt", checkIfExists: true)
ped = file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/somalier/family.ped", checkIfExists: true)
SOMALIER_RELATE (input,groups,ped)
}

View file

@ -0,0 +1,9 @@
params.prefix = ""
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName:SOMALIER_RELATE {
ext.prefix = { params.prefix ? "${params.prefix}." : ""}
}
}

View file

@ -0,0 +1,25 @@
- name: somalier relate test_somalier_relate
command: nextflow run ./tests/modules/somalier/relate/main.nf -c ./tests/config/nextflow.config -c ./tests/modules/somalier/relate/nextflow.config -entry test_somalier_relate
tags:
- somalier/relate
- somalier
files:
- path: output/somalier/cohort.html
md5sum: 03cac9b2c67a8a06f63e07f83ee11e18
- path: output/somalier/cohort.pairs.tsv
md5sum: 54d1e9fca1bf9d747d4254c6fa98edcf
- path: output/somalier/cohort.samples.tsv
md5sum: 97257d88886db1325c4d7d10cefa7169
- name: somalier relate test_somalier_relate_ped_groups
command: nextflow run ./tests/modules/somalier/relate/main.nf -c ./tests/config/nextflow.config -c ./tests/modules/somalier/relate/nextflow.config -entry test_somalier_relate_ped_groups
tags:
- somalier/relate
- somalier
files:
- path: output/somalier/cohort.html
md5sum: 0d573016c9279ccdfdcfd4eb01d73b89
- path: output/somalier/cohort.pairs.tsv
md5sum: 8655714f1e5359329188e9f501168131
- path: output/somalier/cohort.samples.tsv
md5sum: 38ef93340e55fbeef47640abda9e48b0