Add Sexdeterrmine module

This commit is contained in:
Thiseas Christos Lamnidis 2022-04-29 14:28:45 +02:00
parent c17d1a7a7b
commit bad832c2ea
6 changed files with 126 additions and 0 deletions

View file

@ -0,0 +1,38 @@
process SEXDETERRMINE {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::sexdeterrmine=1.1.2" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/sexdeterrmine:1.1.2--hdfd78af_1':
'quay.io/biocontainers/sexdeterrmine:1.1.2--hdfd78af_1' }"
input:
tuple val(meta), path(depth)
path(sample_list_file)
output:
tuple val(meta), path("*.json"), emit: json
tuple val(meta), path("*.tsv") , emit: tsv
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}"
def sample_list = sample_list_file ? '-f ${sample_list_file}' : ''
"""
sexdeterrmine \\
-I $depth \\
$sample_list \\
$args \\
> ${prefix}.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
sexdeterrmine: \$(echo \$(sexdeterrmine --version 2>&1))
END_VERSIONS
"""
}

View file

@ -0,0 +1,48 @@
name: "sexdeterrmine"
description: Calculate the relative coverage on the Gonosomes vs Autosomes from the output of samtools depth, with error bars.
keywords:
- "sex determination"
- "genetic sex"
- "relative coverage"
tools:
- "sexdeterrmine":
description: "A python script carry out calculate the relative coverage of X and Y chromosomes, and their associated error bars, out of capture data."
homepage: "https://github.com/TCLamnidis/Sex.DetERRmine"
documentation: "https://github.com/TCLamnidis/Sex.DetERRmine/README.md"
tool_dev_url: "https://github.com/TCLamnidis/Sex.DetERRmine"
doi: "https://doi.org/10.1038/s41467-018-07483-5"
licence: "['GPL v3']"
input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
#
- depth:
type: file
description: output from samtools depth (with header)
pattern: "*"
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"
- json:
type: file
description: JSON formatted table of relative coverages on the X and Y, with associated error bars.
pattern: "*.json"
- tsv:
type: file
description: TSV table of relative coverages on the X and Y, with associated error bars.
pattern: "*.tsv"
authors:
- "@TCLamnidis"

View file

@ -1703,6 +1703,10 @@ seqwish/induce:
- modules/seqwish/induce/**
- tests/modules/seqwish/induce/**
sexdeterrmine:
- modules/sexdeterrmine/**
- tests/modules/sexdeterrmine/**
shovill:
- modules/shovill/**
- tests/modules/shovill/**

View file

@ -0,0 +1,16 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { SAMTOOLS_DEPTH } from '../../../modules/samtools/depth/main.nf'
include { SEXDETERRMINE } from '../../../modules/sexdeterrmine/main.nf'
workflow test_sexdeterrmine {
input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['sarscov2']['illumina']['test_single_end_sorted_bam'], checkIfExists: true) ]
SAMTOOLS_DEPTH ( input )
SEXDETERRMINE ( SAMTOOLS_DEPTH.out.tsv, [] )
}

View file

@ -0,0 +1,8 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName:SAMTOOLS_DEPTH {
ext.args = "-aa -H"
}
}

View file

@ -0,0 +1,12 @@
## TODO nf-core: Please run the following command to build this file:
# nf-core modules create-test-yml sexdeterrmine
- name: "sexdeterrmine"
command: nextflow run ./tests/modules/sexdeterrmine -entry test_sexdeterrmine -c ./tests/config/nextflow.config -c ./tests/modules/sexdeterrmine/nextflow.config
tags:
- "sexdeterrmine"
#
files:
- path: "output/sexdeterrmine/test.bam"
md5sum: e667c7caad0bc4b7ac383fd023c654fc
- path: output/sexdeterrmine/versions.yml
md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b