Added Somalier extract module (#1986)

* Added Somalier extract module

* changed somalier_dbg4 to somalier for versions.yml

* added  and minor changes in meta.yml

* Apply suggestions from code review

* Update main.nf

* Typo in quay.io rl

* updated the input

* new updates

* linting

* linting

* changed the test.yml

* Update modules/somalier/extract/main.nf

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

* Update modules/somalier/extract/main.nf

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

* Update modules/somalier/extract/meta.yml

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

* Update modules/somalier/extract/main.nf

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

* Update tests/modules/somalier/extract/main.nf

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

* Update modules/somalier/extract/main.nf

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

* Update tests/modules/somalier/extract/test.yml

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

* last changes

* Update modules/somalier/extract/meta.yml

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

* Update modules/somalier/extract/meta.yml

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

* Update modules/somalier/extract/main.nf

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

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
This commit is contained in:
Ashot Margaryan 2022-09-19 08:58:17 +02:00 committed by GitHub
parent 38383cfaef
commit f62e4cf5f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 144 additions and 0 deletions

View file

@ -0,0 +1,39 @@
process SOMALIER_EXTRACT {
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(bam), path(bai)
tuple path(ref), path(refidx)
path(sites)
output:
tuple val(meta), path("*.somalier"), emit: extract
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}"
"""
somalier extract \\
--sites ${sites} \\
-f ${ref} \\
${bam} \\
${args}
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,65 @@
name: "somalier_extract"
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 ]
- input:
type: file
description: BAM/CRAM/SAM/BCF/VCF/GVCF or jointly-called VCF file
- input_index:
type: file
description: index file of the input data, e.g., bam.bai, cram.crai
- fasta:
type: file
description: The reference fasta file
pattern: "*.{fasta,fna,fas,fa}"
- fai:
type: file
description: FASTA index file
pattern: "*.fai"
- sites:
type: file
description: sites file in VCF format which can be taken from https://github.com/brentp/somalier
pattern: "*.vcf.gz"
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"
- somalierExtract:
type: file
description: binary output file based on extracted sites
pattern: "*.{somalier}"
authors:
- "@ashotmarg"

View file

@ -2215,6 +2215,10 @@ snpsites:
- modules/snpsites/**
- tests/modules/snpsites/**
somalier/extract:
- modules/somalier/extract/**
- tests/modules/somalier/extract/**
sourmash/sketch:
- modules/sourmash/sketch/**
- tests/modules/sourmash/sketch/**

View file

@ -0,0 +1,23 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { SOMALIER_EXTRACT } from '../../../../modules/somalier/extract/main.nf'
fasta = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true)
fasta_fai = file(params.test_data['homo_sapiens']['genome']['genome_21_fasta_fai'], checkIfExists: true)
sites = file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/somalier/sites_chr21.hg38.vcf.gz", checkIfExists: true)
workflow test_somalier_extract {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_markduplicates_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_markduplicates_sorted_bam_bai'], checkIfExists: true)
]
SOMALIER_EXTRACT ( input, [fasta, fasta_fai], sites )
}

View file

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

View file

@ -0,0 +1,8 @@
- name: somalier extract test_somalier_extract
command: nextflow run ./tests/modules/somalier/extract/main.nf -c ./tests/config/nextflow.config -c ./tests/modules/somalier/extract/nextflow.config -entry test_somalier_extract
tags:
- somalier/extract
- somalier
files:
- path: output/somalier/normal.somalier
md5sum: 21f0b980edd42ddaa8ab964959c1de02